Optimized PowerPC 32-bits nearbyint/nearbyintf show bogus results for FE_DOWNWARD rounding mode, as shown by math failing tests: testing double (without inline functions) Failure: Test: nearbyint_downward (-0.5) Result: is: 0.00000000000000000000e+00 0x0.00000000000000000000p+0 should be: -1.00000000000000000000e+00 -0x1.00000000000000000000p+0 difference: 1.00000000000000000000e+00 0x1.00000000000000000000p+0 ulp : 4503599627370496.0000 max.ulp : 0.0000 Failure: Test: nearbyint_downward (-1.5) Result: is: -1.00000000000000000000e+00 -0x1.00000000000000000000p+0 should be: -2.00000000000000000000e+00 -0x1.00000000000000000000p+1 difference: 1.00000000000000000000e+00 0x1.00000000000000000000p+0 ulp : 2251799813685248.0000 max.ulp : 0.0000 Failure: Test: nearbyint_downward (-2.5) Result: is: -2.00000000000000000000e+00 -0x1.00000000000000000000p+1 should be: -3.00000000000000000000e+00 -0x1.80000000000000000000p+1 difference: 1.00000000000000000000e+00 0x1.00000000000000000000p+0 ulp : 2251799813685248.0000 max.ulp : 0.0000 Failure: Test: nearbyint_downward (-3.5) Result: is: -3.00000000000000000000e+00 -0x1.80000000000000000000p+1 should be: -4.00000000000000000000e+00 -0x1.00000000000000000000p+2 difference: 1.00000000000000000000e+00 0x1.00000000000000000000p+0 ulp : 1125899906842624.0000 max.ulp : 0.0000 Failure: Test: nearbyint_downward (-4.5) Result: is: -4.00000000000000000000e+00 -0x1.00000000000000000000p+2 should be: -5.00000000000000000000e+00 -0x1.40000000000000000000p+2 difference: 1.00000000000000000000e+00 0x1.00000000000000000000p+0 ulp : 1125899906842624.0000 max.ulp : 0.0000 These are not all the failing tests, just an except.
The same optimized implementation for PowerPC64 does not shown any issue in any rounding mode.
Fixed by 8bd70862e11023e7f827f240a5a214f847ae982d.