aboutsummaryrefslogtreecommitdiff
path: root/libgomp/target.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@nextmovesoftware.com>2023-06-16 16:18:27 +0100
committerRoger Sayle <roger@nextmovesoftware.com>2023-06-16 16:21:35 +0100
commit95020d33ad6991fe4fbdccf70e7133116cac68f4 (patch)
treec8c0b87a624c2e782816a7d53700b752dfda5cdc /libgomp/target.c
parent154c69039571c66b3a6d16ecfa9e6ff22942f59f (diff)
downloadgcc-95020d33ad6991fe4fbdccf70e7133116cac68f4.zip
gcc-95020d33ad6991fe4fbdccf70e7133116cac68f4.tar.gz
gcc-95020d33ad6991fe4fbdccf70e7133116cac68f4.tar.bz2
PR target/31985: Improve memory operand use with doubleword add.
This patch addresses the last remaining issue with PR target/31985, that GCC could make better use of memory addressing modes when implementing double word addition. This is achieved by adding a define_insn_and_split that combines an *add<dwi>3_doubleword with a *concat<mode><dwi>3, so that the components of the concat can be used directly, without first being loaded into a double word register. For test_c in the bugzilla PR: Before: pushl %ebx subl $16, %esp movl 28(%esp), %eax movl 36(%esp), %ecx movl 32(%esp), %ebx movl 24(%esp), %edx addl %ecx, %eax adcl %ebx, %edx movl %eax, 8(%esp) movl %edx, 12(%esp) addl $16, %esp popl %ebx ret After: test_c: subl $20, %esp movl 36(%esp), %eax movl 32(%esp), %edx addl 28(%esp), %eax adcl 24(%esp), %edx movl %eax, 8(%esp) movl %edx, 12(%esp) addl $20, %esp ret 2023-06-16 Roger Sayle <roger@nextmovesoftware.com> Uros Bizjak <ubizjak@gmail.com> gcc/ChangeLog PR target/31985 * config/i386/i386.md (*add<dwi>3_doubleword_concat): New define_insn_and_split combine *add<dwi>3_doubleword with a *concat<mode><dwi>3 for more efficient lowering after reload. gcc/testsuite/ChangeLog PR target/31985 * gcc.target/i386/pr31985.c: New test case.
Diffstat (limited to 'libgomp/target.c')
0 files changed, 0 insertions, 0 deletions