diff options
author | Jakub Jelinek <jakub@redhat.com> | 2021-09-28 13:02:51 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2021-09-28 13:02:51 +0200 |
commit | 3b7041e8345c2f1030e58620f28e22d64b2c196b (patch) | |
tree | 261386b7393d54006d01f91dd7bca2098f5166a0 /gcc/tree-ssa-reassoc.c | |
parent | 34b1e44e166c58df20a15cb35b6cc8d4d299d415 (diff) | |
download | gcc-3b7041e8345c2f1030e58620f28e22d64b2c196b.zip gcc-3b7041e8345c2f1030e58620f28e22d64b2c196b.tar.gz gcc-3b7041e8345c2f1030e58620f28e22d64b2c196b.tar.bz2 |
i386: Don't emit fldpi etc. if -frounding-math [PR102498]
i387 has instructions to store some transcedental numbers into the top of
stack. The problem is that what exact bit in the last place one gets for
those depends on the current rounding mode, the CPU knows the number with
slightly higher precision. The compiler assumes rounding to nearest when
comparing them against constants in the IL, but at runtime the rounding
can be different and so some of these depending on rounding mode and the
constant could be 1 ulp higher or smaller than expected.
We only support changing the rounding mode at runtime if the non-default
-frounding-mode option is used, so the following patch just disables
using those constants if that flag is on.
2021-09-28 Jakub Jelinek <jakub@redhat.com>
PR target/102498
* config/i386/i386.c (standard_80387_constant_p): Don't recognize
special 80387 instruction XFmode constants if flag_rounding_math.
* gcc.target/i386/pr102498.c: New test.
Diffstat (limited to 'gcc/tree-ssa-reassoc.c')
0 files changed, 0 insertions, 0 deletions