SSE4a with ctypes in python? (gcc __builtin_popcount)

est electronixtar at gmail.com
Mon Oct 31 04:39:47 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!



More information about the Python-list mailing list