glibc/sysdeps/powerpc/fpu
Paul A. Clarke 3c1766ea10 [powerpc] fe{en,dis}ableexcept, fesetmode: optimize FPSCR accesses
Since fe{en,dis}ableexcept() and fesetmode() read-modify-write just the
"mode" (exception enable and rounding mode) bits of the Floating Point Status
Control Register (FPSCR), the lighter weight 'mffsl' instruction can be used
to read the FPSCR (enables and rounding mode), and 'mtfsf 0b00000011' can be
used to write just those bits back to the FPSCR.  The net is better performance.

In addition, fe{en,dis}ableexcept() read the FPSCR again after writing it, or
they determine that it doesn't need to be written because it is not changing.
In either case, the local variable holds the current values of the enable
bits in the FPSCR.  This local variable can be used instead of again reading
the FPSCR.

Also, that value of the FPSCR which is read the second time is validated
against the requested enables.  Since the write can't fail, this validation
step is unnecessary, and can be removed.  Instead, the exceptions to be
enabled (or disabled) are transformed into available bits in the FPSCR,
then validated after being transformed back, to ensure that all requested
bits are actually being set.  For example, FE_INVALID_SQRT can be
requested, but cannot actually be set.  This bit is not mapped during the
transformations, so a test for that bit being set before and after
transformations will show the bit would not be set, and the function will
return -1 for failure.

Finally, convert the local macros in fesetmode.c to more generally useful
macros in fenv_libc.h.
2019-08-28 13:50:06 -05:00
..
e_hypot.c powerpc: hypot refactor and optimization 2019-07-08 17:21:15 -03:00
e_hypotf.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
e_sqrt.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
e_sqrtf.c Use float in e_sqrt.c 2019-02-11 12:03:23 -02:00
fclrexcpt.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fe_mask.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fe_nomask.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fedisblxcpt.c [powerpc] fe{en,dis}ableexcept, fesetmode: optimize FPSCR accesses 2019-08-28 13:50:06 -05:00
feenablxcpt.c [powerpc] fe{en,dis}ableexcept, fesetmode: optimize FPSCR accesses 2019-08-28 13:50:06 -05:00
fegetenv.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fegetexcept.c powerpc: Use faster means to access FPSCR when possible in some cases 2019-06-30 08:40:44 -03:00
fegetmode.c powerpc: Use faster means to access FPSCR when possible in some cases 2019-06-30 08:40:44 -03:00
fegetround.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
feholdexcpt.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fenv_const.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fenv_libc.h [powerpc] fe{en,dis}ableexcept, fesetmode: optimize FPSCR accesses 2019-08-28 13:50:06 -05:00
fenv_private.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fesetenv.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fesetexcept.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fesetmode.c [powerpc] fe{en,dis}ableexcept, fesetmode: optimize FPSCR accesses 2019-08-28 13:50:06 -05:00
fesetround.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
feupdateenv.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fgetexcptflg.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fix-fp-int-compare-invalid.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fraiseexcpt.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fsetexcptflg.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
ftestexcept.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
get-rounding-mode.h [powerpc] get_rounding_mode: utilize faster method to get rounding mode 2019-06-06 14:11:56 -05:00
libm-test-ulps Add new exp and exp2 implementations 2018-09-05 16:22:00 +01:00
libm-test-ulps-name Do not hardcode platform names in manual/libm-err-tab.pl (bug 14139). 2016-11-04 16:49:06 +00:00
Makefile Link extra-libs consistently with libc and ld.so. 2013-05-31 16:16:33 +00:00
math_ldbl.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
math_private.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
math-barriers.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
math-tests-trap-force.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
round_to_integer.h powerpc: consolidate rint 2019-06-12 11:46:22 -03:00
s_ceil.c powerpc: ceil/ceilf refactor 2019-04-29 08:43:37 -03:00
s_ceilf.c powerpc: ceil/ceilf refactor 2019-04-29 08:43:37 -03:00
s_copysign.c powerpc: copysign cleanup 2019-06-12 11:46:26 -03:00
s_copysignf.c powerpc: copysign cleanup 2019-06-12 11:46:26 -03:00
s_floor.c powerpc: floor/floorf refactor 2019-05-09 09:38:40 -03:00
s_floorf.c powerpc: floor/floorf refactor 2019-05-09 09:38:40 -03:00
s_fma.c powerpc: Fix format issue from 3a16dd780e 2019-04-17 18:32:01 -03:00
s_fmaf.c powerpc: Fix format issue from 3a16dd780e 2019-04-17 18:32:01 -03:00
s_logb.c powerpc: refactor logb{f,l} 2019-07-08 17:22:22 -03:00
s_logbf.c powerpc: refactor logb{f,l} 2019-07-08 17:22:22 -03:00
s_logbl.c powerpc: refactor logb{f,l} 2019-07-08 17:22:22 -03:00
s_lrintf.c powerpc: Refactor powerpc32 lrint/lrintf/llrint/llrintf 2019-06-17 09:27:02 -03:00
s_modf.c powerpc: Refactor modf{f} 2019-07-08 17:22:22 -03:00
s_modff.c powerpc: Refactor modf{f} 2019-07-08 17:22:22 -03:00
s_nearbyint.c powerpc: generic nearbyint/nearbyintf 2019-05-28 18:16:48 -03:00
s_nearbyintf.c powerpc: generic nearbyint/nearbyintf 2019-05-28 18:16:48 -03:00
s_rint.c powerpc: consolidate rint 2019-06-12 11:46:22 -03:00
s_rintf.c powerpc: consolidate rint 2019-06-12 11:46:22 -03:00
s_round.c powerpc: round/roundf refactor 2019-05-09 09:39:07 -03:00
s_roundf.c powerpc: round/roundf refactor 2019-05-09 09:39:07 -03:00
s_trunc.c powerpc: trunc/truncf refactor 2019-05-09 09:39:28 -03:00
s_truncf.c powerpc: trunc/truncf refactor 2019-05-09 09:39:28 -03:00
t_sqrt.c Remove trailing whitespace. 2013-06-05 20:44:03 +00:00
tst-setcontext-fpscr.c [powerpc] Use __builtin_{mffs,mtfsf} 2019-03-29 19:16:34 -05:00