linux/arch/powerpc/math-emu
Joseph Myers 28414a6def powerpc: fix e500 SPE float rounding inexactness detection
The e500 SPE floating-point emulation code for the rounding modes
rounding to positive or negative infinity (which may not be
implemented in hardware) tries to avoid emulating rounding if the
result was inexact.  However, it tests inexactness using the sticky
bit with the cumulative result of previous operations, rather than
with the non-sticky bits relating to the operation that generated the
interrupt.  Furthermore, when a vector operation generates the
interrupt, it's possible that only one of the low and high parts is
inexact, and so only that part should have rounding emulated.  This
results in incorrect rounding of exact results in these modes when the
sticky bit is set from a previous operation.

(I'm not sure why the rounding interrupts are generated at all when
the result is exact, but empirically the hardware does generate them.)

This patch checks for inexactness using the correct bits of SPEFSCR,
and ensures that rounding only occurs when the relevant part of the
result was actually inexact.

Signed-off-by: Joseph Myers <joseph@codesourcery.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
2014-01-07 18:33:48 -06:00
..
fabs.c [POWERPC] Replace remaining __FUNCTION__ occurrences 2008-04-01 20:43:09 +11:00
fadd.c powerpc/math-emu: Remove redundant 'ret' 2008-12-03 08:19:15 -06:00
fadds.c powerpc/math-emu: Use kernel generic math-emu code 2008-10-01 08:40:07 -05:00
fcmpo.c powerpc/math-emu: Remove redundant 'ret' 2008-12-03 08:19:15 -06:00
fcmpu.c powerpc/math-emu: Use kernel generic math-emu code 2008-10-01 08:40:07 -05:00
fctiw.c powerpc/math-emu: Use kernel generic math-emu code 2008-10-01 08:40:07 -05:00
fctiwz.c powerpc/math-emu: Use kernel generic math-emu code 2008-10-01 08:40:07 -05:00
fdiv.c powerpc/math-emu: Remove redundant 'ret' 2008-12-03 08:19:15 -06:00
fdivs.c powerpc/math-emu: Remove redundant 'ret' 2008-12-03 08:19:15 -06:00
fmadd.c powerpc/math-emu: Remove redundant 'ret' 2008-12-03 08:19:15 -06:00
fmadds.c powerpc/math-emu: Remove redundant 'ret' 2008-12-03 08:19:15 -06:00
fmr.c [POWERPC] Replace remaining __FUNCTION__ occurrences 2008-04-01 20:43:09 +11:00
fmsub.c powerpc/math-emu: Remove redundant 'ret' 2008-12-03 08:19:15 -06:00
fmsubs.c powerpc/math-emu: Remove redundant 'ret' 2008-12-03 08:19:15 -06:00
fmul.c powerpc/math-emu: Remove redundant 'ret' 2008-12-03 08:19:15 -06:00
fmuls.c powerpc/math-emu: Remove redundant 'ret' 2008-12-03 08:19:15 -06:00
fnabs.c [POWERPC] Replace remaining __FUNCTION__ occurrences 2008-04-01 20:43:09 +11:00
fneg.c [POWERPC] Replace remaining __FUNCTION__ occurrences 2008-04-01 20:43:09 +11:00
fnmadd.c powerpc/math-emu: Remove redundant 'ret' 2008-12-03 08:19:15 -06:00
fnmadds.c powerpc/math-emu: Remove redundant 'ret' 2008-12-03 08:19:15 -06:00
fnmsub.c powerpc/math-emu: Remove redundant 'ret' 2008-12-03 08:19:15 -06:00
fnmsubs.c powerpc/math-emu: Remove redundant 'ret' 2008-12-03 08:19:15 -06:00
fre.c powerpc/math-emu: Fix decoding of some instructions 2013-06-20 17:05:05 +10:00
fres.c [POWERPC] Replace remaining __FUNCTION__ occurrences 2008-04-01 20:43:09 +11:00
frsp.c powerpc/math-emu: Use kernel generic math-emu code 2008-10-01 08:40:07 -05:00
frsqrte.c [POWERPC] Replace remaining __FUNCTION__ occurrences 2008-04-01 20:43:09 +11:00
frsqrtes.c powerpc/math-emu: Fix decoding of some instructions 2013-06-20 17:05:05 +10:00
fsel.c powerpc/math-emu: Use kernel generic math-emu code 2008-10-01 08:40:07 -05:00
fsqrt.c powerpc/math-emu: Remove redundant 'ret' 2008-12-03 08:19:15 -06:00
fsqrts.c powerpc/math-emu: Remove redundant 'ret' 2008-12-03 08:19:15 -06:00
fsub.c powerpc/math-emu: Remove redundant 'ret' 2008-12-03 08:19:15 -06:00
fsubs.c powerpc/math-emu: Remove redundant 'ret' 2008-12-03 08:19:15 -06:00
lfd.c powerpc/math-emu: Use kernel generic math-emu code 2008-10-01 08:40:07 -05:00
lfs.c powerpc/math-emu: Use kernel generic math-emu code 2008-10-01 08:40:07 -05:00
Makefile powerpc: split She math emulation into two parts 2013-08-14 14:59:19 +10:00
math_efp.c powerpc: fix e500 SPE float rounding inexactness detection 2014-01-07 18:33:48 -06:00
math.c powerpc/math-emu: Fix load/store indexed emulation 2013-08-14 14:59:57 +10:00
mcrfs.c powerpc/math-emu: Use kernel generic math-emu code 2008-10-01 08:40:07 -05:00
mffs.c powerpc/math-emu: Use kernel generic math-emu code 2008-10-01 08:40:07 -05:00
mtfsb0.c powerpc/math-emu: Use kernel generic math-emu code 2008-10-01 08:40:07 -05:00
mtfsb1.c powerpc/math-emu: Use kernel generic math-emu code 2008-10-01 08:40:07 -05:00
mtfsf.c powerpc/math-emu: Use kernel generic math-emu code 2008-10-01 08:40:07 -05:00
mtfsfi.c powerpc/math-emu: Use kernel generic math-emu code 2008-10-01 08:40:07 -05:00
stfd.c [POWERPC] Replace remaining __FUNCTION__ occurrences 2008-04-01 20:43:09 +11:00
stfiwx.c [POWERPC] Replace remaining __FUNCTION__ occurrences 2008-04-01 20:43:09 +11:00
stfs.c powerpc/math-emu: Use kernel generic math-emu code 2008-10-01 08:40:07 -05:00
udivmodti4.c powerpc/math-emu: Use kernel generic math-emu code 2008-10-01 08:40:07 -05:00