| 83312f1b | 22-Nov-2018 |
Vincent Chen <[email protected]> |
math-emu/soft-fp.h: (_FP_ROUND_ZERO) cast 0 to void to fix warning
_FP_ROUND_ZERO is defined as 0 and used as a statemente in macro _FP_ROUND. This generates "error: statement with no effect [-Werro
math-emu/soft-fp.h: (_FP_ROUND_ZERO) cast 0 to void to fix warning
_FP_ROUND_ZERO is defined as 0 and used as a statemente in macro _FP_ROUND. This generates "error: statement with no effect [-Werror=unused-value]" from gcc. Defining _FP_ROUND_ZERO as (void)0 to fix it.
This modification is quoted from glibc 'commit <In libc/:> (8ed1e7d5894000c155acbd06f)'
Signed-off-by: Vincent Chen <[email protected]> Acked-by: Greentime Hu <[email protected]> Signed-off-by: Greentime Hu <[email protected]>
show more ...
|
| d06b3326 | 04-Nov-2013 |
Joseph Myers <[email protected]> |
math-emu: fix floating-point to integer overflow detection
On overflow, the math-emu macro _FP_TO_INT_ROUND tries to saturate its result (subject to the value of rsigned specifying the desired overf
math-emu: fix floating-point to integer overflow detection
On overflow, the math-emu macro _FP_TO_INT_ROUND tries to saturate its result (subject to the value of rsigned specifying the desired overflow semantics). However, if the rounding step has the effect of increasing the exponent so as to cause overflow (if the rounded result is 1 larger than the largest positive value with the given number of bits, allowing for signedness), the overflow does not get detected, meaning that for unsigned results 0 is produced instead of the maximum unsigned integer with the give number of bits, without an exception being raised for overflow, and that for signed results the minimum (negative) value is produced instead of the maximum (positive) value, again without an exception. This patch makes the code check for rounding increasing the exponent and adjusts the exponent value as needed for the overflow check.
Signed-off-by: Joseph Myers <[email protected]> Signed-off-by: Scott Wood <[email protected]>
show more ...
|
| 60b82673 | 23-Oct-2008 |
David S. Miller <[email protected]> |
math-emu: Fix thinko in _FP_DIV
In commit 48d6c64311ddb6417b901639530ccbc47bdc7635 ("math-emu: Add support for reporting exact invalid exception") code was added to set the new FP_EX_INVALID_{IDI,ZD
math-emu: Fix thinko in _FP_DIV
In commit 48d6c64311ddb6417b901639530ccbc47bdc7635 ("math-emu: Add support for reporting exact invalid exception") code was added to set the new FP_EX_INVALID_{IDI,ZDZ} exception flag bits.
However there is a missing break statement for the _FP_CLS_COMBINE(FP_CLS_INF,FP_CLS_INF) switch case, the code just falls into _FP_CLS_COMBINE(FP_CLS_ZERO,FP_CLS_ZERO) which then proceeds to overwrite all of the settings.
Fix by adding the missing break.
Signed-off-by: David S. Miller <[email protected]>
show more ...
|
| 48d6c643 | 27-Jun-2008 |
Kumar Gala <[email protected]> |
math-emu: Add support for reporting exact invalid exception
Some architectures (like powerpc) provide status information on the exact type of invalid exception. This is pretty straight forward as w
math-emu: Add support for reporting exact invalid exception
Some architectures (like powerpc) provide status information on the exact type of invalid exception. This is pretty straight forward as we already report invalid exceptions via FP_SET_EXCEPTION.
We add new flags (FP_EX_INVALID_*) the architecture code can define if it wants the exact invalid exception reported.
We had to split out the INF/INF and 0/0 cases for divide to allow reporting the two invalid forms properly.
Signed-off-by: Kumar Gala <[email protected]> Acked-by: David S. Miller <[email protected]>
show more ...
|