This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: questionnable nint() behavior


> I am fully in agreement that the long
> standing gcc rules, where even -ffast-math falls short of violating
> parentheses, are better from a usability point of view.

As far as I can tell this is not true, -ffast-math is under the
"SPEC benchmark ... pressure". The comparison between the assembly
with (<) and without (>) -ffast-math gives:

...
33,34c33,36
< L15:
<       addis r2,r31,ha16(LC0-"L00000000001$pb")
---
> L14:
>       fadds f0,f13,f12
>       addis r2,r31,ha16(LC1-"L00000000001$pb")
>       la r2,lo16(LC1-"L00000000001$pb")(r2)
36,37d37
<       la r2,lo16(LC0-"L00000000001$pb")(r2)
<       stw r0,76(r1)
39,40c39,43
<       li r0,128
<       li r2,6
---
>       li r2,128
>       fsubs f1,f0,f12
>       stw r0,76(r1)
>       li r0,6
>       stw r2,64(r1)
...

the 'fadds f0,f13,f12' and 'fsubs f1,f0,f12' are missing
with -ffast-math and the code gives the wrong answer.

Dominique


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]