diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2021-04-23 17:29:29 +0200 |
---|---|---|
committer | Uros Bizjak <ubizjak@gmail.com> | 2021-04-23 17:30:34 +0200 |
commit | d2324a5ab3ff097864ae6828cb1db4dd013c70d1 (patch) | |
tree | 68372ceac8f591a9229a23ee65fca6b5eb16e613 /gcc/expr.c | |
parent | 5d87c2251c441f056e0a44f928ffcb8a8a679b6b (diff) | |
download | gcc-d2324a5ab3ff097864ae6828cb1db4dd013c70d1.zip gcc-d2324a5ab3ff097864ae6828cb1db4dd013c70d1.tar.gz gcc-d2324a5ab3ff097864ae6828cb1db4dd013c70d1.tar.bz2 |
i386: Fix atomic FP peepholes [PR100182]
64bit loads to/stores from x87 and SSE registers are atomic also on 32-bit
targets, so there is no need for additional atomic moves to a temporary
register.
Introduced load peephole2 patterns assume that there won't be any additional
loads from the load location outside the peepholed sequence and wrongly
removed the source location initialization.
OTOH, introduced store peephole2 patterns assume there won't be any additional
loads from the stored location outside the peepholed sequence and wrongly
removed the destination location initialization. Note that we can't use plain
x87 FST instruction to initialize destination location because FST converts
the value to the double-precision format, changing bits during move.
The patch restores removed initializations in load and store patterns.
Additionally, plain x87 FST in store peephole2 patterns is prevented by
limiting the store operand source to SSE registers.
2021-04-23 Uroš Bizjak <ubizjak@gmail.com>
gcc/
PR target/100182
* config/i386/sync.md (FILD_ATOMIC/FIST_ATOMIC FP load peephole2):
Copy operand 3 to operand 4. Use sse_reg_operand
as operand 3 predicate.
(FILD_ATOMIC/FIST_ATOMIC FP load peephole2 with mem blockage): Ditto.
(LDX_ATOMIC/STX_ATOMIC FP load peephole2): Ditto.
(LDX_ATOMIC/LDX_ATOMIC FP load peephole2 with mem blockage): Ditto.
(FILD_ATOMIC/FIST_ATOMIC FP store peephole2):
Copy operand 1 to operand 0.
(FILD_ATOMIC/FIST_ATOMIC FP store peephole2 with mem blockage): Ditto.
(LDX_ATOMIC/STX_ATOMIC FP store peephole2): Ditto.
(LDX_ATOMIC/LDX_ATOMIC FP store peephole2 with mem blockage): Ditto.
gcc/testsuite/
PR target/100182
* gcc.target/i386/pr100182.c: New test.
* gcc.target/i386/pr71245-1.c (dg-final): Xfail scan-assembler-not.
* gcc.target/i386/pr71245-2.c (dg-final): Ditto.
Diffstat (limited to 'gcc/expr.c')
0 files changed, 0 insertions, 0 deletions