Skip to content

Commit

Permalink
[X86][AVX512] Add support for AVX512 VINSERTPS shuffle decoding
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259420 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
RKSimon committed Feb 1, 2016
1 parent c2d3726 commit bf61370
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 35 deletions.
2 changes: 2 additions & 0 deletions lib/Target/X86/InstPrinter/X86InstComments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,12 @@ bool llvm::EmitAnyX86InstComments(const MCInst *MI, raw_ostream &OS,

case X86::INSERTPSrr:
case X86::VINSERTPSrr:
case X86::VINSERTPSzrr:
Src2Name = getRegName(MI->getOperand(2).getReg());
// FALL THROUGH.
case X86::INSERTPSrm:
case X86::VINSERTPSrm:
case X86::VINSERTPSzrm:
DestName = getRegName(MI->getOperand(0).getReg());
Src1Name = getRegName(MI->getOperand(1).getReg());
if (MI->getOperand(MI->getNumOperands() - 1).isImm())
Expand Down
44 changes: 10 additions & 34 deletions test/CodeGen/X86/merge-consecutive-loads-128.ll
Original file line number Diff line number Diff line change
Expand Up @@ -188,23 +188,11 @@ define <4 x float> @merge_4f32_f32_012u(float* %ptr) nounwind uwtable noinline s
; SSE41-NEXT: insertps {{.*#+}} xmm0 = xmm0[0,1],mem[0],xmm0[3]
; SSE41-NEXT: retq
;
; AVX1-LABEL: merge_4f32_f32_012u:
; AVX1: # BB#0:
; AVX1-NEXT: vmovq {{.*#+}} xmm0 = mem[0],zero
; AVX1-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1],mem[0],xmm0[3]
; AVX1-NEXT: retq
;
; AVX2-LABEL: merge_4f32_f32_012u:
; AVX2: # BB#0:
; AVX2-NEXT: vmovq {{.*#+}} xmm0 = mem[0],zero
; AVX2-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1],mem[0],xmm0[3]
; AVX2-NEXT: retq
;
; AVX512F-LABEL: merge_4f32_f32_012u:
; AVX512F: # BB#0:
; AVX512F-NEXT: vmovq {{.*#+}} xmm0 = mem[0],zero
; AVX512F-NEXT: vinsertps $32, 8(%rdi), %xmm0, %xmm0
; AVX512F-NEXT: retq
; AVX-LABEL: merge_4f32_f32_012u:
; AVX: # BB#0:
; AVX-NEXT: vmovq {{.*#+}} xmm0 = mem[0],zero
; AVX-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1],mem[0],xmm0[3]
; AVX-NEXT: retq
%ptr0 = getelementptr inbounds float, float* %ptr, i64 0
%ptr1 = getelementptr inbounds float, float* %ptr, i64 1
%ptr2 = getelementptr inbounds float, float* %ptr, i64 2
Expand Down Expand Up @@ -234,23 +222,11 @@ define <4 x float> @merge_4f32_f32_019u(float* %ptr) nounwind uwtable noinline s
; SSE41-NEXT: insertps {{.*#+}} xmm0 = xmm0[0,1],mem[0],xmm0[3]
; SSE41-NEXT: retq
;
; AVX1-LABEL: merge_4f32_f32_019u:
; AVX1: # BB#0:
; AVX1-NEXT: vmovq {{.*#+}} xmm0 = mem[0],zero
; AVX1-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1],mem[0],xmm0[3]
; AVX1-NEXT: retq
;
; AVX2-LABEL: merge_4f32_f32_019u:
; AVX2: # BB#0:
; AVX2-NEXT: vmovq {{.*#+}} xmm0 = mem[0],zero
; AVX2-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1],mem[0],xmm0[3]
; AVX2-NEXT: retq
;
; AVX512F-LABEL: merge_4f32_f32_019u:
; AVX512F: # BB#0:
; AVX512F-NEXT: vmovq {{.*#+}} xmm0 = mem[0],zero
; AVX512F-NEXT: vinsertps $32, 36(%rdi), %xmm0, %xmm0
; AVX512F-NEXT: retq
; AVX-LABEL: merge_4f32_f32_019u:
; AVX: # BB#0:
; AVX-NEXT: vmovq {{.*#+}} xmm0 = mem[0],zero
; AVX-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1],mem[0],xmm0[3]
; AVX-NEXT: retq
%ptr0 = getelementptr inbounds float, float* %ptr, i64 0
%ptr1 = getelementptr inbounds float, float* %ptr, i64 1
%ptr2 = getelementptr inbounds float, float* %ptr, i64 9
Expand Down
2 changes: 1 addition & 1 deletion test/CodeGen/X86/merge-consecutive-loads-256.ll
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ define <8 x float> @merge_8f32_f32_1u3u5zu8(float* %ptr) nounwind uwtable noinli
; AVX512F-NEXT: vmovss 20(%rdi), %xmm1
; AVX512F-NEXT: vshufps {{.*#+}} xmm0 = xmm1[0,1],xmm0[1,0]
; AVX512F-NEXT: vmovss 4(%rdi), %xmm1
; AVX512F-NEXT: vinsertps $32, 12(%rdi), %xmm1, %xmm1
; AVX512F-NEXT: vinsertps {{.*#+}} xmm1 = xmm1[0,1],mem[0],xmm1[3]
; AVX512F-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0
; AVX512F-NEXT: retq
%ptr0 = getelementptr inbounds float, float* %ptr, i64 1
Expand Down

0 comments on commit bf61370

Please sign in to comment.