diff options
author | Roger Sayle <roger@nextmovesoftware.com> | 2022-08-03 09:00:20 +0100 |
---|---|---|
committer | Roger Sayle <roger@nextmovesoftware.com> | 2022-08-03 09:00:20 +0100 |
commit | 7baed397dd0c220a72589c435e7db1676aced01e (patch) | |
tree | f65f86aaa4a48cdb2fb9a0eb3135b642bb4a426d /libphobos/src/std/algorithm/internal.d | |
parent | c23a9c87cc62bd177fd0d4db6ad34b34e1b9a31f (diff) | |
download | gcc-7baed397dd0c220a72589c435e7db1676aced01e.zip gcc-7baed397dd0c220a72589c435e7db1676aced01e.tar.gz gcc-7baed397dd0c220a72589c435e7db1676aced01e.tar.bz2 |
Support logical shifts by (some) integer constants in TImode STV on x86_64.
This patch improves TImode STV by adding support for logical shifts by
integer constants that are multiples of 8. For the test case:
unsigned __int128 a, b;
void foo() { a = b << 16; }
on x86_64, gcc -O2 currently generates:
movq b(%rip), %rax
movq b+8(%rip), %rdx
shldq $16, %rax, %rdx
salq $16, %rax
movq %rax, a(%rip)
movq %rdx, a+8(%rip)
ret
with this patch we now generate:
movdqa b(%rip), %xmm0
pslldq $2, %xmm0
movaps %xmm0, a(%rip)
ret
2022-08-03 Roger Sayle <roger@nextmovesoftware.com>
gcc/ChangeLog
* config/i386/i386-features.cc (compute_convert_gain): Add gain
for converting suitable TImode shift to a V1TImode shift.
(timode_scalar_chain::convert_insn): Add support for converting
suitable ASHIFT and LSHIFTRT.
(timode_scalar_to_vector_candidate_p): Consider logical shifts
by integer constants that are multiples of 8 to be candidates.
gcc/testsuite/ChangeLog
* gcc.target/i386/sse4_1-stv-7.c: New test case.
Diffstat (limited to 'libphobos/src/std/algorithm/internal.d')
0 files changed, 0 insertions, 0 deletions