2018-11-15 04:44:59 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2018-11-15 05:31:50 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=sse2 | FileCheck %s --check-prefixes=SSE,SSE2
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=sse4.2 | FileCheck %s --check-prefixes=SSE,SSE4
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=avx | FileCheck %s --check-prefixes=AVX,AVX1OR2,AVX1
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=avx2 | FileCheck %s --check-prefixes=AVX,AVX1OR2,AVX2
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=avx512f | FileCheck %s --check-prefixes=AVX,AVX512,AVX512F
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mattr=avx512f,avx512bw,avx512vl | FileCheck %s --check-prefixes=AVX,AVX512,AVX512VLBW
|
2018-11-15 04:44:59 +08:00
|
|
|
|
|
|
|
define void @store_v1i32_v1i32(<1 x i32> %trigger, <1 x i32>* %addr, <1 x i32> %val) {
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE-LABEL: store_v1i32_v1i32:
|
|
|
|
; SSE: ## %bb.0:
|
|
|
|
; SSE-NEXT: testl %edi, %edi
|
|
|
|
; SSE-NEXT: jne LBB0_2
|
|
|
|
; SSE-NEXT: ## %bb.1: ## %cond.store
|
|
|
|
; SSE-NEXT: movl %edx, (%rsi)
|
|
|
|
; SSE-NEXT: LBB0_2: ## %else
|
|
|
|
; SSE-NEXT: retq
|
|
|
|
;
|
2018-11-15 04:44:59 +08:00
|
|
|
; AVX-LABEL: store_v1i32_v1i32:
|
|
|
|
; AVX: ## %bb.0:
|
|
|
|
; AVX-NEXT: testl %edi, %edi
|
|
|
|
; AVX-NEXT: jne LBB0_2
|
|
|
|
; AVX-NEXT: ## %bb.1: ## %cond.store
|
|
|
|
; AVX-NEXT: movl %edx, (%rsi)
|
|
|
|
; AVX-NEXT: LBB0_2: ## %else
|
|
|
|
; AVX-NEXT: retq
|
|
|
|
%mask = icmp eq <1 x i32> %trigger, zeroinitializer
|
|
|
|
call void @llvm.masked.store.v1i32.p0v1i32(<1 x i32>%val, <1 x i32>* %addr, i32 4, <1 x i1>%mask)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @store_v4i32_v4i32(<4 x i32> %trigger, <4 x i32>* %addr, <4 x i32> %val) {
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-LABEL: store_v4i32_v4i32:
|
|
|
|
; SSE2: ## %bb.0:
|
|
|
|
; SSE2-NEXT: pxor %xmm2, %xmm2
|
|
|
|
; SSE2-NEXT: pcmpeqd %xmm0, %xmm2
|
|
|
|
; SSE2-NEXT: movd %xmm2, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB1_2
|
|
|
|
; SSE2-NEXT: ## %bb.1: ## %cond.store
|
|
|
|
; SSE2-NEXT: movd %xmm1, (%rdi)
|
|
|
|
; SSE2-NEXT: LBB1_2: ## %else
|
|
|
|
; SSE2-NEXT: pextrw $2, %xmm2, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB1_4
|
|
|
|
; SSE2-NEXT: ## %bb.3: ## %cond.store1
|
|
|
|
; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm1[1,1,2,3]
|
|
|
|
; SSE2-NEXT: movd %xmm2, 4(%rdi)
|
|
|
|
; SSE2-NEXT: LBB1_4: ## %else2
|
|
|
|
; SSE2-NEXT: pxor %xmm2, %xmm2
|
|
|
|
; SSE2-NEXT: pcmpeqd %xmm2, %xmm0
|
|
|
|
; SSE2-NEXT: pextrw $4, %xmm0, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB1_6
|
|
|
|
; SSE2-NEXT: ## %bb.5: ## %cond.store3
|
|
|
|
; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm1[2,3,0,1]
|
|
|
|
; SSE2-NEXT: movd %xmm2, 8(%rdi)
|
|
|
|
; SSE2-NEXT: LBB1_6: ## %else4
|
|
|
|
; SSE2-NEXT: pextrw $6, %xmm0, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB1_8
|
|
|
|
; SSE2-NEXT: ## %bb.7: ## %cond.store5
|
|
|
|
; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm1[3,1,2,3]
|
|
|
|
; SSE2-NEXT: movd %xmm0, 12(%rdi)
|
|
|
|
; SSE2-NEXT: LBB1_8: ## %else6
|
|
|
|
; SSE2-NEXT: retq
|
|
|
|
;
|
|
|
|
; SSE4-LABEL: store_v4i32_v4i32:
|
|
|
|
; SSE4: ## %bb.0:
|
|
|
|
; SSE4-NEXT: pxor %xmm2, %xmm2
|
|
|
|
; SSE4-NEXT: pcmpeqd %xmm0, %xmm2
|
|
|
|
; SSE4-NEXT: pextrb $0, %xmm2, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB1_2
|
|
|
|
; SSE4-NEXT: ## %bb.1: ## %cond.store
|
|
|
|
; SSE4-NEXT: movss %xmm1, (%rdi)
|
|
|
|
; SSE4-NEXT: LBB1_2: ## %else
|
|
|
|
; SSE4-NEXT: pextrb $4, %xmm2, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB1_4
|
|
|
|
; SSE4-NEXT: ## %bb.3: ## %cond.store1
|
|
|
|
; SSE4-NEXT: extractps $1, %xmm1, 4(%rdi)
|
|
|
|
; SSE4-NEXT: LBB1_4: ## %else2
|
|
|
|
; SSE4-NEXT: pxor %xmm2, %xmm2
|
|
|
|
; SSE4-NEXT: pcmpeqd %xmm2, %xmm0
|
|
|
|
; SSE4-NEXT: pextrb $8, %xmm0, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB1_6
|
|
|
|
; SSE4-NEXT: ## %bb.5: ## %cond.store3
|
|
|
|
; SSE4-NEXT: extractps $2, %xmm1, 8(%rdi)
|
|
|
|
; SSE4-NEXT: LBB1_6: ## %else4
|
|
|
|
; SSE4-NEXT: pextrb $12, %xmm0, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB1_8
|
|
|
|
; SSE4-NEXT: ## %bb.7: ## %cond.store5
|
|
|
|
; SSE4-NEXT: extractps $3, %xmm1, 12(%rdi)
|
|
|
|
; SSE4-NEXT: LBB1_8: ## %else6
|
|
|
|
; SSE4-NEXT: retq
|
|
|
|
;
|
2018-11-15 04:44:59 +08:00
|
|
|
; AVX1-LABEL: store_v4i32_v4i32:
|
|
|
|
; AVX1: ## %bb.0:
|
|
|
|
; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
|
|
|
|
; AVX1-NEXT: vpcmpeqd %xmm2, %xmm0, %xmm0
|
|
|
|
; AVX1-NEXT: vmaskmovps %xmm1, %xmm0, (%rdi)
|
|
|
|
; AVX1-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX2-LABEL: store_v4i32_v4i32:
|
|
|
|
; AVX2: ## %bb.0:
|
|
|
|
; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
|
|
|
|
; AVX2-NEXT: vpcmpeqd %xmm2, %xmm0, %xmm0
|
|
|
|
; AVX2-NEXT: vpmaskmovd %xmm1, %xmm0, (%rdi)
|
|
|
|
; AVX2-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-LABEL: store_v4i32_v4i32:
|
|
|
|
; AVX512F: ## %bb.0:
|
|
|
|
; AVX512F-NEXT: ## kill: def $xmm1 killed $xmm1 def $zmm1
|
|
|
|
; AVX512F-NEXT: ## kill: def $xmm0 killed $xmm0 def $zmm0
|
|
|
|
; AVX512F-NEXT: vptestnmd %zmm0, %zmm0, %k0
|
|
|
|
; AVX512F-NEXT: kshiftlw $12, %k0, %k0
|
|
|
|
; AVX512F-NEXT: kshiftrw $12, %k0, %k1
|
|
|
|
; AVX512F-NEXT: vmovdqu32 %zmm1, (%rdi) {%k1}
|
|
|
|
; AVX512F-NEXT: vzeroupper
|
|
|
|
; AVX512F-NEXT: retq
|
|
|
|
;
|
2018-11-15 05:31:50 +08:00
|
|
|
; AVX512VLBW-LABEL: store_v4i32_v4i32:
|
|
|
|
; AVX512VLBW: ## %bb.0:
|
|
|
|
; AVX512VLBW-NEXT: vptestnmd %xmm0, %xmm0, %k1
|
|
|
|
; AVX512VLBW-NEXT: vmovdqu32 %xmm1, (%rdi) {%k1}
|
|
|
|
; AVX512VLBW-NEXT: retq
|
2018-11-15 04:44:59 +08:00
|
|
|
%mask = icmp eq <4 x i32> %trigger, zeroinitializer
|
|
|
|
call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32>%val, <4 x i32>* %addr, i32 4, <4 x i1>%mask)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @store_v8i32_v8i32(<8 x i32> %trigger, <8 x i32>* %addr, <8 x i32> %val) {
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-LABEL: store_v8i32_v8i32:
|
|
|
|
; SSE2: ## %bb.0:
|
|
|
|
; SSE2-NEXT: pxor %xmm4, %xmm4
|
|
|
|
; SSE2-NEXT: pcmpeqd %xmm0, %xmm4
|
|
|
|
; SSE2-NEXT: movdqa %xmm4, %xmm5
|
|
|
|
; SSE2-NEXT: packssdw %xmm0, %xmm5
|
|
|
|
; SSE2-NEXT: movd %xmm5, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB2_2
|
|
|
|
; SSE2-NEXT: ## %bb.1: ## %cond.store
|
|
|
|
; SSE2-NEXT: movd %xmm2, (%rdi)
|
|
|
|
; SSE2-NEXT: LBB2_2: ## %else
|
2018-12-14 01:05:01 +08:00
|
|
|
; SSE2-NEXT: psrlq $16, %xmm4
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-NEXT: movd %xmm4, %eax
|
|
|
|
; SSE2-NEXT: shrl $16, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB2_4
|
|
|
|
; SSE2-NEXT: ## %bb.3: ## %cond.store1
|
|
|
|
; SSE2-NEXT: pshufd {{.*#+}} xmm4 = xmm2[1,1,2,3]
|
|
|
|
; SSE2-NEXT: movd %xmm4, 4(%rdi)
|
|
|
|
; SSE2-NEXT: LBB2_4: ## %else2
|
|
|
|
; SSE2-NEXT: pxor %xmm4, %xmm4
|
|
|
|
; SSE2-NEXT: pcmpeqd %xmm4, %xmm0
|
|
|
|
; SSE2-NEXT: pextrw $4, %xmm0, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB2_6
|
|
|
|
; SSE2-NEXT: ## %bb.5: ## %cond.store3
|
|
|
|
; SSE2-NEXT: pshufd {{.*#+}} xmm4 = xmm2[2,3,0,1]
|
|
|
|
; SSE2-NEXT: movd %xmm4, 8(%rdi)
|
|
|
|
; SSE2-NEXT: LBB2_6: ## %else4
|
|
|
|
; SSE2-NEXT: pextrw $6, %xmm0, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB2_8
|
|
|
|
; SSE2-NEXT: ## %bb.7: ## %cond.store5
|
|
|
|
; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm2[3,1,2,3]
|
|
|
|
; SSE2-NEXT: movd %xmm0, 12(%rdi)
|
|
|
|
; SSE2-NEXT: LBB2_8: ## %else6
|
|
|
|
; SSE2-NEXT: pxor %xmm0, %xmm0
|
|
|
|
; SSE2-NEXT: pcmpeqd %xmm1, %xmm0
|
|
|
|
; SSE2-NEXT: pextrw $0, %xmm0, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB2_10
|
|
|
|
; SSE2-NEXT: ## %bb.9: ## %cond.store7
|
|
|
|
; SSE2-NEXT: movd %xmm3, 16(%rdi)
|
|
|
|
; SSE2-NEXT: LBB2_10: ## %else8
|
|
|
|
; SSE2-NEXT: pextrw $2, %xmm0, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB2_12
|
|
|
|
; SSE2-NEXT: ## %bb.11: ## %cond.store9
|
|
|
|
; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm3[1,1,2,3]
|
|
|
|
; SSE2-NEXT: movd %xmm0, 20(%rdi)
|
|
|
|
; SSE2-NEXT: LBB2_12: ## %else10
|
|
|
|
; SSE2-NEXT: pxor %xmm0, %xmm0
|
|
|
|
; SSE2-NEXT: pcmpeqd %xmm0, %xmm1
|
|
|
|
; SSE2-NEXT: pextrw $4, %xmm1, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB2_14
|
|
|
|
; SSE2-NEXT: ## %bb.13: ## %cond.store11
|
|
|
|
; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm3[2,3,0,1]
|
|
|
|
; SSE2-NEXT: movd %xmm0, 24(%rdi)
|
|
|
|
; SSE2-NEXT: LBB2_14: ## %else12
|
|
|
|
; SSE2-NEXT: pextrw $6, %xmm1, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB2_16
|
|
|
|
; SSE2-NEXT: ## %bb.15: ## %cond.store13
|
|
|
|
; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm3[3,1,2,3]
|
|
|
|
; SSE2-NEXT: movd %xmm0, 28(%rdi)
|
|
|
|
; SSE2-NEXT: LBB2_16: ## %else14
|
|
|
|
; SSE2-NEXT: retq
|
|
|
|
;
|
|
|
|
; SSE4-LABEL: store_v8i32_v8i32:
|
|
|
|
; SSE4: ## %bb.0:
|
|
|
|
; SSE4-NEXT: pxor %xmm4, %xmm4
|
|
|
|
; SSE4-NEXT: pcmpeqd %xmm0, %xmm4
|
|
|
|
; SSE4-NEXT: pextrb $0, %xmm4, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB2_2
|
|
|
|
; SSE4-NEXT: ## %bb.1: ## %cond.store
|
|
|
|
; SSE4-NEXT: movss %xmm2, (%rdi)
|
|
|
|
; SSE4-NEXT: LBB2_2: ## %else
|
|
|
|
; SSE4-NEXT: pextrb $4, %xmm4, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB2_4
|
|
|
|
; SSE4-NEXT: ## %bb.3: ## %cond.store1
|
|
|
|
; SSE4-NEXT: extractps $1, %xmm2, 4(%rdi)
|
|
|
|
; SSE4-NEXT: LBB2_4: ## %else2
|
|
|
|
; SSE4-NEXT: pxor %xmm4, %xmm4
|
|
|
|
; SSE4-NEXT: pcmpeqd %xmm4, %xmm0
|
|
|
|
; SSE4-NEXT: pextrb $8, %xmm0, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB2_6
|
|
|
|
; SSE4-NEXT: ## %bb.5: ## %cond.store3
|
|
|
|
; SSE4-NEXT: extractps $2, %xmm2, 8(%rdi)
|
|
|
|
; SSE4-NEXT: LBB2_6: ## %else4
|
|
|
|
; SSE4-NEXT: pextrb $12, %xmm0, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB2_8
|
|
|
|
; SSE4-NEXT: ## %bb.7: ## %cond.store5
|
|
|
|
; SSE4-NEXT: extractps $3, %xmm2, 12(%rdi)
|
|
|
|
; SSE4-NEXT: LBB2_8: ## %else6
|
|
|
|
; SSE4-NEXT: pxor %xmm0, %xmm0
|
|
|
|
; SSE4-NEXT: pcmpeqd %xmm1, %xmm0
|
|
|
|
; SSE4-NEXT: pextrb $0, %xmm0, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB2_10
|
|
|
|
; SSE4-NEXT: ## %bb.9: ## %cond.store7
|
|
|
|
; SSE4-NEXT: movss %xmm3, 16(%rdi)
|
|
|
|
; SSE4-NEXT: LBB2_10: ## %else8
|
|
|
|
; SSE4-NEXT: pextrb $4, %xmm0, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB2_12
|
|
|
|
; SSE4-NEXT: ## %bb.11: ## %cond.store9
|
|
|
|
; SSE4-NEXT: extractps $1, %xmm3, 20(%rdi)
|
|
|
|
; SSE4-NEXT: LBB2_12: ## %else10
|
|
|
|
; SSE4-NEXT: pxor %xmm0, %xmm0
|
|
|
|
; SSE4-NEXT: pcmpeqd %xmm0, %xmm1
|
|
|
|
; SSE4-NEXT: pextrb $8, %xmm1, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB2_14
|
|
|
|
; SSE4-NEXT: ## %bb.13: ## %cond.store11
|
|
|
|
; SSE4-NEXT: extractps $2, %xmm3, 24(%rdi)
|
|
|
|
; SSE4-NEXT: LBB2_14: ## %else12
|
|
|
|
; SSE4-NEXT: pextrb $12, %xmm1, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB2_16
|
|
|
|
; SSE4-NEXT: ## %bb.15: ## %cond.store13
|
|
|
|
; SSE4-NEXT: extractps $3, %xmm3, 28(%rdi)
|
|
|
|
; SSE4-NEXT: LBB2_16: ## %else14
|
|
|
|
; SSE4-NEXT: retq
|
|
|
|
;
|
2018-11-15 04:44:59 +08:00
|
|
|
; AVX1-LABEL: store_v8i32_v8i32:
|
|
|
|
; AVX1: ## %bb.0:
|
|
|
|
; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm2
|
|
|
|
; AVX1-NEXT: vpxor %xmm3, %xmm3, %xmm3
|
|
|
|
; AVX1-NEXT: vpcmpeqd %xmm3, %xmm2, %xmm2
|
|
|
|
; AVX1-NEXT: vpcmpeqd %xmm3, %xmm0, %xmm0
|
|
|
|
; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
|
|
|
|
; AVX1-NEXT: vmaskmovps %ymm1, %ymm0, (%rdi)
|
|
|
|
; AVX1-NEXT: vzeroupper
|
|
|
|
; AVX1-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX2-LABEL: store_v8i32_v8i32:
|
|
|
|
; AVX2: ## %bb.0:
|
|
|
|
; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
|
|
|
|
; AVX2-NEXT: vpcmpeqd %ymm2, %ymm0, %ymm0
|
|
|
|
; AVX2-NEXT: vpmaskmovd %ymm1, %ymm0, (%rdi)
|
|
|
|
; AVX2-NEXT: vzeroupper
|
|
|
|
; AVX2-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-LABEL: store_v8i32_v8i32:
|
|
|
|
; AVX512F: ## %bb.0:
|
|
|
|
; AVX512F-NEXT: ## kill: def $ymm1 killed $ymm1 def $zmm1
|
|
|
|
; AVX512F-NEXT: ## kill: def $ymm0 killed $ymm0 def $zmm0
|
|
|
|
; AVX512F-NEXT: vptestnmd %zmm0, %zmm0, %k0
|
|
|
|
; AVX512F-NEXT: kshiftlw $8, %k0, %k0
|
|
|
|
; AVX512F-NEXT: kshiftrw $8, %k0, %k1
|
|
|
|
; AVX512F-NEXT: vmovdqu32 %zmm1, (%rdi) {%k1}
|
|
|
|
; AVX512F-NEXT: vzeroupper
|
|
|
|
; AVX512F-NEXT: retq
|
|
|
|
;
|
2018-11-15 05:31:50 +08:00
|
|
|
; AVX512VLBW-LABEL: store_v8i32_v8i32:
|
|
|
|
; AVX512VLBW: ## %bb.0:
|
|
|
|
; AVX512VLBW-NEXT: vptestnmd %ymm0, %ymm0, %k1
|
|
|
|
; AVX512VLBW-NEXT: vmovdqu32 %ymm1, (%rdi) {%k1}
|
|
|
|
; AVX512VLBW-NEXT: vzeroupper
|
|
|
|
; AVX512VLBW-NEXT: retq
|
2018-11-15 04:44:59 +08:00
|
|
|
%mask = icmp eq <8 x i32> %trigger, zeroinitializer
|
|
|
|
call void @llvm.masked.store.v8i32.p0v8i32(<8 x i32>%val, <8 x i32>* %addr, i32 4, <8 x i1>%mask)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @store_v2f32_v2i32(<2 x i32> %trigger, <2 x float>* %addr, <2 x float> %val) {
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-LABEL: store_v2f32_v2i32:
|
|
|
|
; SSE2: ## %bb.0:
|
|
|
|
; SSE2-NEXT: pand {{.*}}(%rip), %xmm0
|
|
|
|
; SSE2-NEXT: pxor %xmm2, %xmm2
|
|
|
|
; SSE2-NEXT: pcmpeqd %xmm0, %xmm2
|
|
|
|
; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm2[1,0,3,2]
|
|
|
|
; SSE2-NEXT: pand %xmm2, %xmm0
|
|
|
|
; SSE2-NEXT: movd %xmm0, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB3_2
|
|
|
|
; SSE2-NEXT: ## %bb.1: ## %cond.store
|
|
|
|
; SSE2-NEXT: movss %xmm1, (%rdi)
|
|
|
|
; SSE2-NEXT: LBB3_2: ## %else
|
|
|
|
; SSE2-NEXT: pextrw $4, %xmm0, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB3_4
|
|
|
|
; SSE2-NEXT: ## %bb.3: ## %cond.store1
|
|
|
|
; SSE2-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,1,2,3]
|
|
|
|
; SSE2-NEXT: movss %xmm1, 4(%rdi)
|
|
|
|
; SSE2-NEXT: LBB3_4: ## %else2
|
|
|
|
; SSE2-NEXT: retq
|
|
|
|
;
|
|
|
|
; SSE4-LABEL: store_v2f32_v2i32:
|
|
|
|
; SSE4: ## %bb.0:
|
|
|
|
; SSE4-NEXT: pxor %xmm2, %xmm2
|
2019-02-23 16:34:10 +08:00
|
|
|
; SSE4-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0,1],xmm2[2,3],xmm0[4,5],xmm2[6,7]
|
|
|
|
; SSE4-NEXT: pcmpeqq %xmm2, %xmm0
|
|
|
|
; SSE4-NEXT: pextrb $0, %xmm0, %eax
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB3_2
|
|
|
|
; SSE4-NEXT: ## %bb.1: ## %cond.store
|
|
|
|
; SSE4-NEXT: movss %xmm1, (%rdi)
|
|
|
|
; SSE4-NEXT: LBB3_2: ## %else
|
|
|
|
; SSE4-NEXT: pextrb $8, %xmm0, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB3_4
|
|
|
|
; SSE4-NEXT: ## %bb.3: ## %cond.store1
|
|
|
|
; SSE4-NEXT: extractps $1, %xmm1, 4(%rdi)
|
|
|
|
; SSE4-NEXT: LBB3_4: ## %else2
|
|
|
|
; SSE4-NEXT: retq
|
|
|
|
;
|
2018-11-15 04:44:59 +08:00
|
|
|
; AVX1-LABEL: store_v2f32_v2i32:
|
|
|
|
; AVX1: ## %bb.0:
|
|
|
|
; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
|
|
|
|
; AVX1-NEXT: vpblendw {{.*#+}} xmm0 = xmm0[0,1],xmm2[2,3],xmm0[4,5],xmm2[6,7]
|
|
|
|
; AVX1-NEXT: vpcmpeqq %xmm2, %xmm0, %xmm0
|
|
|
|
; AVX1-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,2],zero,zero
|
|
|
|
; AVX1-NEXT: vmaskmovps %xmm1, %xmm0, (%rdi)
|
|
|
|
; AVX1-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX2-LABEL: store_v2f32_v2i32:
|
|
|
|
; AVX2: ## %bb.0:
|
|
|
|
; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
|
|
|
|
; AVX2-NEXT: vpblendd {{.*#+}} xmm0 = xmm0[0],xmm2[1],xmm0[2],xmm2[3]
|
|
|
|
; AVX2-NEXT: vpcmpeqq %xmm2, %xmm0, %xmm0
|
|
|
|
; AVX2-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,2],zero,zero
|
|
|
|
; AVX2-NEXT: vmaskmovps %xmm1, %xmm0, (%rdi)
|
|
|
|
; AVX2-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-LABEL: store_v2f32_v2i32:
|
|
|
|
; AVX512F: ## %bb.0:
|
|
|
|
; AVX512F-NEXT: ## kill: def $xmm1 killed $xmm1 def $zmm1
|
|
|
|
; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
|
|
|
|
; AVX512F-NEXT: vpblendd {{.*#+}} xmm0 = xmm0[0],xmm2[1],xmm0[2],xmm2[3]
|
|
|
|
; AVX512F-NEXT: vptestnmq %zmm0, %zmm0, %k0
|
|
|
|
; AVX512F-NEXT: kshiftlw $14, %k0, %k0
|
|
|
|
; AVX512F-NEXT: kshiftrw $14, %k0, %k1
|
|
|
|
; AVX512F-NEXT: vmovups %zmm1, (%rdi) {%k1}
|
|
|
|
; AVX512F-NEXT: vzeroupper
|
|
|
|
; AVX512F-NEXT: retq
|
|
|
|
;
|
2018-11-15 05:31:50 +08:00
|
|
|
; AVX512VLBW-LABEL: store_v2f32_v2i32:
|
|
|
|
; AVX512VLBW: ## %bb.0:
|
|
|
|
; AVX512VLBW-NEXT: vpxor %xmm2, %xmm2, %xmm2
|
|
|
|
; AVX512VLBW-NEXT: vpblendd {{.*#+}} xmm0 = xmm0[0],xmm2[1],xmm0[2],xmm2[3]
|
|
|
|
; AVX512VLBW-NEXT: vptestnmq %xmm0, %xmm0, %k1
|
|
|
|
; AVX512VLBW-NEXT: vmovups %xmm1, (%rdi) {%k1}
|
|
|
|
; AVX512VLBW-NEXT: retq
|
2018-11-15 04:44:59 +08:00
|
|
|
%mask = icmp eq <2 x i32> %trigger, zeroinitializer
|
|
|
|
call void @llvm.masked.store.v2f32.p0v2f32(<2 x float>%val, <2 x float>* %addr, i32 4, <2 x i1>%mask)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @store_v2i32_v2i32(<2 x i32> %trigger, <2 x i32>* %addr, <2 x i32> %val) {
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-LABEL: store_v2i32_v2i32:
|
|
|
|
; SSE2: ## %bb.0:
|
|
|
|
; SSE2-NEXT: pand {{.*}}(%rip), %xmm0
|
|
|
|
; SSE2-NEXT: pxor %xmm2, %xmm2
|
|
|
|
; SSE2-NEXT: pcmpeqd %xmm0, %xmm2
|
|
|
|
; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm2[1,0,3,2]
|
|
|
|
; SSE2-NEXT: pand %xmm2, %xmm0
|
|
|
|
; SSE2-NEXT: movd %xmm0, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB4_2
|
|
|
|
; SSE2-NEXT: ## %bb.1: ## %cond.store
|
|
|
|
; SSE2-NEXT: movd %xmm1, (%rdi)
|
|
|
|
; SSE2-NEXT: LBB4_2: ## %else
|
|
|
|
; SSE2-NEXT: pextrw $4, %xmm0, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB4_4
|
|
|
|
; SSE2-NEXT: ## %bb.3: ## %cond.store1
|
|
|
|
; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm1[2,3,0,1]
|
|
|
|
; SSE2-NEXT: movd %xmm0, 4(%rdi)
|
|
|
|
; SSE2-NEXT: LBB4_4: ## %else2
|
|
|
|
; SSE2-NEXT: retq
|
|
|
|
;
|
|
|
|
; SSE4-LABEL: store_v2i32_v2i32:
|
|
|
|
; SSE4: ## %bb.0:
|
|
|
|
; SSE4-NEXT: pxor %xmm2, %xmm2
|
2019-02-23 16:34:10 +08:00
|
|
|
; SSE4-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0,1],xmm2[2,3],xmm0[4,5],xmm2[6,7]
|
|
|
|
; SSE4-NEXT: pcmpeqq %xmm2, %xmm0
|
|
|
|
; SSE4-NEXT: pextrb $0, %xmm0, %eax
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB4_2
|
|
|
|
; SSE4-NEXT: ## %bb.1: ## %cond.store
|
|
|
|
; SSE4-NEXT: movss %xmm1, (%rdi)
|
|
|
|
; SSE4-NEXT: LBB4_2: ## %else
|
|
|
|
; SSE4-NEXT: pextrb $8, %xmm0, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB4_4
|
|
|
|
; SSE4-NEXT: ## %bb.3: ## %cond.store1
|
|
|
|
; SSE4-NEXT: extractps $2, %xmm1, 4(%rdi)
|
|
|
|
; SSE4-NEXT: LBB4_4: ## %else2
|
|
|
|
; SSE4-NEXT: retq
|
|
|
|
;
|
2018-11-15 04:44:59 +08:00
|
|
|
; AVX1-LABEL: store_v2i32_v2i32:
|
|
|
|
; AVX1: ## %bb.0:
|
|
|
|
; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
|
|
|
|
; AVX1-NEXT: vpblendw {{.*#+}} xmm0 = xmm0[0,1],xmm2[2,3],xmm0[4,5],xmm2[6,7]
|
|
|
|
; AVX1-NEXT: vpcmpeqq %xmm2, %xmm0, %xmm0
|
|
|
|
; AVX1-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,2],zero,zero
|
|
|
|
; AVX1-NEXT: vpermilps {{.*#+}} xmm1 = xmm1[0,2,2,3]
|
|
|
|
; AVX1-NEXT: vmaskmovps %xmm1, %xmm0, (%rdi)
|
|
|
|
; AVX1-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX2-LABEL: store_v2i32_v2i32:
|
|
|
|
; AVX2: ## %bb.0:
|
|
|
|
; AVX2-NEXT: vpxor %xmm2, %xmm2, %xmm2
|
|
|
|
; AVX2-NEXT: vpblendd {{.*#+}} xmm0 = xmm0[0],xmm2[1],xmm0[2],xmm2[3]
|
|
|
|
; AVX2-NEXT: vpcmpeqq %xmm2, %xmm0, %xmm0
|
|
|
|
; AVX2-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,2],zero,zero
|
|
|
|
; AVX2-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[0,2,2,3]
|
|
|
|
; AVX2-NEXT: vpmaskmovd %xmm1, %xmm0, (%rdi)
|
|
|
|
; AVX2-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-LABEL: store_v2i32_v2i32:
|
|
|
|
; AVX512F: ## %bb.0:
|
|
|
|
; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
|
|
|
|
; AVX512F-NEXT: vpblendd {{.*#+}} xmm0 = xmm0[0],xmm2[1],xmm0[2],xmm2[3]
|
|
|
|
; AVX512F-NEXT: vptestnmq %zmm0, %zmm0, %k0
|
|
|
|
; AVX512F-NEXT: vpshufd {{.*#+}} xmm0 = xmm1[0,2,2,3]
|
|
|
|
; AVX512F-NEXT: kshiftlw $14, %k0, %k0
|
|
|
|
; AVX512F-NEXT: kshiftrw $14, %k0, %k1
|
|
|
|
; AVX512F-NEXT: vmovdqu32 %zmm0, (%rdi) {%k1}
|
|
|
|
; AVX512F-NEXT: vzeroupper
|
|
|
|
; AVX512F-NEXT: retq
|
|
|
|
;
|
2018-11-15 05:31:50 +08:00
|
|
|
; AVX512VLBW-LABEL: store_v2i32_v2i32:
|
|
|
|
; AVX512VLBW: ## %bb.0:
|
|
|
|
; AVX512VLBW-NEXT: vpxor %xmm2, %xmm2, %xmm2
|
|
|
|
; AVX512VLBW-NEXT: vpblendd {{.*#+}} xmm0 = xmm0[0],xmm2[1],xmm0[2],xmm2[3]
|
|
|
|
; AVX512VLBW-NEXT: vptestnmq %xmm0, %xmm0, %k1
|
|
|
|
; AVX512VLBW-NEXT: vpmovqd %xmm1, (%rdi) {%k1}
|
|
|
|
; AVX512VLBW-NEXT: retq
|
2018-11-15 04:44:59 +08:00
|
|
|
%mask = icmp eq <2 x i32> %trigger, zeroinitializer
|
|
|
|
call void @llvm.masked.store.v2i32.p0v2i32(<2 x i32>%val, <2 x i32>* %addr, i32 4, <2 x i1>%mask)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @const_store_v4i32_v4i32(<4 x i32> %trigger, <4 x i32>* %addr, <4 x i32> %val) {
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE-LABEL: const_store_v4i32_v4i32:
|
|
|
|
; SSE: ## %bb.0:
|
|
|
|
; SSE-NEXT: movups %xmm1, (%rdi)
|
|
|
|
; SSE-NEXT: retq
|
|
|
|
;
|
2018-11-15 04:44:59 +08:00
|
|
|
; AVX1-LABEL: const_store_v4i32_v4i32:
|
|
|
|
; AVX1: ## %bb.0:
|
|
|
|
; AVX1-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
|
|
|
|
; AVX1-NEXT: vmaskmovps %xmm1, %xmm0, (%rdi)
|
|
|
|
; AVX1-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX2-LABEL: const_store_v4i32_v4i32:
|
|
|
|
; AVX2: ## %bb.0:
|
|
|
|
; AVX2-NEXT: vpcmpeqd %xmm0, %xmm0, %xmm0
|
|
|
|
; AVX2-NEXT: vpmaskmovd %xmm1, %xmm0, (%rdi)
|
|
|
|
; AVX2-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-LABEL: const_store_v4i32_v4i32:
|
|
|
|
; AVX512F: ## %bb.0:
|
|
|
|
; AVX512F-NEXT: ## kill: def $xmm1 killed $xmm1 def $zmm1
|
|
|
|
; AVX512F-NEXT: movw $15, %ax
|
|
|
|
; AVX512F-NEXT: kmovw %eax, %k1
|
|
|
|
; AVX512F-NEXT: vmovdqu32 %zmm1, (%rdi) {%k1}
|
|
|
|
; AVX512F-NEXT: vzeroupper
|
|
|
|
; AVX512F-NEXT: retq
|
|
|
|
;
|
2018-11-15 05:31:50 +08:00
|
|
|
; AVX512VLBW-LABEL: const_store_v4i32_v4i32:
|
|
|
|
; AVX512VLBW: ## %bb.0:
|
|
|
|
; AVX512VLBW-NEXT: kxnorw %k0, %k0, %k1
|
|
|
|
; AVX512VLBW-NEXT: vmovdqu32 %xmm1, (%rdi) {%k1}
|
|
|
|
; AVX512VLBW-NEXT: retq
|
2018-11-15 04:44:59 +08:00
|
|
|
%mask = icmp eq <4 x i32> %trigger, zeroinitializer
|
|
|
|
call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32>%val, <4 x i32>* %addr, i32 4, <4 x i1><i1 true, i1 true, i1 true, i1 true>)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; When only one element of the mask is set, reduce to a scalar store.
|
|
|
|
|
|
|
|
define void @one_mask_bit_set1(<4 x i32>* %addr, <4 x i32> %val) {
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE-LABEL: one_mask_bit_set1:
|
|
|
|
; SSE: ## %bb.0:
|
|
|
|
; SSE-NEXT: movss %xmm0, (%rdi)
|
|
|
|
; SSE-NEXT: retq
|
|
|
|
;
|
2018-11-15 04:44:59 +08:00
|
|
|
; AVX-LABEL: one_mask_bit_set1:
|
|
|
|
; AVX: ## %bb.0:
|
|
|
|
; AVX-NEXT: vmovss %xmm0, (%rdi)
|
|
|
|
; AVX-NEXT: retq
|
|
|
|
call void @llvm.masked.store.v4i32.p0v4i32(<4 x i32> %val, <4 x i32>* %addr, i32 4, <4 x i1><i1 true, i1 false, i1 false, i1 false>)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Choose a different element to show that the correct address offset is produced.
|
|
|
|
|
|
|
|
define void @one_mask_bit_set2(<4 x float>* %addr, <4 x float> %val) {
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-LABEL: one_mask_bit_set2:
|
|
|
|
; SSE2: ## %bb.0:
|
|
|
|
; SSE2-NEXT: movhlps {{.*#+}} xmm0 = xmm0[1,1]
|
|
|
|
; SSE2-NEXT: movss %xmm0, 8(%rdi)
|
|
|
|
; SSE2-NEXT: retq
|
|
|
|
;
|
|
|
|
; SSE4-LABEL: one_mask_bit_set2:
|
|
|
|
; SSE4: ## %bb.0:
|
|
|
|
; SSE4-NEXT: extractps $2, %xmm0, 8(%rdi)
|
|
|
|
; SSE4-NEXT: retq
|
|
|
|
;
|
2018-11-15 04:44:59 +08:00
|
|
|
; AVX-LABEL: one_mask_bit_set2:
|
|
|
|
; AVX: ## %bb.0:
|
|
|
|
; AVX-NEXT: vextractps $2, %xmm0, 8(%rdi)
|
|
|
|
; AVX-NEXT: retq
|
|
|
|
call void @llvm.masked.store.v4f32.p0v4f32(<4 x float> %val, <4 x float>* %addr, i32 4, <4 x i1><i1 false, i1 false, i1 true, i1 false>)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Choose a different scalar type and a high element of a 256-bit vector because AVX doesn't support those evenly.
|
|
|
|
|
|
|
|
define void @one_mask_bit_set3(<4 x i64>* %addr, <4 x i64> %val) {
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE-LABEL: one_mask_bit_set3:
|
|
|
|
; SSE: ## %bb.0:
|
|
|
|
; SSE-NEXT: movlps %xmm1, 16(%rdi)
|
|
|
|
; SSE-NEXT: retq
|
|
|
|
;
|
2018-11-15 04:44:59 +08:00
|
|
|
; AVX-LABEL: one_mask_bit_set3:
|
|
|
|
; AVX: ## %bb.0:
|
|
|
|
; AVX-NEXT: vextractf128 $1, %ymm0, %xmm0
|
|
|
|
; AVX-NEXT: vmovlps %xmm0, 16(%rdi)
|
|
|
|
; AVX-NEXT: vzeroupper
|
|
|
|
; AVX-NEXT: retq
|
|
|
|
call void @llvm.masked.store.v4i64.p0v4i64(<4 x i64> %val, <4 x i64>* %addr, i32 4, <4 x i1><i1 false, i1 false, i1 true, i1 false>)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Choose a different scalar type and a high element of a 256-bit vector because AVX doesn't support those evenly.
|
|
|
|
|
|
|
|
define void @one_mask_bit_set4(<4 x double>* %addr, <4 x double> %val) {
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE-LABEL: one_mask_bit_set4:
|
|
|
|
; SSE: ## %bb.0:
|
|
|
|
; SSE-NEXT: movhpd %xmm1, 24(%rdi)
|
|
|
|
; SSE-NEXT: retq
|
|
|
|
;
|
2018-11-15 04:44:59 +08:00
|
|
|
; AVX-LABEL: one_mask_bit_set4:
|
|
|
|
; AVX: ## %bb.0:
|
|
|
|
; AVX-NEXT: vextractf128 $1, %ymm0, %xmm0
|
|
|
|
; AVX-NEXT: vmovhpd %xmm0, 24(%rdi)
|
|
|
|
; AVX-NEXT: vzeroupper
|
|
|
|
; AVX-NEXT: retq
|
|
|
|
call void @llvm.masked.store.v4f64.p0v4f64(<4 x double> %val, <4 x double>* %addr, i32 4, <4 x i1><i1 false, i1 false, i1 false, i1 true>)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; Try a 512-bit vector to make sure AVX doesn't die and AVX512 works as expected.
|
|
|
|
|
|
|
|
define void @one_mask_bit_set5(<8 x double>* %addr, <8 x double> %val) {
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE-LABEL: one_mask_bit_set5:
|
|
|
|
; SSE: ## %bb.0:
|
|
|
|
; SSE-NEXT: movlps %xmm3, 48(%rdi)
|
|
|
|
; SSE-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX1OR2-LABEL: one_mask_bit_set5:
|
|
|
|
; AVX1OR2: ## %bb.0:
|
|
|
|
; AVX1OR2-NEXT: vextractf128 $1, %ymm1, %xmm0
|
|
|
|
; AVX1OR2-NEXT: vmovlps %xmm0, 48(%rdi)
|
|
|
|
; AVX1OR2-NEXT: vzeroupper
|
|
|
|
; AVX1OR2-NEXT: retq
|
2018-11-15 04:44:59 +08:00
|
|
|
;
|
|
|
|
; AVX512-LABEL: one_mask_bit_set5:
|
|
|
|
; AVX512: ## %bb.0:
|
|
|
|
; AVX512-NEXT: vextractf32x4 $3, %zmm0, %xmm0
|
|
|
|
; AVX512-NEXT: vmovlps %xmm0, 48(%rdi)
|
|
|
|
; AVX512-NEXT: vzeroupper
|
|
|
|
; AVX512-NEXT: retq
|
|
|
|
call void @llvm.masked.store.v8f64.p0v8f64(<8 x double> %val, <8 x double>* %addr, i32 4, <8 x i1><i1 false, i1 false, i1 false, i1 false, i1 false, i1 false, i1 true, i1 false>)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2019-04-05 19:34:30 +08:00
|
|
|
; PR34584: The mask bit for each data element is the most significant bit of the mask operand, so a compare isn't needed.
|
2018-11-15 04:44:59 +08:00
|
|
|
; FIXME: The AVX512 code should be improved to use 'vpmovd2m'. Add tests for 512-bit vectors when implementing that.
|
|
|
|
|
2019-04-05 19:34:30 +08:00
|
|
|
define void @trunc_mask_v4f32_v4i32(<4 x float> %x, <4 x float>* %ptr, <4 x float> %y, <4 x i32> %mask) {
|
|
|
|
; SSE2-LABEL: trunc_mask_v4f32_v4i32:
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2: ## %bb.0:
|
|
|
|
; SSE2-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; SSE2-NEXT: pcmpgtd %xmm2, %xmm1
|
|
|
|
; SSE2-NEXT: movd %xmm1, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB11_2
|
|
|
|
; SSE2-NEXT: ## %bb.1: ## %cond.store
|
|
|
|
; SSE2-NEXT: movss %xmm0, (%rdi)
|
|
|
|
; SSE2-NEXT: LBB11_2: ## %else
|
|
|
|
; SSE2-NEXT: pextrw $2, %xmm1, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB11_4
|
|
|
|
; SSE2-NEXT: ## %bb.3: ## %cond.store1
|
|
|
|
; SSE2-NEXT: movaps %xmm0, %xmm1
|
|
|
|
; SSE2-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,1],xmm0[2,3]
|
|
|
|
; SSE2-NEXT: movss %xmm1, 4(%rdi)
|
|
|
|
; SSE2-NEXT: LBB11_4: ## %else2
|
|
|
|
; SSE2-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; SSE2-NEXT: pcmpgtd %xmm2, %xmm1
|
|
|
|
; SSE2-NEXT: pextrw $4, %xmm1, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB11_6
|
|
|
|
; SSE2-NEXT: ## %bb.5: ## %cond.store3
|
|
|
|
; SSE2-NEXT: movaps %xmm0, %xmm2
|
|
|
|
; SSE2-NEXT: unpckhpd {{.*#+}} xmm2 = xmm2[1],xmm0[1]
|
|
|
|
; SSE2-NEXT: movss %xmm2, 8(%rdi)
|
|
|
|
; SSE2-NEXT: LBB11_6: ## %else4
|
|
|
|
; SSE2-NEXT: pextrw $6, %xmm1, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB11_8
|
|
|
|
; SSE2-NEXT: ## %bb.7: ## %cond.store5
|
|
|
|
; SSE2-NEXT: shufps {{.*#+}} xmm0 = xmm0[3,1,2,3]
|
|
|
|
; SSE2-NEXT: movss %xmm0, 12(%rdi)
|
|
|
|
; SSE2-NEXT: LBB11_8: ## %else6
|
|
|
|
; SSE2-NEXT: retq
|
|
|
|
;
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE4-LABEL: trunc_mask_v4f32_v4i32:
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE4: ## %bb.0:
|
|
|
|
; SSE4-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; SSE4-NEXT: pcmpgtd %xmm2, %xmm1
|
|
|
|
; SSE4-NEXT: pextrb $0, %xmm1, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB11_2
|
|
|
|
; SSE4-NEXT: ## %bb.1: ## %cond.store
|
|
|
|
; SSE4-NEXT: movss %xmm0, (%rdi)
|
|
|
|
; SSE4-NEXT: LBB11_2: ## %else
|
|
|
|
; SSE4-NEXT: pextrb $4, %xmm1, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB11_4
|
|
|
|
; SSE4-NEXT: ## %bb.3: ## %cond.store1
|
|
|
|
; SSE4-NEXT: extractps $1, %xmm0, 4(%rdi)
|
|
|
|
; SSE4-NEXT: LBB11_4: ## %else2
|
|
|
|
; SSE4-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; SSE4-NEXT: pcmpgtd %xmm2, %xmm1
|
|
|
|
; SSE4-NEXT: pextrb $8, %xmm1, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB11_6
|
|
|
|
; SSE4-NEXT: ## %bb.5: ## %cond.store3
|
|
|
|
; SSE4-NEXT: extractps $2, %xmm0, 8(%rdi)
|
|
|
|
; SSE4-NEXT: LBB11_6: ## %else4
|
|
|
|
; SSE4-NEXT: pextrb $12, %xmm1, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB11_8
|
|
|
|
; SSE4-NEXT: ## %bb.7: ## %cond.store5
|
|
|
|
; SSE4-NEXT: extractps $3, %xmm0, 12(%rdi)
|
|
|
|
; SSE4-NEXT: LBB11_8: ## %else6
|
|
|
|
; SSE4-NEXT: retq
|
|
|
|
;
|
2019-04-05 19:34:30 +08:00
|
|
|
; AVX1OR2-LABEL: trunc_mask_v4f32_v4i32:
|
2018-11-15 05:31:50 +08:00
|
|
|
; AVX1OR2: ## %bb.0:
|
|
|
|
; AVX1OR2-NEXT: vmaskmovps %xmm0, %xmm2, (%rdi)
|
|
|
|
; AVX1OR2-NEXT: retq
|
2018-11-15 04:44:59 +08:00
|
|
|
;
|
2019-04-05 19:34:30 +08:00
|
|
|
; AVX512F-LABEL: trunc_mask_v4f32_v4i32:
|
2018-11-15 04:44:59 +08:00
|
|
|
; AVX512F: ## %bb.0:
|
|
|
|
; AVX512F-NEXT: ## kill: def $xmm2 killed $xmm2 def $zmm2
|
|
|
|
; AVX512F-NEXT: ## kill: def $xmm0 killed $xmm0 def $zmm0
|
|
|
|
; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
|
|
|
|
; AVX512F-NEXT: vpcmpgtd %zmm2, %zmm1, %k0
|
|
|
|
; AVX512F-NEXT: kshiftlw $12, %k0, %k0
|
|
|
|
; AVX512F-NEXT: kshiftrw $12, %k0, %k1
|
|
|
|
; AVX512F-NEXT: vmovups %zmm0, (%rdi) {%k1}
|
|
|
|
; AVX512F-NEXT: vzeroupper
|
|
|
|
; AVX512F-NEXT: retq
|
|
|
|
;
|
2019-04-05 19:34:30 +08:00
|
|
|
; AVX512VLBW-LABEL: trunc_mask_v4f32_v4i32:
|
2018-11-15 05:31:50 +08:00
|
|
|
; AVX512VLBW: ## %bb.0:
|
|
|
|
; AVX512VLBW-NEXT: vpxor %xmm1, %xmm1, %xmm1
|
|
|
|
; AVX512VLBW-NEXT: vpcmpgtd %xmm2, %xmm1, %k1
|
|
|
|
; AVX512VLBW-NEXT: vmovups %xmm0, (%rdi) {%k1}
|
|
|
|
; AVX512VLBW-NEXT: retq
|
2018-11-15 04:44:59 +08:00
|
|
|
%bool_mask = icmp slt <4 x i32> %mask, zeroinitializer
|
|
|
|
call void @llvm.masked.store.v4f32.p0v4f32(<4 x float> %x, <4 x float>* %ptr, i32 1, <4 x i1> %bool_mask)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2019-04-05 19:34:30 +08:00
|
|
|
define void @trunc_mask_v8f32_v8i32(<8 x float> %x, <8 x float>* %ptr, <8 x float> %y, <8 x i32> %mask) {
|
|
|
|
; SSE2-LABEL: trunc_mask_v8f32_v8i32:
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2: ## %bb.0:
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE2-NEXT: pxor %xmm2, %xmm2
|
|
|
|
; SSE2-NEXT: pcmpgtd %xmm4, %xmm2
|
|
|
|
; SSE2-NEXT: movdqa %xmm2, %xmm3
|
|
|
|
; SSE2-NEXT: packssdw %xmm0, %xmm3
|
|
|
|
; SSE2-NEXT: movd %xmm3, %eax
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB12_2
|
|
|
|
; SSE2-NEXT: ## %bb.1: ## %cond.store
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE2-NEXT: movd %xmm0, (%rdi)
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-NEXT: LBB12_2: ## %else
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE2-NEXT: psrlq $16, %xmm2
|
|
|
|
; SSE2-NEXT: movd %xmm2, %eax
|
|
|
|
; SSE2-NEXT: shrl $16, %eax
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB12_4
|
|
|
|
; SSE2-NEXT: ## %bb.3: ## %cond.store1
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE2-NEXT: movdqa %xmm0, %xmm2
|
|
|
|
; SSE2-NEXT: shufps {{.*#+}} xmm2 = xmm2[1,1],xmm0[2,3]
|
|
|
|
; SSE2-NEXT: movss %xmm2, 4(%rdi)
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-NEXT: LBB12_4: ## %else2
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE2-NEXT: pxor %xmm2, %xmm2
|
|
|
|
; SSE2-NEXT: pcmpgtd %xmm4, %xmm2
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-NEXT: pextrw $4, %xmm2, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB12_6
|
|
|
|
; SSE2-NEXT: ## %bb.5: ## %cond.store3
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE2-NEXT: movdqa %xmm0, %xmm3
|
|
|
|
; SSE2-NEXT: punpckhqdq {{.*#+}} xmm3 = xmm3[1],xmm0[1]
|
|
|
|
; SSE2-NEXT: movd %xmm3, 8(%rdi)
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-NEXT: LBB12_6: ## %else4
|
|
|
|
; SSE2-NEXT: pextrw $6, %xmm2, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB12_8
|
|
|
|
; SSE2-NEXT: ## %bb.7: ## %cond.store5
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE2-NEXT: shufps {{.*#+}} xmm0 = xmm0[3,1,2,3]
|
|
|
|
; SSE2-NEXT: movss %xmm0, 12(%rdi)
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-NEXT: LBB12_8: ## %else6
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE2-NEXT: pxor %xmm0, %xmm0
|
|
|
|
; SSE2-NEXT: pcmpgtd %xmm5, %xmm0
|
|
|
|
; SSE2-NEXT: pextrw $0, %xmm0, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB12_10
|
|
|
|
; SSE2-NEXT: ## %bb.9: ## %cond.store7
|
|
|
|
; SSE2-NEXT: movss %xmm1, 16(%rdi)
|
|
|
|
; SSE2-NEXT: LBB12_10: ## %else8
|
|
|
|
; SSE2-NEXT: pextrw $2, %xmm0, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB12_12
|
|
|
|
; SSE2-NEXT: ## %bb.11: ## %cond.store9
|
|
|
|
; SSE2-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; SSE2-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,1],xmm1[2,3]
|
|
|
|
; SSE2-NEXT: movss %xmm0, 20(%rdi)
|
|
|
|
; SSE2-NEXT: LBB12_12: ## %else10
|
|
|
|
; SSE2-NEXT: pxor %xmm0, %xmm0
|
|
|
|
; SSE2-NEXT: pcmpgtd %xmm5, %xmm0
|
|
|
|
; SSE2-NEXT: pextrw $4, %xmm0, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB12_14
|
|
|
|
; SSE2-NEXT: ## %bb.13: ## %cond.store11
|
|
|
|
; SSE2-NEXT: movaps %xmm1, %xmm2
|
|
|
|
; SSE2-NEXT: unpckhpd {{.*#+}} xmm2 = xmm2[1],xmm1[1]
|
|
|
|
; SSE2-NEXT: movss %xmm2, 24(%rdi)
|
|
|
|
; SSE2-NEXT: LBB12_14: ## %else12
|
|
|
|
; SSE2-NEXT: pextrw $6, %xmm0, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB12_16
|
|
|
|
; SSE2-NEXT: ## %bb.15: ## %cond.store13
|
|
|
|
; SSE2-NEXT: shufps {{.*#+}} xmm1 = xmm1[3,1,2,3]
|
|
|
|
; SSE2-NEXT: movss %xmm1, 28(%rdi)
|
|
|
|
; SSE2-NEXT: LBB12_16: ## %else14
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-NEXT: retq
|
|
|
|
;
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE4-LABEL: trunc_mask_v8f32_v8i32:
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE4: ## %bb.0:
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE4-NEXT: pxor %xmm2, %xmm2
|
|
|
|
; SSE4-NEXT: pcmpgtd %xmm4, %xmm2
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE4-NEXT: pextrb $0, %xmm2, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB12_2
|
|
|
|
; SSE4-NEXT: ## %bb.1: ## %cond.store
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE4-NEXT: movd %xmm0, (%rdi)
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE4-NEXT: LBB12_2: ## %else
|
|
|
|
; SSE4-NEXT: pextrb $4, %xmm2, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB12_4
|
|
|
|
; SSE4-NEXT: ## %bb.3: ## %cond.store1
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE4-NEXT: pextrd $1, %xmm0, 4(%rdi)
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE4-NEXT: LBB12_4: ## %else2
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE4-NEXT: pxor %xmm2, %xmm2
|
|
|
|
; SSE4-NEXT: pcmpgtd %xmm4, %xmm2
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE4-NEXT: pextrb $8, %xmm2, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB12_6
|
|
|
|
; SSE4-NEXT: ## %bb.5: ## %cond.store3
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE4-NEXT: pextrd $2, %xmm0, 8(%rdi)
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE4-NEXT: LBB12_6: ## %else4
|
|
|
|
; SSE4-NEXT: pextrb $12, %xmm2, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB12_8
|
|
|
|
; SSE4-NEXT: ## %bb.7: ## %cond.store5
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE4-NEXT: pextrd $3, %xmm0, 12(%rdi)
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE4-NEXT: LBB12_8: ## %else6
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE4-NEXT: pxor %xmm0, %xmm0
|
|
|
|
; SSE4-NEXT: pcmpgtd %xmm5, %xmm0
|
|
|
|
; SSE4-NEXT: pextrb $0, %xmm0, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB12_10
|
|
|
|
; SSE4-NEXT: ## %bb.9: ## %cond.store7
|
|
|
|
; SSE4-NEXT: movss %xmm1, 16(%rdi)
|
|
|
|
; SSE4-NEXT: LBB12_10: ## %else8
|
|
|
|
; SSE4-NEXT: pextrb $4, %xmm0, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB12_12
|
|
|
|
; SSE4-NEXT: ## %bb.11: ## %cond.store9
|
|
|
|
; SSE4-NEXT: extractps $1, %xmm1, 20(%rdi)
|
|
|
|
; SSE4-NEXT: LBB12_12: ## %else10
|
|
|
|
; SSE4-NEXT: pxor %xmm0, %xmm0
|
|
|
|
; SSE4-NEXT: pcmpgtd %xmm5, %xmm0
|
|
|
|
; SSE4-NEXT: pextrb $8, %xmm0, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB12_14
|
|
|
|
; SSE4-NEXT: ## %bb.13: ## %cond.store11
|
|
|
|
; SSE4-NEXT: extractps $2, %xmm1, 24(%rdi)
|
|
|
|
; SSE4-NEXT: LBB12_14: ## %else12
|
|
|
|
; SSE4-NEXT: pextrb $12, %xmm0, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB12_16
|
|
|
|
; SSE4-NEXT: ## %bb.15: ## %cond.store13
|
|
|
|
; SSE4-NEXT: extractps $3, %xmm1, 28(%rdi)
|
|
|
|
; SSE4-NEXT: LBB12_16: ## %else14
|
|
|
|
; SSE4-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX1OR2-LABEL: trunc_mask_v8f32_v8i32:
|
|
|
|
; AVX1OR2: ## %bb.0:
|
|
|
|
; AVX1OR2-NEXT: vmaskmovps %ymm0, %ymm2, (%rdi)
|
|
|
|
; AVX1OR2-NEXT: vzeroupper
|
|
|
|
; AVX1OR2-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-LABEL: trunc_mask_v8f32_v8i32:
|
|
|
|
; AVX512F: ## %bb.0:
|
|
|
|
; AVX512F-NEXT: ## kill: def $ymm2 killed $ymm2 def $zmm2
|
|
|
|
; AVX512F-NEXT: ## kill: def $ymm0 killed $ymm0 def $zmm0
|
|
|
|
; AVX512F-NEXT: vpxor %xmm1, %xmm1, %xmm1
|
|
|
|
; AVX512F-NEXT: vpcmpgtd %zmm2, %zmm1, %k0
|
|
|
|
; AVX512F-NEXT: kshiftlw $8, %k0, %k0
|
|
|
|
; AVX512F-NEXT: kshiftrw $8, %k0, %k1
|
|
|
|
; AVX512F-NEXT: vmovups %zmm0, (%rdi) {%k1}
|
|
|
|
; AVX512F-NEXT: vzeroupper
|
|
|
|
; AVX512F-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512VLBW-LABEL: trunc_mask_v8f32_v8i32:
|
|
|
|
; AVX512VLBW: ## %bb.0:
|
|
|
|
; AVX512VLBW-NEXT: vpxor %xmm1, %xmm1, %xmm1
|
|
|
|
; AVX512VLBW-NEXT: vpcmpgtd %ymm2, %ymm1, %k1
|
|
|
|
; AVX512VLBW-NEXT: vmovups %ymm0, (%rdi) {%k1}
|
|
|
|
; AVX512VLBW-NEXT: vzeroupper
|
|
|
|
; AVX512VLBW-NEXT: retq
|
|
|
|
%bool_mask = icmp slt <8 x i32> %mask, zeroinitializer
|
|
|
|
call void @llvm.masked.store.v8f32.p0v8f32(<8 x float> %x, <8 x float>* %ptr, i32 1, <8 x i1> %bool_mask)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @trunc_mask_v16f32_v16i32(<16 x float> %x, <16 x float>* %ptr, <16 x float> %y, <16 x i32> %mask) {
|
|
|
|
; SSE2-LABEL: trunc_mask_v16f32_v16i32:
|
|
|
|
; SSE2: ## %bb.0:
|
|
|
|
; SSE2-NEXT: movdqa {{[0-9]+}}(%rsp), %xmm4
|
|
|
|
; SSE2-NEXT: pxor %xmm5, %xmm5
|
|
|
|
; SSE2-NEXT: pcmpgtd %xmm4, %xmm5
|
|
|
|
; SSE2-NEXT: movd %xmm5, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB13_2
|
|
|
|
; SSE2-NEXT: ## %bb.1: ## %cond.store
|
|
|
|
; SSE2-NEXT: movss %xmm0, (%rdi)
|
|
|
|
; SSE2-NEXT: LBB13_2: ## %else
|
|
|
|
; SSE2-NEXT: pextrw $2, %xmm5, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB13_4
|
|
|
|
; SSE2-NEXT: ## %bb.3: ## %cond.store1
|
|
|
|
; SSE2-NEXT: movaps %xmm0, %xmm5
|
|
|
|
; SSE2-NEXT: shufps {{.*#+}} xmm5 = xmm5[1,1],xmm0[2,3]
|
|
|
|
; SSE2-NEXT: movss %xmm5, 4(%rdi)
|
|
|
|
; SSE2-NEXT: LBB13_4: ## %else2
|
|
|
|
; SSE2-NEXT: pxor %xmm5, %xmm5
|
|
|
|
; SSE2-NEXT: pcmpgtd %xmm4, %xmm5
|
|
|
|
; SSE2-NEXT: pextrw $4, %xmm5, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB13_6
|
|
|
|
; SSE2-NEXT: ## %bb.5: ## %cond.store3
|
|
|
|
; SSE2-NEXT: movaps %xmm0, %xmm4
|
|
|
|
; SSE2-NEXT: unpckhpd {{.*#+}} xmm4 = xmm4[1],xmm0[1]
|
|
|
|
; SSE2-NEXT: movss %xmm4, 8(%rdi)
|
|
|
|
; SSE2-NEXT: LBB13_6: ## %else4
|
|
|
|
; SSE2-NEXT: movdqa {{[0-9]+}}(%rsp), %xmm4
|
|
|
|
; SSE2-NEXT: pextrw $6, %xmm5, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB13_8
|
|
|
|
; SSE2-NEXT: ## %bb.7: ## %cond.store5
|
|
|
|
; SSE2-NEXT: shufps {{.*#+}} xmm0 = xmm0[3,1,2,3]
|
|
|
|
; SSE2-NEXT: movss %xmm0, 12(%rdi)
|
|
|
|
; SSE2-NEXT: LBB13_8: ## %else6
|
|
|
|
; SSE2-NEXT: xorps %xmm0, %xmm0
|
|
|
|
; SSE2-NEXT: pcmpgtd %xmm4, %xmm0
|
|
|
|
; SSE2-NEXT: movd %xmm0, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB13_10
|
|
|
|
; SSE2-NEXT: ## %bb.9: ## %cond.store7
|
|
|
|
; SSE2-NEXT: movss %xmm1, 16(%rdi)
|
|
|
|
; SSE2-NEXT: LBB13_10: ## %else8
|
|
|
|
; SSE2-NEXT: pextrw $2, %xmm0, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB13_12
|
|
|
|
; SSE2-NEXT: ## %bb.11: ## %cond.store9
|
|
|
|
; SSE2-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; SSE2-NEXT: shufps {{.*#+}} xmm0 = xmm0[1,1],xmm1[2,3]
|
|
|
|
; SSE2-NEXT: movss %xmm0, 20(%rdi)
|
|
|
|
; SSE2-NEXT: LBB13_12: ## %else10
|
|
|
|
; SSE2-NEXT: pxor %xmm5, %xmm5
|
|
|
|
; SSE2-NEXT: pcmpgtd %xmm4, %xmm5
|
|
|
|
; SSE2-NEXT: pextrw $4, %xmm5, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB13_14
|
|
|
|
; SSE2-NEXT: ## %bb.13: ## %cond.store11
|
|
|
|
; SSE2-NEXT: movaps %xmm1, %xmm0
|
|
|
|
; SSE2-NEXT: unpckhpd {{.*#+}} xmm0 = xmm0[1],xmm1[1]
|
|
|
|
; SSE2-NEXT: movss %xmm0, 24(%rdi)
|
|
|
|
; SSE2-NEXT: LBB13_14: ## %else12
|
|
|
|
; SSE2-NEXT: movdqa {{[0-9]+}}(%rsp), %xmm0
|
|
|
|
; SSE2-NEXT: pextrw $6, %xmm5, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB13_16
|
|
|
|
; SSE2-NEXT: ## %bb.15: ## %cond.store13
|
|
|
|
; SSE2-NEXT: shufps {{.*#+}} xmm1 = xmm1[3,1,2,3]
|
|
|
|
; SSE2-NEXT: movss %xmm1, 28(%rdi)
|
|
|
|
; SSE2-NEXT: LBB13_16: ## %else14
|
|
|
|
; SSE2-NEXT: xorps %xmm1, %xmm1
|
|
|
|
; SSE2-NEXT: pcmpgtd %xmm0, %xmm1
|
|
|
|
; SSE2-NEXT: movd %xmm1, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB13_18
|
|
|
|
; SSE2-NEXT: ## %bb.17: ## %cond.store15
|
|
|
|
; SSE2-NEXT: movss %xmm2, 32(%rdi)
|
|
|
|
; SSE2-NEXT: LBB13_18: ## %else16
|
|
|
|
; SSE2-NEXT: pextrw $2, %xmm1, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB13_20
|
|
|
|
; SSE2-NEXT: ## %bb.19: ## %cond.store17
|
|
|
|
; SSE2-NEXT: movaps %xmm2, %xmm1
|
|
|
|
; SSE2-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,1],xmm2[2,3]
|
|
|
|
; SSE2-NEXT: movss %xmm1, 36(%rdi)
|
|
|
|
; SSE2-NEXT: LBB13_20: ## %else18
|
|
|
|
; SSE2-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; SSE2-NEXT: pcmpgtd %xmm0, %xmm1
|
|
|
|
; SSE2-NEXT: pextrw $4, %xmm1, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB13_22
|
|
|
|
; SSE2-NEXT: ## %bb.21: ## %cond.store19
|
|
|
|
; SSE2-NEXT: movaps %xmm2, %xmm0
|
|
|
|
; SSE2-NEXT: unpckhpd {{.*#+}} xmm0 = xmm0[1],xmm2[1]
|
|
|
|
; SSE2-NEXT: movss %xmm0, 40(%rdi)
|
|
|
|
; SSE2-NEXT: LBB13_22: ## %else20
|
|
|
|
; SSE2-NEXT: movdqa {{[0-9]+}}(%rsp), %xmm0
|
|
|
|
; SSE2-NEXT: pextrw $6, %xmm1, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB13_24
|
|
|
|
; SSE2-NEXT: ## %bb.23: ## %cond.store21
|
|
|
|
; SSE2-NEXT: shufps {{.*#+}} xmm2 = xmm2[3,1,2,3]
|
|
|
|
; SSE2-NEXT: movss %xmm2, 44(%rdi)
|
|
|
|
; SSE2-NEXT: LBB13_24: ## %else22
|
|
|
|
; SSE2-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; SSE2-NEXT: pcmpgtd %xmm0, %xmm1
|
|
|
|
; SSE2-NEXT: movd %xmm1, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB13_26
|
|
|
|
; SSE2-NEXT: ## %bb.25: ## %cond.store23
|
|
|
|
; SSE2-NEXT: movss %xmm3, 48(%rdi)
|
|
|
|
; SSE2-NEXT: LBB13_26: ## %else24
|
|
|
|
; SSE2-NEXT: pextrw $2, %xmm1, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB13_28
|
|
|
|
; SSE2-NEXT: ## %bb.27: ## %cond.store25
|
|
|
|
; SSE2-NEXT: movaps %xmm3, %xmm1
|
|
|
|
; SSE2-NEXT: shufps {{.*#+}} xmm1 = xmm1[1,1],xmm3[2,3]
|
|
|
|
; SSE2-NEXT: movss %xmm1, 52(%rdi)
|
|
|
|
; SSE2-NEXT: LBB13_28: ## %else26
|
|
|
|
; SSE2-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; SSE2-NEXT: pcmpgtd %xmm0, %xmm1
|
|
|
|
; SSE2-NEXT: pextrw $4, %xmm1, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB13_30
|
|
|
|
; SSE2-NEXT: ## %bb.29: ## %cond.store27
|
|
|
|
; SSE2-NEXT: movaps %xmm3, %xmm0
|
|
|
|
; SSE2-NEXT: unpckhpd {{.*#+}} xmm0 = xmm0[1],xmm3[1]
|
|
|
|
; SSE2-NEXT: movss %xmm0, 56(%rdi)
|
|
|
|
; SSE2-NEXT: LBB13_30: ## %else28
|
|
|
|
; SSE2-NEXT: pextrw $6, %xmm1, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB13_32
|
|
|
|
; SSE2-NEXT: ## %bb.31: ## %cond.store29
|
|
|
|
; SSE2-NEXT: shufps {{.*#+}} xmm3 = xmm3[3,1,2,3]
|
|
|
|
; SSE2-NEXT: movss %xmm3, 60(%rdi)
|
|
|
|
; SSE2-NEXT: LBB13_32: ## %else30
|
|
|
|
; SSE2-NEXT: retq
|
|
|
|
;
|
|
|
|
; SSE4-LABEL: trunc_mask_v16f32_v16i32:
|
|
|
|
; SSE4: ## %bb.0:
|
|
|
|
; SSE4-NEXT: movdqa {{[0-9]+}}(%rsp), %xmm4
|
|
|
|
; SSE4-NEXT: pxor %xmm5, %xmm5
|
|
|
|
; SSE4-NEXT: pcmpgtd %xmm4, %xmm5
|
|
|
|
; SSE4-NEXT: pextrb $0, %xmm5, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB13_2
|
|
|
|
; SSE4-NEXT: ## %bb.1: ## %cond.store
|
|
|
|
; SSE4-NEXT: movd %xmm0, (%rdi)
|
|
|
|
; SSE4-NEXT: LBB13_2: ## %else
|
|
|
|
; SSE4-NEXT: pextrb $4, %xmm5, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB13_4
|
|
|
|
; SSE4-NEXT: ## %bb.3: ## %cond.store1
|
|
|
|
; SSE4-NEXT: pextrd $1, %xmm0, 4(%rdi)
|
|
|
|
; SSE4-NEXT: LBB13_4: ## %else2
|
|
|
|
; SSE4-NEXT: pxor %xmm5, %xmm5
|
|
|
|
; SSE4-NEXT: pcmpgtd %xmm4, %xmm5
|
|
|
|
; SSE4-NEXT: pextrb $8, %xmm5, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB13_6
|
|
|
|
; SSE4-NEXT: ## %bb.5: ## %cond.store3
|
|
|
|
; SSE4-NEXT: pextrd $2, %xmm0, 8(%rdi)
|
|
|
|
; SSE4-NEXT: LBB13_6: ## %else4
|
|
|
|
; SSE4-NEXT: movdqa {{[0-9]+}}(%rsp), %xmm4
|
|
|
|
; SSE4-NEXT: pextrb $12, %xmm5, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB13_8
|
|
|
|
; SSE4-NEXT: ## %bb.7: ## %cond.store5
|
|
|
|
; SSE4-NEXT: pextrd $3, %xmm0, 12(%rdi)
|
|
|
|
; SSE4-NEXT: LBB13_8: ## %else6
|
|
|
|
; SSE4-NEXT: pxor %xmm0, %xmm0
|
|
|
|
; SSE4-NEXT: pcmpgtd %xmm4, %xmm0
|
|
|
|
; SSE4-NEXT: pextrb $0, %xmm0, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB13_10
|
|
|
|
; SSE4-NEXT: ## %bb.9: ## %cond.store7
|
|
|
|
; SSE4-NEXT: movd %xmm1, 16(%rdi)
|
|
|
|
; SSE4-NEXT: LBB13_10: ## %else8
|
|
|
|
; SSE4-NEXT: pextrb $4, %xmm0, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB13_12
|
|
|
|
; SSE4-NEXT: ## %bb.11: ## %cond.store9
|
|
|
|
; SSE4-NEXT: pextrd $1, %xmm1, 20(%rdi)
|
|
|
|
; SSE4-NEXT: LBB13_12: ## %else10
|
|
|
|
; SSE4-NEXT: pxor %xmm5, %xmm5
|
|
|
|
; SSE4-NEXT: pcmpgtd %xmm4, %xmm5
|
|
|
|
; SSE4-NEXT: pextrb $8, %xmm5, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB13_14
|
|
|
|
; SSE4-NEXT: ## %bb.13: ## %cond.store11
|
|
|
|
; SSE4-NEXT: pextrd $2, %xmm1, 24(%rdi)
|
|
|
|
; SSE4-NEXT: LBB13_14: ## %else12
|
|
|
|
; SSE4-NEXT: movdqa {{[0-9]+}}(%rsp), %xmm0
|
|
|
|
; SSE4-NEXT: pextrb $12, %xmm5, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB13_16
|
|
|
|
; SSE4-NEXT: ## %bb.15: ## %cond.store13
|
|
|
|
; SSE4-NEXT: pextrd $3, %xmm1, 28(%rdi)
|
|
|
|
; SSE4-NEXT: LBB13_16: ## %else14
|
|
|
|
; SSE4-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; SSE4-NEXT: pcmpgtd %xmm0, %xmm1
|
|
|
|
; SSE4-NEXT: pextrb $0, %xmm1, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB13_18
|
|
|
|
; SSE4-NEXT: ## %bb.17: ## %cond.store15
|
|
|
|
; SSE4-NEXT: movss %xmm2, 32(%rdi)
|
|
|
|
; SSE4-NEXT: LBB13_18: ## %else16
|
|
|
|
; SSE4-NEXT: pextrb $4, %xmm1, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB13_20
|
|
|
|
; SSE4-NEXT: ## %bb.19: ## %cond.store17
|
|
|
|
; SSE4-NEXT: extractps $1, %xmm2, 36(%rdi)
|
|
|
|
; SSE4-NEXT: LBB13_20: ## %else18
|
|
|
|
; SSE4-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; SSE4-NEXT: pcmpgtd %xmm0, %xmm1
|
|
|
|
; SSE4-NEXT: pextrb $8, %xmm1, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB13_22
|
|
|
|
; SSE4-NEXT: ## %bb.21: ## %cond.store19
|
|
|
|
; SSE4-NEXT: extractps $2, %xmm2, 40(%rdi)
|
|
|
|
; SSE4-NEXT: LBB13_22: ## %else20
|
|
|
|
; SSE4-NEXT: movdqa {{[0-9]+}}(%rsp), %xmm0
|
|
|
|
; SSE4-NEXT: pextrb $12, %xmm1, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB13_24
|
|
|
|
; SSE4-NEXT: ## %bb.23: ## %cond.store21
|
|
|
|
; SSE4-NEXT: extractps $3, %xmm2, 44(%rdi)
|
|
|
|
; SSE4-NEXT: LBB13_24: ## %else22
|
|
|
|
; SSE4-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; SSE4-NEXT: pcmpgtd %xmm0, %xmm1
|
|
|
|
; SSE4-NEXT: pextrb $0, %xmm1, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB13_26
|
|
|
|
; SSE4-NEXT: ## %bb.25: ## %cond.store23
|
|
|
|
; SSE4-NEXT: movss %xmm3, 48(%rdi)
|
|
|
|
; SSE4-NEXT: LBB13_26: ## %else24
|
|
|
|
; SSE4-NEXT: pextrb $4, %xmm1, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB13_28
|
|
|
|
; SSE4-NEXT: ## %bb.27: ## %cond.store25
|
|
|
|
; SSE4-NEXT: extractps $1, %xmm3, 52(%rdi)
|
|
|
|
; SSE4-NEXT: LBB13_28: ## %else26
|
|
|
|
; SSE4-NEXT: pxor %xmm1, %xmm1
|
|
|
|
; SSE4-NEXT: pcmpgtd %xmm0, %xmm1
|
|
|
|
; SSE4-NEXT: pextrb $8, %xmm1, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB13_30
|
|
|
|
; SSE4-NEXT: ## %bb.29: ## %cond.store27
|
|
|
|
; SSE4-NEXT: extractps $2, %xmm3, 56(%rdi)
|
|
|
|
; SSE4-NEXT: LBB13_30: ## %else28
|
|
|
|
; SSE4-NEXT: pextrb $12, %xmm1, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB13_32
|
|
|
|
; SSE4-NEXT: ## %bb.31: ## %cond.store29
|
|
|
|
; SSE4-NEXT: extractps $3, %xmm3, 60(%rdi)
|
|
|
|
; SSE4-NEXT: LBB13_32: ## %else30
|
|
|
|
; SSE4-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX1OR2-LABEL: trunc_mask_v16f32_v16i32:
|
|
|
|
; AVX1OR2: ## %bb.0:
|
|
|
|
; AVX1OR2-NEXT: vmaskmovps %ymm1, %ymm5, 32(%rdi)
|
|
|
|
; AVX1OR2-NEXT: vmaskmovps %ymm0, %ymm4, (%rdi)
|
|
|
|
; AVX1OR2-NEXT: vzeroupper
|
|
|
|
; AVX1OR2-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512-LABEL: trunc_mask_v16f32_v16i32:
|
|
|
|
; AVX512: ## %bb.0:
|
|
|
|
; AVX512-NEXT: vpxor %xmm1, %xmm1, %xmm1
|
|
|
|
; AVX512-NEXT: vpcmpgtd %zmm2, %zmm1, %k1
|
|
|
|
; AVX512-NEXT: vmovups %zmm0, (%rdi) {%k1}
|
|
|
|
; AVX512-NEXT: vzeroupper
|
|
|
|
; AVX512-NEXT: retq
|
|
|
|
%bool_mask = icmp slt <16 x i32> %mask, zeroinitializer
|
|
|
|
call void @llvm.masked.store.v16f32.p0v16f32(<16 x float> %x, <16 x float>* %ptr, i32 1, <16 x i1> %bool_mask)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; SimplifyDemandedBits eliminates an ashr here.
|
|
|
|
|
|
|
|
define void @masked_store_bool_mask_demand_trunc_sext(<4 x double> %x, <4 x double>* %p, <4 x i32> %masksrc) {
|
|
|
|
; SSE2-LABEL: masked_store_bool_mask_demand_trunc_sext:
|
|
|
|
; SSE2: ## %bb.0:
|
|
|
|
; SSE2-NEXT: movd %xmm2, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB14_2
|
|
|
|
; SSE2-NEXT: ## %bb.1: ## %cond.store
|
|
|
|
; SSE2-NEXT: movlpd %xmm0, (%rdi)
|
|
|
|
; SSE2-NEXT: LBB14_2: ## %else
|
|
|
|
; SSE2-NEXT: pextrw $2, %xmm2, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB14_4
|
|
|
|
; SSE2-NEXT: ## %bb.3: ## %cond.store1
|
|
|
|
; SSE2-NEXT: movhpd %xmm0, 8(%rdi)
|
|
|
|
; SSE2-NEXT: LBB14_4: ## %else2
|
|
|
|
; SSE2-NEXT: pextrw $4, %xmm2, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB14_6
|
|
|
|
; SSE2-NEXT: ## %bb.5: ## %cond.store3
|
|
|
|
; SSE2-NEXT: movlpd %xmm1, 16(%rdi)
|
|
|
|
; SSE2-NEXT: LBB14_6: ## %else4
|
|
|
|
; SSE2-NEXT: pextrw $6, %xmm2, %eax
|
|
|
|
; SSE2-NEXT: testb $1, %al
|
|
|
|
; SSE2-NEXT: je LBB14_8
|
|
|
|
; SSE2-NEXT: ## %bb.7: ## %cond.store5
|
|
|
|
; SSE2-NEXT: movhpd %xmm1, 24(%rdi)
|
|
|
|
; SSE2-NEXT: LBB14_8: ## %else6
|
|
|
|
; SSE2-NEXT: retq
|
|
|
|
;
|
|
|
|
; SSE4-LABEL: masked_store_bool_mask_demand_trunc_sext:
|
|
|
|
; SSE4: ## %bb.0:
|
|
|
|
; SSE4-NEXT: pextrb $0, %xmm2, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB14_2
|
|
|
|
; SSE4-NEXT: ## %bb.1: ## %cond.store
|
|
|
|
; SSE4-NEXT: movlpd %xmm0, (%rdi)
|
|
|
|
; SSE4-NEXT: LBB14_2: ## %else
|
|
|
|
; SSE4-NEXT: pextrb $4, %xmm2, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB14_4
|
|
|
|
; SSE4-NEXT: ## %bb.3: ## %cond.store1
|
|
|
|
; SSE4-NEXT: movhpd %xmm0, 8(%rdi)
|
|
|
|
; SSE4-NEXT: LBB14_4: ## %else2
|
|
|
|
; SSE4-NEXT: pextrb $8, %xmm2, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB14_6
|
|
|
|
; SSE4-NEXT: ## %bb.5: ## %cond.store3
|
|
|
|
; SSE4-NEXT: movlpd %xmm1, 16(%rdi)
|
|
|
|
; SSE4-NEXT: LBB14_6: ## %else4
|
|
|
|
; SSE4-NEXT: pextrb $12, %xmm2, %eax
|
|
|
|
; SSE4-NEXT: testb $1, %al
|
|
|
|
; SSE4-NEXT: je LBB14_8
|
|
|
|
; SSE4-NEXT: ## %bb.7: ## %cond.store5
|
|
|
|
; SSE4-NEXT: movhpd %xmm1, 24(%rdi)
|
|
|
|
; SSE4-NEXT: LBB14_8: ## %else6
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE4-NEXT: retq
|
|
|
|
;
|
2018-11-15 04:44:59 +08:00
|
|
|
; AVX1-LABEL: masked_store_bool_mask_demand_trunc_sext:
|
|
|
|
; AVX1: ## %bb.0:
|
|
|
|
; AVX1-NEXT: vpslld $31, %xmm1, %xmm1
|
|
|
|
; AVX1-NEXT: vpmovsxdq %xmm1, %xmm2
|
|
|
|
; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
|
|
|
|
; AVX1-NEXT: vpmovsxdq %xmm1, %xmm1
|
|
|
|
; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1
|
|
|
|
; AVX1-NEXT: vmaskmovpd %ymm0, %ymm1, (%rdi)
|
|
|
|
; AVX1-NEXT: vzeroupper
|
|
|
|
; AVX1-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX2-LABEL: masked_store_bool_mask_demand_trunc_sext:
|
|
|
|
; AVX2: ## %bb.0:
|
|
|
|
; AVX2-NEXT: vpslld $31, %xmm1, %xmm1
|
|
|
|
; AVX2-NEXT: vpmovsxdq %xmm1, %ymm1
|
|
|
|
; AVX2-NEXT: vmaskmovpd %ymm0, %ymm1, (%rdi)
|
|
|
|
; AVX2-NEXT: vzeroupper
|
|
|
|
; AVX2-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-LABEL: masked_store_bool_mask_demand_trunc_sext:
|
|
|
|
; AVX512F: ## %bb.0:
|
|
|
|
; AVX512F-NEXT: ## kill: def $ymm0 killed $ymm0 def $zmm0
|
|
|
|
; AVX512F-NEXT: vpslld $31, %xmm1, %xmm1
|
|
|
|
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
|
|
|
|
; AVX512F-NEXT: kshiftlw $12, %k0, %k0
|
|
|
|
; AVX512F-NEXT: kshiftrw $12, %k0, %k1
|
|
|
|
; AVX512F-NEXT: vmovupd %zmm0, (%rdi) {%k1}
|
|
|
|
; AVX512F-NEXT: vzeroupper
|
|
|
|
; AVX512F-NEXT: retq
|
|
|
|
;
|
2018-11-15 05:31:50 +08:00
|
|
|
; AVX512VLBW-LABEL: masked_store_bool_mask_demand_trunc_sext:
|
|
|
|
; AVX512VLBW: ## %bb.0:
|
|
|
|
; AVX512VLBW-NEXT: vpslld $31, %xmm1, %xmm1
|
|
|
|
; AVX512VLBW-NEXT: vptestmd %xmm1, %xmm1, %k1
|
|
|
|
; AVX512VLBW-NEXT: vmovupd %ymm0, (%rdi) {%k1}
|
|
|
|
; AVX512VLBW-NEXT: vzeroupper
|
|
|
|
; AVX512VLBW-NEXT: retq
|
2018-11-15 04:44:59 +08:00
|
|
|
%sext = sext <4 x i32> %masksrc to <4 x i64>
|
|
|
|
%boolmask = trunc <4 x i64> %sext to <4 x i1>
|
|
|
|
call void @llvm.masked.store.v4f64.p0v4f64(<4 x double> %x, <4 x double>* %p, i32 4, <4 x i1> %boolmask)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; This needs to be widened to v4i32.
|
|
|
|
; This used to assert in type legalization. PR38436
|
|
|
|
; FIXME: The codegen for AVX512 should use KSHIFT to zero the upper bits of the mask.
|
|
|
|
define void @widen_masked_store(<3 x i32> %v, <3 x i32>* %p, <3 x i1> %mask) {
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-LABEL: widen_masked_store:
|
|
|
|
; SSE2: ## %bb.0:
|
|
|
|
; SSE2-NEXT: testb $1, %sil
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE2-NEXT: jne LBB15_1
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-NEXT: ## %bb.2: ## %else
|
|
|
|
; SSE2-NEXT: testb $1, %dl
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE2-NEXT: jne LBB15_3
|
|
|
|
; SSE2-NEXT: LBB15_4: ## %else2
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-NEXT: testb $1, %cl
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE2-NEXT: jne LBB15_5
|
|
|
|
; SSE2-NEXT: LBB15_6: ## %else4
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-NEXT: retq
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE2-NEXT: LBB15_1: ## %cond.store
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-NEXT: movd %xmm0, (%rdi)
|
|
|
|
; SSE2-NEXT: testb $1, %dl
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE2-NEXT: je LBB15_4
|
|
|
|
; SSE2-NEXT: LBB15_3: ## %cond.store1
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
|
|
|
|
; SSE2-NEXT: movd %xmm1, 4(%rdi)
|
|
|
|
; SSE2-NEXT: testb $1, %cl
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE2-NEXT: je LBB15_6
|
|
|
|
; SSE2-NEXT: LBB15_5: ## %cond.store3
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
|
|
|
|
; SSE2-NEXT: movd %xmm0, 8(%rdi)
|
|
|
|
; SSE2-NEXT: retq
|
|
|
|
;
|
|
|
|
; SSE4-LABEL: widen_masked_store:
|
|
|
|
; SSE4: ## %bb.0:
|
|
|
|
; SSE4-NEXT: testb $1, %sil
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE4-NEXT: jne LBB15_1
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE4-NEXT: ## %bb.2: ## %else
|
|
|
|
; SSE4-NEXT: testb $1, %dl
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE4-NEXT: jne LBB15_3
|
|
|
|
; SSE4-NEXT: LBB15_4: ## %else2
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE4-NEXT: testb $1, %cl
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE4-NEXT: jne LBB15_5
|
|
|
|
; SSE4-NEXT: LBB15_6: ## %else4
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE4-NEXT: retq
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE4-NEXT: LBB15_1: ## %cond.store
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE4-NEXT: movss %xmm0, (%rdi)
|
|
|
|
; SSE4-NEXT: testb $1, %dl
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE4-NEXT: je LBB15_4
|
|
|
|
; SSE4-NEXT: LBB15_3: ## %cond.store1
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE4-NEXT: extractps $1, %xmm0, 4(%rdi)
|
|
|
|
; SSE4-NEXT: testb $1, %cl
|
2019-04-05 19:34:30 +08:00
|
|
|
; SSE4-NEXT: je LBB15_6
|
|
|
|
; SSE4-NEXT: LBB15_5: ## %cond.store3
|
2018-11-15 05:31:50 +08:00
|
|
|
; SSE4-NEXT: extractps $2, %xmm0, 8(%rdi)
|
|
|
|
; SSE4-NEXT: retq
|
|
|
|
;
|
2018-11-15 04:44:59 +08:00
|
|
|
; AVX1-LABEL: widen_masked_store:
|
|
|
|
; AVX1: ## %bb.0:
|
|
|
|
; AVX1-NEXT: vmovd %edx, %xmm1
|
|
|
|
; AVX1-NEXT: vmovd %esi, %xmm2
|
|
|
|
; AVX1-NEXT: vpunpckldq {{.*#+}} xmm1 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
|
|
|
|
; AVX1-NEXT: vmovd %ecx, %xmm2
|
|
|
|
; AVX1-NEXT: vpunpcklqdq {{.*#+}} xmm1 = xmm1[0],xmm2[0]
|
|
|
|
; AVX1-NEXT: vpslld $31, %xmm1, %xmm1
|
|
|
|
; AVX1-NEXT: vmaskmovps %xmm0, %xmm1, (%rdi)
|
|
|
|
; AVX1-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX2-LABEL: widen_masked_store:
|
|
|
|
; AVX2: ## %bb.0:
|
|
|
|
; AVX2-NEXT: vmovd %edx, %xmm1
|
|
|
|
; AVX2-NEXT: vmovd %esi, %xmm2
|
|
|
|
; AVX2-NEXT: vpunpckldq {{.*#+}} xmm1 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
|
|
|
|
; AVX2-NEXT: vmovd %ecx, %xmm2
|
|
|
|
; AVX2-NEXT: vpunpcklqdq {{.*#+}} xmm1 = xmm1[0],xmm2[0]
|
|
|
|
; AVX2-NEXT: vpslld $31, %xmm1, %xmm1
|
|
|
|
; AVX2-NEXT: vpmaskmovd %xmm0, %xmm1, (%rdi)
|
|
|
|
; AVX2-NEXT: retq
|
|
|
|
;
|
|
|
|
; AVX512F-LABEL: widen_masked_store:
|
|
|
|
; AVX512F: ## %bb.0:
|
|
|
|
; AVX512F-NEXT: ## kill: def $xmm0 killed $xmm0 def $zmm0
|
|
|
|
; AVX512F-NEXT: vpslld $31, %xmm1, %xmm1
|
|
|
|
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k1
|
|
|
|
; AVX512F-NEXT: vpternlogd $255, %zmm1, %zmm1, %zmm1 {%k1} {z}
|
|
|
|
; AVX512F-NEXT: vpxor %xmm2, %xmm2, %xmm2
|
|
|
|
; AVX512F-NEXT: vpblendd {{.*#+}} xmm1 = xmm1[0,1,2],xmm2[3]
|
|
|
|
; AVX512F-NEXT: vptestmd %zmm1, %zmm1, %k0
|
|
|
|
; AVX512F-NEXT: kshiftlw $12, %k0, %k0
|
|
|
|
; AVX512F-NEXT: kshiftrw $12, %k0, %k1
|
|
|
|
; AVX512F-NEXT: vmovdqu32 %zmm0, (%rdi) {%k1}
|
|
|
|
; AVX512F-NEXT: vzeroupper
|
|
|
|
; AVX512F-NEXT: retq
|
|
|
|
;
|
2018-11-15 05:31:50 +08:00
|
|
|
; AVX512VLBW-LABEL: widen_masked_store:
|
|
|
|
; AVX512VLBW: ## %bb.0:
|
|
|
|
; AVX512VLBW-NEXT: vpslld $31, %xmm1, %xmm1
|
|
|
|
; AVX512VLBW-NEXT: vptestmd %xmm1, %xmm1, %k1
|
|
|
|
; AVX512VLBW-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
|
|
|
|
; AVX512VLBW-NEXT: vmovdqa32 %xmm1, %xmm1 {%k1} {z}
|
|
|
|
; AVX512VLBW-NEXT: vpxor %xmm2, %xmm2, %xmm2
|
|
|
|
; AVX512VLBW-NEXT: vpblendd {{.*#+}} xmm1 = xmm1[0,1,2],xmm2[3]
|
|
|
|
; AVX512VLBW-NEXT: vptestmd %xmm1, %xmm1, %k1
|
|
|
|
; AVX512VLBW-NEXT: vmovdqa32 %xmm0, (%rdi) {%k1}
|
|
|
|
; AVX512VLBW-NEXT: retq
|
2018-11-15 04:44:59 +08:00
|
|
|
call void @llvm.masked.store.v3i32(<3 x i32> %v, <3 x i32>* %p, i32 16, <3 x i1> %mask)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
declare void @llvm.masked.store.v3i32(<3 x i32>, <3 x i32>*, i32, <3 x i1>)
|
|
|
|
|
|
|
|
declare void @llvm.masked.store.v8i32.p0v8i32(<8 x i32>, <8 x i32>*, i32, <8 x i1>)
|
|
|
|
declare void @llvm.masked.store.v4i32.p0v4i32(<4 x i32>, <4 x i32>*, i32, <4 x i1>)
|
|
|
|
declare void @llvm.masked.store.v4i64.p0v4i64(<4 x i64>, <4 x i64>*, i32, <4 x i1>)
|
|
|
|
declare void @llvm.masked.store.v2f32.p0v2f32(<2 x float>, <2 x float>*, i32, <2 x i1>)
|
|
|
|
declare void @llvm.masked.store.v2i32.p0v2i32(<2 x i32>, <2 x i32>*, i32, <2 x i1>)
|
2018-11-15 05:31:50 +08:00
|
|
|
declare void @llvm.masked.store.v1i32.p0v1i32(<1 x i32>, <1 x i32>*, i32, <1 x i1>)
|
2018-11-15 04:44:59 +08:00
|
|
|
declare void @llvm.masked.store.v4f32.p0v4f32(<4 x float>, <4 x float>*, i32, <4 x i1>)
|
2019-04-05 19:34:30 +08:00
|
|
|
declare void @llvm.masked.store.v8f32.p0v8f32(<8 x float>, <8 x float>*, i32, <8 x i1>)
|
|
|
|
declare void @llvm.masked.store.v16f32.p0v16f32(<16 x float>, <16 x float>*, i32, <16 x i1>)
|
2018-11-15 04:44:59 +08:00
|
|
|
declare void @llvm.masked.store.v8f64.p0v8f64(<8 x double>, <8 x double>*, i32, <8 x i1>)
|
|
|
|
declare void @llvm.masked.store.v4f64.p0v4f64(<4 x double>, <4 x double>*, i32, <4 x i1>)
|
|
|
|
declare void @llvm.masked.store.v2f64.p0v2f64(<2 x double>, <2 x double>*, i32, <2 x i1>)
|
|
|
|
declare void @llvm.masked.store.v2i64.p0v2i64(<2 x i64>, <2 x i64>*, i32, <2 x i1>)
|
|
|
|
|