aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorliuhongt <hongtao.liu@intel.com>2023-10-09 15:07:54 +0800
committerliuhongt <hongtao.liu@intel.com>2023-10-30 11:10:01 +0800
commit8c40b72036c967fbb1d1150515cf70aec382f0a2 (patch)
tree416aba24f88619b92a2d3ebcd5689e1a7f58a3a8 /libcpp
parent8111b5c23bd14f80607bd35af58ec31e38a0378e (diff)
downloadgcc-8c40b72036c967fbb1d1150515cf70aec382f0a2.zip
gcc-8c40b72036c967fbb1d1150515cf70aec382f0a2.tar.gz
gcc-8c40b72036c967fbb1d1150515cf70aec382f0a2.tar.bz2
Improve memcmpeq for 512-bit vector with vpcmpeq + kortest.
When 2 vectors are equal, kmask is allones and kortest will set CF, else CF will be cleared. So CF bit can be used to check for the result of the comparison. Before: vmovdqu (%rsi), %ymm0 vpxorq (%rdi), %ymm0, %ymm0 vptest %ymm0, %ymm0 jne .L2 vmovdqu 32(%rsi), %ymm0 vpxorq 32(%rdi), %ymm0, %ymm0 vptest %ymm0, %ymm0 je .L5 .L2: movl $1, %eax xorl $1, %eax vzeroupper ret After: vmovdqu64 (%rsi), %zmm0 xorl %eax, %eax vpcmpeqd (%rdi), %zmm0, %k0 kortestw %k0, %k0 setc %al vzeroupper ret gcc/ChangeLog: PR target/104610 * config/i386/i386-expand.cc (ix86_expand_branch): Handle 512-bit vector with vpcmpeq + kortest. * config/i386/i386.md (cbranchxi4): New expander. * config/i386/sse.md: (cbranch<mode>4): Extend to V16SImode and V8DImode. gcc/testsuite/ChangeLog: * gcc.target/i386/pr104610-2.c: New test.
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions