diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2023-08-18 19:06:38 +0200 |
---|---|---|
committer | Uros Bizjak <ubizjak@gmail.com> | 2023-08-18 19:08:23 +0200 |
commit | 4123b5609da53c8f8ac01c90aef127ad6375e9df (patch) | |
tree | d56c958e2b23159865645e57f759f65a17a0cc6d /gcc/rust/backend | |
parent | 53fcd3bdbc9104a8acdc79134d8d272d7eead0fd (diff) | |
download | gcc-4123b5609da53c8f8ac01c90aef127ad6375e9df.zip gcc-4123b5609da53c8f8ac01c90aef127ad6375e9df.tar.gz gcc-4123b5609da53c8f8ac01c90aef127ad6375e9df.tar.bz2 |
i386: Use PUNPCKL?? to implement vector extend and zero_extend for TARGET_SSE2.
Implement vector extend and zero_extend functionality for TARGET_SSE2 using
PUNPCKL?? family of instructions. The code for e.g. zero-extend from V2SI to
V2DImode improves from:
movd %xmm0, %edx
pshufd $85, %xmm0, %xmm0
movd %xmm0, %eax
movq %rdx, (%rdi)
movq %rax, 8(%rdi)
to:
pxor %xmm1, %xmm1
punpckldq %xmm1, %xmm0
movaps %xmm0, (%rdi)
And the code for sign-extend from V2SI to V2DImode from:
movd %xmm0, %edx
pshufd $85, %xmm0, %xmm0
movd %xmm0, %eax
movslq %edx, %rdx
cltq
movq %rdx, (%rdi)
movq %rax, 8(%rdi)
to:
pxor %xmm1, %xmm1
pcmpgtd %xmm0, %xmm1
punpckldq %xmm1, %xmm0
movaps %xmm0, (%rdi)
PR target/111023
gcc/ChangeLog:
* config/i386/i386-expand.cc (ix86_split_mmx_punpck):
Also handle V2QImode.
(ix86_expand_sse_extend): New function.
* config/i386/i386-protos.h (ix86_expand_sse_extend): New prototype.
* config/i386/mmx.md (<any_extend:insn>v4qiv4hi2): Enable for
TARGET_SSE2. Expand through ix86_expand_sse_extend for !TARGET_SSE4_1.
(<any_extend:insn>v2hiv2si2): Ditto.
(<any_extend:insn>v2qiv2hi2): Ditto.
* config/i386/sse.md (<any_extend:insn>v8qiv8hi2): Ditto.
(<any_extend:insn>v4hiv4si2): Ditto.
(<any_extend:insn>v2siv2di2): Ditto.
gcc/testsuite/ChangeLog:
* gcc.target/i386/pr111023-2.c: New test.
* gcc.target/i386/pr111023-4b.c: New test.
* gcc.target/i386/pr111023-8b.c: New test.
* gcc.target/i386/pr111023.c: New test.
Diffstat (limited to 'gcc/rust/backend')
0 files changed, 0 insertions, 0 deletions