Searched hist:"28414 a6def9dc00dcd0d0f3eea6911fda9a4a4e1" (Results 1 – 1 of 1) sorted by relevance
/linux/arch/powerpc/math-emu/ |
H A D | math_efp.c | diff 28414a6def9dc00dcd0d0f3eea6911fda9a4a4e1 Mon Nov 04 17:53:14 CET 2013 Joseph Myers <joseph@codesourcery.com> 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>
|