linbin
linbin copied to clipboard
Linear vs binary search benchmark
I tested it found that for 128 size array binary_cmov is slower than binary on my x86_64, 8 CPU cores, and CPU MHz: 2194.916 machine, which showed binary_cmov was slower...
In particular, the file `linear-sentinel-simd.h` contains GCC specific __builtin functions like `__builtin_ia32_pcmpgtd128` and `__builtin_ia32_packsswb128`. They fail to compile in Xcode 9 because clang does not support them ([Ref 1](http://clang.llvm.org/compatibility.html#vector_builtins))
Since the comments on the blog post are closed, I'll say it here: The standard way to elicit a cmov is the ternary operator. This is vastly preferable to doing...