SSE4a with ctypes in python? (gcc __builtin_popcount)

est electronixtar at gmail.com
Sun Oct 30 23:13:00 EDT 2011


Hi guys,

Here is the sample code

http://stackoverflow.com/questions/6389841/efficiently-find-binary-strings-with-low-hamming-distance-in-large-set/6390606#6390606

static inline int distance(unsigned x, unsigned y)
{
    return __builtin_popcount(x^y);
}

Is it possible to rewrite the above gcc code in python using ctypes
(preferably Win/*nix compatible)?

TIA!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20111031/2bb67823/attachment.html>


More information about the Python-list mailing list