aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-openmp.c
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2020-07-16 20:11:43 +0200
committerUros Bizjak <ubizjak@gmail.com>2020-07-16 20:13:06 +0200
commitcc1ef413a859433a8313fa9c15aaff41bdc837dc (patch)
tree8c405f73976c652609af5fabfd2755a57a49fb15 /gcc/fortran/trans-openmp.c
parentf569026aa3088aa895ea39618d2998333b08600b (diff)
downloadgcc-cc1ef413a859433a8313fa9c15aaff41bdc837dc.zip
gcc-cc1ef413a859433a8313fa9c15aaff41bdc837dc.tar.gz
gcc-cc1ef413a859433a8313fa9c15aaff41bdc837dc.tar.bz2
i386: Additional peephole2 to use flags from CMPXCHG more [PR96189]
CMPXCHG instruction sets ZF flag if the values in the destination operand and EAX register are equal; otherwise the ZF flag is cleared and value from destination operand is loaded to EAX. Following assembly: xorl %eax, %eax lock cmpxchgl %edx, (%rdi) testl %eax, %eax sete %al can be optimized by removing the unneeded comparison, since set ZF flag signals that no update to EAX happened. This patch adds peephole2 pattern to also handle XOR zeroing and load of -1 by OR. 2020-07-16 Uroš Bizjak <ubizjak@gmail.com> gcc/ChangeLog: PR target/96189 * config/i386/sync.md (peephole2 to remove unneded compare after CMPXCHG): New pattern, also handle XOR zeroing and load of -1 by OR. gcc/testsuite/ChangeLog: PR target/96189 * gcc.target/i386/pr96189-1.c: New test.
Diffstat (limited to 'gcc/fortran/trans-openmp.c')
0 files changed, 0 insertions, 0 deletions