Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix _mm_test_mix_ones_zeros and _mm_testnzc_si128 (#621)
One error is the use of a logical NOT (`!a[0]`) was instead of a bitwise NOT (`~_a[0]`). Bug: `_mm_test_mix_ones_zeros` always returned true. The function wasn't reducing `zf` and `cf` to a bool before combining them. The fix proposed here isn't the most efficient, but at least it is correct. NOTE: * The arguments are named incorrectly in the `_mm_test_mix_ones_zeros` documentation[0]. * The second argument is the mask, as per the behavior of `_mm_test_mix_ones_zeros` with gcc and clang. * This naming error seems to have propagated through both gcc[1] and llvm[2] headers but not to rust[3] headers. [0] https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=ptest&techs=SSE_ALL&ig_expand=6902 [1] https://github.com/gcc-mirror/gcc/blob/27ce74fa23c93c1189c301993cd19ea766e6bdb5/gcc/config/i386/smmintrin.h#L94 [2] https://github.com/llvm/llvm-project/blob/70535f5e609f747c28cfef699eefb84581b0aac0/clang/lib/Headers/smmintrin.h#L1130 [3] https://github.com/rust-lang/stdarch/blob/f4528dd6e85d97bb802240d7cd048b6e1bf72540/crates/core_arch/src/x86/sse41.rs#L1149
- Loading branch information