diff --git a/numpy/core/src/umath/loops_comparison.dispatch.c.src b/numpy/core/src/umath/loops_comparison.dispatch.c.src index 2f75593a552b..e87db067b07c 100644 --- a/numpy/core/src/umath/loops_comparison.dispatch.c.src +++ b/numpy/core/src/umath/loops_comparison.dispatch.c.src @@ -234,7 +234,7 @@ static void simd_binary_@kind@_b8(char **args, npy_intp len) npyv_b8 a = npyv_cmpeq_u8(npyv_load_u8(src1), vzero); npyv_b8 b = npyv_cmpeq_u8(npyv_load_u8(src2), vzero); npyv_b8 c = npyv_@VOP@_b8(a, b); - npyv_store_u8(dst, npyv_andc_u8(npyv_cvt_u8_b8(c), truemask)); + npyv_store_u8(dst, npyv_and_u8(npyv_cvt_u8_b8(c), truemask)); } for (; len > 0; --len, ++src1, ++src2, ++dst) { @@ -258,7 +258,7 @@ static void simd_binary_scalar1_@kind@_b8(char **args, npy_intp len) for (; len >= vstep; len -= vstep, src += vstep, dst += vstep) { npyv_b8 b = npyv_cmpeq_u8(npyv_load_u8(src), vzero); npyv_b8 c = npyv_@VOP@_b8(a, b); - npyv_store_u8(dst, npyv_andc_u8(npyv_cvt_u8_b8(c), truemask)); + npyv_store_u8(dst, npyv_and_u8(npyv_cvt_u8_b8(c), truemask)); } for (; len > 0; --len, ++src, ++dst) { @@ -281,7 +281,7 @@ static void simd_binary_scalar2_@kind@_b8(char **args, npy_intp len) for (; len >= vstep; len -= vstep, src += vstep, dst += vstep) { npyv_b8 a = npyv_cmpeq_u8(npyv_load_u8(src), vzero); npyv_b8 c = npyv_@VOP@_b8(a, b); - npyv_store_u8(dst, npyv_andc_u8(npyv_cvt_u8_b8(c), truemask)); + npyv_store_u8(dst, npyv_and_u8(npyv_cvt_u8_b8(c), truemask)); } for (; len > 0; --len, ++src, ++dst) { diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py index 884578860712..bcfed91a7586 100644 --- a/numpy/core/tests/test_umath.py +++ b/numpy/core/tests/test_umath.py @@ -284,16 +284,16 @@ def test_comparison_functions(self, dtype, py_comp, np_comp): b_lst = b.tolist() # (Binary) Comparison (x1=array, x2=array) - comp_b = np_comp(a, b) - comp_b_list = [py_comp(x, y) for x, y in zip(a_lst, b_lst)] + comp_b = np_comp(a, b).view(np.uint8) + comp_b_list = [int(py_comp(x, y)) for x, y in zip(a_lst, b_lst)] # (Scalar1) Comparison (x1=scalar, x2=array) - comp_s1 = np_comp(np_scalar, b) - comp_s1_list = [py_comp(scalar, x) for x in b_lst] + comp_s1 = np_comp(np_scalar, b).view(np.uint8) + comp_s1_list = [int(py_comp(scalar, x)) for x in b_lst] # (Scalar2) Comparison (x1=array, x2=scalar) - comp_s2 = np_comp(a, np_scalar) - comp_s2_list = [py_comp(x, scalar) for x in a_lst] + comp_s2 = np_comp(a, np_scalar).view(np.uint8) + comp_s2_list = [int(py_comp(x, scalar)) for x in a_lst] # Sequence: Binary, Scalar1 and Scalar2 assert_(comp_b.tolist() == comp_b_list,