[PATCH] D35320: [X86][SSE] Add support for extending bool vectors bitcasted from scalars.
Elena Demikhovsky via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 17 13:44:21 PDT 2017
delena added a comment.
What should be returned at the end according to the calling conventions - zext or sext? In some cases you add shift-right in order to return zext value. In the AVX-512 cases the last inst is vpmovm2* that means sext.
================
Comment at: test/CodeGen/X86/bitcast-int-to-vector-bool.ll:24
+; AVX1: # BB#0:
+; AVX1-NEXT: movzbl %dil, %eax
+; AVX1-NEXT: vmovq %rax, %xmm0
----------------
One "mov" is enough here. you, probably, use "zext" instead of "anyext". (I did not look at the code yet)
================
Comment at: test/CodeGen/X86/bitcast-int-to-vector-bool.ll:120
+; AVX1-NEXT: vmovd %edi, %xmm0
+; AVX1-NEXT: vpshuflw {{.*#+}} xmm0 = xmm0[0,0,0,0,4,5,6,7]
+; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,1,1]
----------------
pshufb can be used for broadcasting i8.
================
Comment at: test/CodeGen/X86/bitcast-int-to-vector-bool.ll:133
+; AVX2-NEXT: vmovdqa {{.*#+}} xmm1 = [1,2,4,8,16,32,64,128]
+; AVX2-NEXT: vpand %xmm1, %xmm0, %xmm0
+; AVX2-NEXT: vpcmpeqw %xmm1, %xmm0, %xmm0
----------------
why load is not folded in vpand?
Repository:
rL LLVM
https://reviews.llvm.org/D35320
More information about the llvm-commits
mailing list