Home | History | Annotate | Download | only in X86
      1 ; RUN: llc < %s -mtriple=x86_64-linux-pc -mcpu=corei7 | FileCheck %s
      2 
      3 declare <4 x i32> @llvm.x86.sse41.pminud(<4 x i32>, <4 x i32>)
      4 
      5 define <2 x i16> @good(<4 x i32>*, <4 x i8>*) {
      6 entry:
      7   %2 = load <4 x i32>* %0, align 16
      8   %3 = call <4 x i32> @llvm.x86.sse41.pminud(<4 x i32> %2, <4 x i32> <i32 127, i32 127, i32 127, i32 127>)
      9   %4 = extractelement <4 x i32> %3, i32 0
     10   %5 = extractelement <4 x i32> %3, i32 1
     11   %6 = extractelement <4 x i32> %3, i32 2
     12   %7 = extractelement <4 x i32> %3, i32 3
     13   %8 = bitcast i32 %4 to <2 x i16>
     14   %9 = bitcast i32 %5 to <2 x i16>
     15   ret <2 x i16> %8
     16 ; CHECK: good
     17 ; CHECK: pminud
     18 ; CHECK-NEXT: pmovzxwq
     19 ; CHECK: ret
     20 }
     21 
     22 define <2 x i16> @bad(<4 x i32>*, <4 x i8>*) {
     23 entry:
     24   %2 = load <4 x i32>* %0, align 16
     25   %3 = call <4 x i32> @llvm.x86.sse41.pminud(<4 x i32> %2, <4 x i32> <i32 127, i32 127, i32 127, i32 127>)
     26   %4 = extractelement <4 x i32> %3, i32 0
     27   %5 = extractelement <4 x i32> %3, i32 1
     28   %6 = extractelement <4 x i32> %3, i32 2
     29   %7 = extractelement <4 x i32> %3, i32 3
     30   %8 = bitcast i32 %4 to <2 x i16>
     31   %9 = bitcast i32 %5 to <2 x i16>
     32   ret <2 x i16> %9
     33 ; CHECK: bad
     34 ; CHECK: pminud
     35 ; CHECK: pextrd
     36 ; CHECK: pmovzxwq
     37 ; CHECK: ret
     38 }
     39