8000 Merge pull request #6438 from juliantaylor/msvc-workaround · numpy/numpy@696ccc4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 696ccc4

Browse files
committed
Merge pull request #6438 from juliantaylor/msvc-workaround
BUG: mask nan to 1 in ordered compare
2 parents 014e631 + fbf549b commit 696ccc4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

numpy/core/src/umath/simd.inc.src

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,11 +539,13 @@ sse2_compress4_to_byte_@TYPE@(@vtype@ r1, @vtype@ r2, @vtype@ r3, @vtype@ * r4,
539539
static NPY_INLINE int
540540
sse2_ordered_cmp_@kind@_@TYPE@(const @type@ a, const @type@ b)
541541
{
542+
@vtype@ one = @vpre@_set1_@vsuf@(1);
542543
@type@ tmp;
543544
@vtype@ v = @vpre@_@VOP@_@vsufs@(@vpre@_load_@vsufs@(&a),
544545
@vpre@_load_@vsufs@(&b));
546+
v = @vpre@_and_@vsuf@(v, one);
545547
@vpre@_store_@vsufs@(&tmp, v);
546-
return !(tmp == 0.);
548+
return tmp;
547549
}
548550

549551
static void

0 commit comments

Comments
 (0)
0