2012-10-24 05:40:15 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-linux-pc -mcpu=corei7 | FileCheck %s
|
|
|
|
|
|
|
|
declare <4 x i32> @llvm.x86.sse41.pminud(<4 x i32>, <4 x i32>)
|
|
|
|
|
|
|
|
define <2 x i16> @good(<4 x i32>*, <4 x i8>*) {
|
2014-10-03 09:06:32 +08:00
|
|
|
; CHECK-LABEL: good:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
2014-10-03 09:06:32 +08:00
|
|
|
; CHECK-NEXT: movdqa (%rdi), %xmm0
|
|
|
|
; CHECK-NEXT: pminud {{.*}}(%rip), %xmm0
|
|
|
|
; CHECK-NEXT: pmovzxwq %xmm0, %xmm0
|
|
|
|
; CHECK-NEXT: retq
|
2012-10-24 05:40:15 +08:00
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%2 = load <4 x i32>, <4 x i32>* %0, align 16
|
2012-10-24 05:40:15 +08:00
|
|
|
%3 = call <4 x i32> @llvm.x86.sse41.pminud(<4 x i32> %2, <4 x i32> <i32 127, i32 127, i32 127, i32 127>)
|
|
|
|
%4 = extractelement <4 x i32> %3, i32 0
|
|
|
|
%5 = extractelement <4 x i32> %3, i32 1
|
|
|
|
%6 = extractelement <4 x i32> %3, i32 2
|
|
|
|
%7 = extractelement <4 x i32> %3, i32 3
|
|
|
|
%8 = bitcast i32 %4 to <2 x i16>
|
|
|
|
%9 = bitcast i32 %5 to <2 x i16>
|
|
|
|
ret <2 x i16> %8
|
|
|
|
}
|
|
|
|
|
|
|
|
define <2 x i16> @bad(<4 x i32>*, <4 x i8>*) {
|
2014-10-03 09:06:32 +08:00
|
|
|
; CHECK-LABEL: bad:
|
2017-12-05 01:18:51 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
2014-10-03 09:06:32 +08:00
|
|
|
; CHECK-NEXT: movdqa (%rdi), %xmm0
|
|
|
|
; CHECK-NEXT: pminud {{.*}}(%rip), %xmm0
|
2015-03-07 13:52:42 +08:00
|
|
|
; CHECK-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
|
|
|
|
; CHECK-NEXT: pmovzxwq {{.*#+}} xmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero
|
2014-10-03 09:06:32 +08:00
|
|
|
; CHECK-NEXT: retq
|
2012-10-24 05:40:15 +08:00
|
|
|
entry:
|
2015-02-28 05:17:42 +08:00
|
|
|
%2 = load <4 x i32>, <4 x i32>* %0, align 16
|
2012-10-24 05:40:15 +08:00
|
|
|
%3 = call <4 x i32> @llvm.x86.sse41.pminud(<4 x i32> %2, <4 x i32> <i32 127, i32 127, i32 127, i32 127>)
|
|
|
|
%4 = extractelement <4 x i32> %3, i32 0
|
|
|
|
%5 = extractelement <4 x i32> %3, i32 1
|
|
|
|
%6 = extractelement <4 x i32> %3, i32 2
|
|
|
|
%7 = extractelement <4 x i32> %3, i32 3
|
|
|
|
%8 = bitcast i32 %4 to <2 x i16>
|
|
|
|
%9 = bitcast i32 %5 to <2 x i16>
|
|
|
|
ret <2 x i16> %9
|
|
|
|
}
|