diff options
author | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2016-08-30 13:01:59 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2016-08-30 13:01:59 +0530 |
commit | 9d84d0e51d0a590024a050b64e04df3214a04a01 (patch) | |
tree | 405fa710f8935267462877342a76feb9bc8f67d8 /sysdeps/mach/hurd/adjtime.c | |
parent | 1a822c61844eb378bc8d676f26edf1a0285303b1 (diff) | |
download | glibc-9d84d0e51d0a590024a050b64e04df3214a04a01.tar.gz glibc-9d84d0e51d0a590024a050b64e04df3214a04a01.tar.xz glibc-9d84d0e51d0a590024a050b64e04df3214a04a01.zip |
Use fabs(x) instead of branching on signedness of input to sin and cos
The sin and cos code is inconsistent about its use of fabs to get the absolute value of X where in some places it conditionalizes the code while in others it uses fabs. fabs seems to be a better candidate in most cases because it avoids a branch. Similarly there is an attempt to make it easier for the compiler to emit conditional assignment instructions (like fcsel on aarch64) where it can, by isolating conditional assignment constructs from the rest of the expression. A further benefit of this change is to identify common constructs across functions and consolidate them in future patches. * sysdeps/ieee754/dbl-64/s_sin.c (do_cos_slow): Use ternary instead of if/else. (do_sin_slow): Likewise. (do_sincos_1): Use fabs instead of if/else. (do_sincos_2): Likewise. (__sin): Likewise. (__cos): Likewise. (slow2): Likewise. (sloww): Likewise. (sloww1): Likewise. Drop argument M. (sloww2): Use fabs instead of if/else. (bsloww): Likewise. (bsloww1): Likewise. (bsloww2): Likewise.
Diffstat (limited to 'sysdeps/mach/hurd/adjtime.c')
0 files changed, 0 insertions, 0 deletions