summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2015-10-10 00:36:20 +0200
committerJulian Taylor <jtaylor.debian@googlemail.com>2015-10-10 00:43:33 +0200
commitfbf549b9c2912a356dfeb71f3a411874879c9556 (patch)
tree36c9912a8915d603d216c47ba9b66c918070cf9e
parenta62abc814584047e22a630c92fe355783a5e9fc7 (diff)
downloadnumpy-fbf549b9c2912a356dfeb71f3a411874879c9556.tar.gz
BUG: mask nan to 1 in ordered compare
msvc2008 32 bit seems to miscompile it otherwise. closes gh-6428
-rw-r--r--numpy/core/src/umath/simd.inc.src4
1 files changed, 3 insertions, 1 deletions
diff --git a/numpy/core/src/umath/simd.inc.src b/numpy/core/src/umath/simd.inc.src
index 7652f18c5..48c29483f 100644
--- a/numpy/core/src/umath/simd.inc.src
+++ b/numpy/core/src/umath/simd.inc.src
@@ -536,11 +536,13 @@ sse2_compress4_to_byte_@TYPE@(@vtype@ r1, @vtype@ r2, @vtype@ r3, @vtype@ * r4,
static NPY_INLINE int
sse2_ordered_cmp_@kind@_@TYPE@(const @type@ a, const @type@ b)
{
+ @vtype@ one = @vpre@_set1_@vsuf@(1);
@type@ tmp;
@vtype@ v = @vpre@_@VOP@_@vsufs@(@vpre@_load_@vsufs@(&a),
@vpre@_load_@vsufs@(&b));
+ v = @vpre@_and_@vsuf@(v, one);
@vpre@_store_@vsufs@(&tmp, v);
- return !(tmp == 0.);
+ return tmp;
}
static void