aboutsummaryrefslogtreecommitdiff
path: root/math/powf.c
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2018-05-10 17:53:31 +0100
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2018-05-16 13:52:13 +0100
commitc65db17340782d647c49e17cbba244862dc38402 (patch)
tree781a38089ac7431fba502e213a328bca0f3a0b14 /math/powf.c
parent2f2d687988c6614e3d2f8636dce5b2d1a10683e5 (diff)
downloadarm-optimized-routines-c65db17340782d647c49e17cbba244862dc38402.tar.gz
Use fixed 32bit sign argument to error functions
Ideally sign should be bool, but we don't want to depend on stdbool.h and sometimes (e.g. in powf) it's more efficient to pass a non-zero value than 1 to indicate that the sign should be set. While working on double precision versions i realized that the unsigned long argument is fragile (may fail on 32bit targets only).
Diffstat (limited to 'math/powf.c')
-rw-r--r--math/powf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/math/powf.c b/math/powf.c
index de9195f..70c535e 100644
--- a/math/powf.c
+++ b/math/powf.c
@@ -87,7 +87,7 @@ log2_inline (uint32_t ix)
(in case of fast toint intrinsics) or not. The unscaled xd must be
in [-1021,1023], sign_bias sets the sign of the result. */
static inline double_t
-exp2_inline (double_t xd, unsigned long sign_bias)
+exp2_inline (double_t xd, uint32_t sign_bias)
{
uint64_t ki, ski, t;
/* double_t for better performance on targets with FLT_EVAL_METHOD==2. */
@@ -146,7 +146,7 @@ zeroinfnan (uint32_t ix)
float
powf (float x, float y)
{
- unsigned long sign_bias = 0;
+ uint32_t sign_bias = 0;
uint32_t ix, iy;
ix = asuint (x);