aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilco Dijkstra <wilco.dijkstra@arm.com>2023-11-16 15:20:35 +0000
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2023-11-16 15:28:04 +0000
commit74778e88a33cd2ad0b69596925b4f09db2d2515e (patch)
tree296e15b0fcb14597117bd1f9f71b350ff500f21b
parentc35be8f11edb0676fe9ef4b038222a8d6729519f (diff)
downloadarm-optimized-routines-74778e88a33cd2ad0b69596925b4f09db2d2515e.tar.gz
pl/math: Remove redundant invert
Remove redundant invert in the !WANT_SIMD_EXCEPT path.
-rw-r--r--pl/math/v_expm1_2u5.c2
-rw-r--r--pl/math/v_expm1f_1u6.c2
-rw-r--r--pl/math/v_sincos_common.h4
-rw-r--r--pl/math/v_sincosf_common.h4
-rw-r--r--pl/math/v_tan_3u5.c2
5 files changed, 5 insertions, 9 deletions
diff --git a/pl/math/v_expm1_2u5.c b/pl/math/v_expm1_2u5.c
index f867361..2b21643 100644
--- a/pl/math/v_expm1_2u5.c
+++ b/pl/math/v_expm1_2u5.c
@@ -72,7 +72,7 @@ float64x2_t VPCS_ATTR V_NAME_D1 (expm1) (float64x2_t x)
x = vreinterpretq_f64_u64 (vbicq_u64 (ix, special));
#else
/* Large input, NaNs and Infs. */
- uint64x2_t special = vceqzq_u64 (vcaltq_f64 (x, d->oflow_bound));
+ uint64x2_t special = vcageq_f64 (x, d->oflow_bound);
#endif
/* Reduce argument to smaller range:
diff --git a/pl/math/v_expm1f_1u6.c b/pl/math/v_expm1f_1u6.c
index ea6f255..8d5cf7f 100644
--- a/pl/math/v_expm1f_1u6.c
+++ b/pl/math/v_expm1f_1u6.c
@@ -70,7 +70,7 @@ float32x4_t VPCS_ATTR V_NAME_F1 (expm1) (float32x4_t x)
x = vreinterpretq_f32_u32 (vbicq_u32 (ix, special));
#else
/* Handles very large values (+ve and -ve), +/-NaN, +/-Inf. */
- uint32x4_t special = vceqzq_u32 (vcaltq_f32 (x, d->oflow_bound));
+ uint32x4_t special = vcagtq_f32 (x, d->oflow_bound);
#endif
/* Reduce argument to smaller range:
diff --git a/pl/math/v_sincos_common.h b/pl/math/v_sincos_common.h
index f1677fb..ee7937e 100644
--- a/pl/math/v_sincos_common.h
+++ b/pl/math/v_sincos_common.h
@@ -31,9 +31,7 @@ static const struct v_sincos_data
static inline uint64x2_t
check_ge_rangeval (float64x2_t x, const struct v_sincos_data *d)
{
- uint64x2_t in_bounds = vcaltq_f64 (x, d->range_val);
- uint64x2_t special = vceqzq_u64 (in_bounds);
- return special;
+ return vcagtq_f64 (x, d->range_val);
}
/* Double-precision vector function allowing calculation of both sin and cos in
diff --git a/pl/math/v_sincosf_common.h b/pl/math/v_sincosf_common.h
index eac4d75..8239bd9 100644
--- a/pl/math/v_sincosf_common.h
+++ b/pl/math/v_sincosf_common.h
@@ -24,9 +24,7 @@ const static struct v_sincosf_data
static inline uint32x4_t
check_ge_rangeval (float32x4_t x, const struct v_sincosf_data *d)
{
- uint32x4_t in_bounds = vcaltq_f32 (x, d->range_val);
- uint32x4_t special = vceqzq_u32 (in_bounds);
- return special;
+ return vcagtq_f32 (x, d->range_val);
}
/* Single-precision vector function allowing calculation of both sin and cos in
diff --git a/pl/math/v_tan_3u5.c b/pl/math/v_tan_3u5.c
index b390c92..e483528 100644
--- a/pl/math/v_tan_3u5.c
+++ b/pl/math/v_tan_3u5.c
@@ -103,7 +103,7 @@ float64x2_t VPCS_ATTR V_NAME_D1 (tan) (float64x2_t x)
uint64x2_t no_recip = vtstq_u64 (vreinterpretq_u64_s64 (qi), v_u64 (1));
#if !WANT_SIMD_EXCEPT
- uint64x2_t special = vceqzq_u64 (vcaleq_f64 (x, dat->range_val));
+ uint64x2_t special = vcageq_f64 (x, dat->range_val);
if (unlikely (v_any_u64 (special)))
return special_case (x);
#endif