Skip to content

Commit

Permalink
BUG, SIMD: Fix invalid value encountered in cos/sin on aarch64 & ppc64le
Browse files Browse the repository at this point in the history
  • Loading branch information
seiko2plus authored and charris committed Dec 19, 2022
1 parent 6bbc09d commit 0398998
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion numpy/core/src/common/simd/neon/operators.h
Expand Up @@ -248,7 +248,7 @@ NPY_FINLINE npyv_b32 npyv_cmpgtq_f32(npyv_f32 a, npyv_f32 b)
{
npyv_f32 max = vmaxq_f32(a, b);
npyv_b32 nnan = vceqq_f32(max, max);
return vandq_u32(nnan, vceqq_f32(max, b));
return vbicq_u32(nnan, vceqq_f32(max, b));
}
#define npyv_cmpleq_f32(A, B) npyv_cmpgeq_f32(B, A)
#define npyv_cmpltq_f32(A, B) npyv_cmpgtq_f32(B, A)
Expand Down
2 changes: 1 addition & 1 deletion numpy/core/src/umath/loops_trigonometric.dispatch.c.src
Expand Up @@ -124,7 +124,7 @@ simd_sincos_f32(const float *src, npy_intp ssrc, float *dst, npy_intp sdst,
} else {
x_in = npyv_loadn_tillz_f32(src, ssrc, len);
}
npyv_b32 simd_mask = npyv_cmple_f32(npyv_abs_f32(x_in), max_cody);
npyv_b32 simd_mask = npyv_cmpleq_f32(npyv_abs_f32(x_in), max_cody);
npy_uint64 simd_maski = npyv_tobits_b32(simd_mask);
/*
* For elements outside of this range, Cody-Waite's range reduction
Expand Down

0 comments on commit 0398998

Please sign in to comment.