Home | History | Annotate | Download | only in X86
      1 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefix=SSE2
      2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.1 | FileCheck %s --check-prefix=SSE41
      3 
      4 define <4 x i32> @test1(<4 x i32> %A, <4 x i32> %B) {
      5 ; SSE2-LABEL: test1:
      6 ; SSE2:       # BB#0:
      7 ; SSE2-NEXT:    movsd {{.*#+}} xmm1 = xmm0[0],xmm1[1]
      8 ; SSE2-NEXT:    movapd %xmm1, %xmm0
      9 ; SSE2-NEXT:    retq
     10 ;
     11 ; SSE41-LABEL: test1:
     12 ; SSE41:       # BB#0:
     13 ; SSE41-NEXT:    pblendw {{.*#+}} xmm0 = xmm0[0,1,2,3],xmm1[4,5,6,7]
     14 ; SSE41-NEXT:    retq
     15   %select = select <4 x i1><i1 true, i1 true, i1 false, i1 false>, <4 x i32> %A, <4 x i32> %B
     16   ret <4 x i32> %select
     17 }
     18 
     19 define <4 x i32> @test2(<4 x i32> %A, <4 x i32> %B) {
     20 ; SSE2-LABEL: test2:
     21 ; SSE2:       # BB#0:
     22 ; SSE2-NEXT:    movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
     23 ; SSE2-NEXT:    retq
     24 ;
     25 ; SSE41-LABEL: test2:
     26 ; SSE41:       # BB#0:
     27 ; SSE41-NEXT:    pblendw {{.*#+}} xmm0 = xmm1[0,1,2,3],xmm0[4,5,6,7]
     28 ; SSE41-NEXT:    retq
     29   %select = select <4 x i1><i1 false, i1 false, i1 true, i1 true>, <4 x i32> %A, <4 x i32> %B
     30   ret <4 x i32> %select
     31 }
     32 
     33 define <4 x float> @test3(<4 x float> %A, <4 x float> %B) {
     34 ; SSE2-LABEL: test3:
     35 ; SSE2:       # BB#0:
     36 ; SSE2-NEXT:    movsd {{.*#+}} xmm1 = xmm0[0],xmm1[1]
     37 ; SSE2-NEXT:    movapd %xmm1, %xmm0
     38 ; SSE2-NEXT:    retq
     39 ;
     40 ; SSE41-LABEL: test3:
     41 ; SSE41:       # BB#0:
     42 ; SSE41-NEXT:    blendpd {{.*#+}} xmm0 = xmm0[0],xmm1[1]
     43 ; SSE41-NEXT:    retq
     44   %select = select <4 x i1><i1 true, i1 true, i1 false, i1 false>, <4 x float> %A, <4 x float> %B
     45   ret <4 x float> %select
     46 }
     47 
     48 define <4 x float> @test4(<4 x float> %A, <4 x float> %B) {
     49 ; SSE2-LABEL: test4:
     50 ; SSE2:       # BB#0:
     51 ; SSE2-NEXT:    movsd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
     52 ; SSE2-NEXT:    retq
     53 ;
     54 ; SSE41-LABEL: test4:
     55 ; SSE41:       # BB#0:
     56 ; SSE41-NEXT:    blendpd {{.*#+}} xmm0 = xmm1[0],xmm0[1]
     57 ; SSE41-NEXT:    retq
     58   %select = select <4 x i1><i1 false, i1 false, i1 true, i1 true>, <4 x float> %A, <4 x float> %B
     59   ret <4 x float> %select
     60 }
     61