Home | History | Annotate | Download | only in X86
      1 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl  | FileCheck %s
      2 
      3 ; CHECK-LABEL: select00
      4 ; CHECK: vmovaps
      5 ; CHECK-NEXT: LBB
      6 define <16 x i32> @select00(i32 %a, <16 x i32> %b) nounwind {
      7   %cmpres = icmp eq i32 %a, 255
      8   %selres = select i1 %cmpres, <16 x i32> zeroinitializer, <16 x i32> %b
      9   %res = xor <16 x i32> %b, %selres
     10   ret <16 x i32> %res
     11 }
     12 
     13 ; CHECK-LABEL: select01
     14 ; CHECK: vmovaps
     15 ; CHECK-NEXT: LBB
     16 define <8 x i64> @select01(i32 %a, <8 x i64> %b) nounwind {
     17   %cmpres = icmp eq i32 %a, 255
     18   %selres = select i1 %cmpres, <8 x i64> zeroinitializer, <8 x i64> %b
     19   %res = xor <8 x i64> %b, %selres
     20   ret <8 x i64> %res
     21 }
     22 
     23 ; CHECK-LABEL: @select02
     24 ; CHECK: cmpless %xmm0, %xmm3, %k1
     25 ; CHECK-NEXT: vmovss  %xmm2, {{.*}}%xmm1 {%k1}
     26 ; CHECK: ret
     27 define float @select02(float %a, float %b, float %c, float %eps) {
     28   %cmp = fcmp oge float %a, %eps
     29   %cond = select i1 %cmp, float %c, float %b
     30   ret float %cond
     31 }
     32 
     33 ; CHECK-LABEL: @select03
     34 ; CHECK: cmplesd %xmm0, %xmm3, %k1
     35 ; CHECK-NEXT: vmovsd  %xmm2, {{.*}}%xmm1 {%k1}
     36 ; CHECK: ret
     37 define double @select03(double %a, double %b, double %c, double %eps) {
     38   %cmp = fcmp oge double %a, %eps
     39   %cond = select i1 %cmp, double %c, double %b
     40   ret double %cond
     41 }
     42