glibc/sysdeps/ieee754
Siddhesh Poyarekar 9d84d0e51d 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.
2016-08-30 13:01:59 +05:30
..
bits Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dbl-64 Use fabs(x) instead of branching on signedness of input to sin and cos 2016-08-30 13:01:59 +05:30
flt-32 Get rid of array-bounds warning in __kernel_rem_pio2[f] with gcc 6.1 -O3. 2016-08-18 12:20:35 +02:00
ldbl-64-128 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ldbl-96 Merge common usage of mul_split function 2016-08-19 11:29:43 -05:00
ldbl-128 Merge common usage of mul_split function 2016-08-19 11:29:43 -05:00
ldbl-128ibm Merge common usage of mul_split function 2016-08-19 11:29:43 -05:00
ldbl-opt Convert remaining complex function to generated files 2016-08-29 12:43:38 -05:00
Makefile Avoid -Wno-write-strings for k_standard.c. 2015-02-26 22:50:54 +00:00
ieee754.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
k_standard.c Add comment to CSTR macro in k_standard.c. 2015-02-27 01:12:19 +00:00
k_standardf.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
k_standardl.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
s_lib_version.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
s_matherr.c Use <> for math.h and math_private.h everywhere. 2012-03-09 16:09:10 -08:00
s_signgam.c Fix lgamma setting signgam for ISO C (bug 15421). 2015-11-20 22:49:59 +00:00