diff options
author | liuhongt <hongtao.liu@intel.com> | 2024-05-15 10:56:24 +0800 |
---|---|---|
committer | liuhongt <hongtao.liu@intel.com> | 2024-05-16 08:41:01 +0800 |
commit | 090714e6cf8029f4ff8883dce687200024adbaeb (patch) | |
tree | a1df6b5b9efee293e2d0aefd2bc17957e6e82dc4 /gcc/common | |
parent | 0cc0956b3bb8bcbc9196075b9073a227d799e042 (diff) | |
download | gcc-090714e6cf8029f4ff8883dce687200024adbaeb.zip gcc-090714e6cf8029f4ff8883dce687200024adbaeb.tar.gz gcc-090714e6cf8029f4ff8883dce687200024adbaeb.tar.bz2 |
Set d.one_operand_p to true when TARGET_SSSE3 in ix86_expand_vecop_qihi_partial.
pshufb is available under TARGET_SSSE3, so
ix86_expand_vec_perm_const_1 must return true when TARGET_SSSE3.
With the patch under -march=x86-64-v2
v8qi
foo (v8qi a)
{
return a >> 5;
}
< pmovsxbw %xmm0, %xmm0
< psraw $5, %xmm0
< pshufb .LC0(%rip), %xmm0
vs.
> movdqa %xmm0, %xmm1
> pcmpeqd %xmm0, %xmm0
> pmovsxbw %xmm1, %xmm1
> psrlw $8, %xmm0
> psraw $5, %xmm1
> pand %xmm1, %xmm0
> packuswb %xmm0, %xmm0
Although there's a memory load from constant pool, but it should be
better when it's inside a loop. The load from constant pool can be
hoist out. it's 1 instruction vs 4 instructions.
< pshufb .LC0(%rip), %xmm0
vs.
> pcmpeqd %xmm0, %xmm0
> psrlw $8, %xmm0
> pand %xmm1, %xmm0
> packuswb %xmm0, %xmm0
gcc/ChangeLog:
PR target/114514
* config/i386/i386-expand.cc (ix86_expand_vecop_qihi_partial):
Set d.one_operand_p to true when TARGET_SSSE3.
gcc/testsuite/ChangeLog:
* gcc.target/i386/pr114514-shufb.c: New test.
Diffstat (limited to 'gcc/common')
0 files changed, 0 insertions, 0 deletions