2017-06-13 01:31:36 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2016-10-11 06:01:42 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=sse4.1 | FileCheck %s
|
2013-11-23 01:56:57 +08:00
|
|
|
|
|
|
|
; Ensure PSRAD is generated as the condition is consumed by both PADD and
|
2020-05-24 23:07:46 +08:00
|
|
|
; BLENDVPS. PADD requires all bits setting properly.
|
2013-11-23 01:56:57 +08:00
|
|
|
|
|
|
|
define <4 x i32> @foo(<4 x i32>* %p, <4 x i1> %cond, <4 x i32> %v1, <4 x i32> %v2, <4 x i32> %v3) {
|
2016-10-11 06:01:42 +08:00
|
|
|
; CHECK-LABEL: foo:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0:
|
2016-10-11 06:01:42 +08:00
|
|
|
; CHECK-NEXT: pslld $31, %xmm0
|
2020-05-24 23:07:46 +08:00
|
|
|
; CHECK-NEXT: movdqa %xmm0, %xmm3
|
|
|
|
; CHECK-NEXT: psrad $31, %xmm3
|
|
|
|
; CHECK-NEXT: paddd %xmm1, %xmm3
|
2017-02-06 02:33:24 +08:00
|
|
|
; CHECK-NEXT: blendvps %xmm0, %xmm1, %xmm2
|
2016-10-11 06:01:42 +08:00
|
|
|
; CHECK-NEXT: movaps %xmm2, (%rdi)
|
2020-05-24 23:07:46 +08:00
|
|
|
; CHECK-NEXT: movdqa %xmm3, %xmm0
|
2016-10-11 06:01:42 +08:00
|
|
|
; CHECK-NEXT: retq
|
2013-11-23 01:56:57 +08:00
|
|
|
%sext_cond = sext <4 x i1> %cond to <4 x i32>
|
|
|
|
%t1 = add <4 x i32> %v1, %sext_cond
|
|
|
|
%t2 = select <4 x i1> %cond, <4 x i32> %v1, <4 x i32> %v2
|
|
|
|
store <4 x i32> %t2, <4 x i32>* %p
|
|
|
|
ret <4 x i32> %t1
|
|
|
|
}
|
2016-10-11 06:01:42 +08:00
|
|
|
|