alpha: fix trunc for big input values
commitb74d259fe793499134eb743222cd8dd7c74a31ce
authorAurelien Jarno <aurelien@aurel32.net>
Tue, 2 Aug 2016 07:18:59 +0000 (2 09:18 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Tue, 2 Aug 2016 07:18:59 +0000 (2 09:18 +0200)
treeec337eba9ce2431f6d9853b502d10423455c0378
parentcb7f9d63b921ea1a1cbb4ab377a8484fd5da9a2b
alpha: fix trunc for big input values

The alpha specific version of trunc and truncf always add and subtract
0x1.0p23 or 0x1.0p52 even for big values. This causes this kind of
errors in the testsuite:

  Failure: Test: trunc_towardzero (0x1p107)
  Result:
   is:          1.6225927682921334e+32   0x1.fffffffffffffp+106
   should be:   1.6225927682921336e+32   0x1.0000000000000p+107
   difference:  1.8014398509481984e+16   0x1.0000000000000p+54
   ulp       :  0.5000
   max.ulp   :  0.0000

Change this by returning the input value when its absolute value is
greater than 0x1.0p23 or 0x1.0p52. NaN have to go through the add and
subtract operations to get possibly silenced.

Finally remove the code to handle inexact exception, trunc should never
generate such an exception.

Changelog:
* sysdeps/alpha/fpu/s_trunc.c (__trunc): Return the input value
when its absolute value is greater than 0x1.0p52.
[_IEEE_FP_INEXACT] Remove.
* sysdeps/alpha/fpu/s_truncf.c (__truncf): Return the input value
when its absolute value is greater than 0x1.0p23.
[_IEEE_FP_INEXACT] Remove.
ChangeLog
sysdeps/alpha/fpu/s_trunc.c
sysdeps/alpha/fpu/s_truncf.c