Home | History | Annotate | Download | only in X86
      1 ; RUN: llc < %s -march=x86-64 -mtriple=x86_64-apple-darwin -mcpu=knl | FileCheck %s
      2 
      3 ;CHECK: test1
      4 ;CHECK: vinsertps
      5 ;CHECK: vinsertf32x4
      6 ;CHECK: ret
      7 define <16 x float> @test1(<16 x float> %x, float* %br, float %y) nounwind {
      8   %rrr = load float* %br
      9   %rrr2 = insertelement <16 x float> %x, float %rrr, i32 1
     10   %rrr3 = insertelement <16 x float> %rrr2, float %y, i32 14
     11   ret <16 x float> %rrr3
     12 }
     13 
     14 ;CHECK: test2
     15 ;CHECK: vinsertf32x4
     16 ;CHECK: vextractf32x4
     17 ;CHECK: vinsertf32x4
     18 ;CHECK: ret
     19 define <8 x double> @test2(<8 x double> %x, double* %br, double %y) nounwind {
     20   %rrr = load double* %br
     21   %rrr2 = insertelement <8 x double> %x, double %rrr, i32 1
     22   %rrr3 = insertelement <8 x double> %rrr2, double %y, i32 6
     23   ret <8 x double> %rrr3
     24 }
     25 
     26 ;CHECK: test3
     27 ;CHECK: vextractf32x4
     28 ;CHECK: vinsertf32x4
     29 ;CHECK: ret
     30 define <16 x float> @test3(<16 x float> %x) nounwind {
     31   %eee = extractelement <16 x float> %x, i32 4
     32   %rrr2 = insertelement <16 x float> %x, float %eee, i32 1
     33   ret <16 x float> %rrr2
     34 }
     35 
     36 ;CHECK: test4
     37 ;CHECK: vextracti32x4
     38 ;CHECK: vinserti32x4
     39 ;CHECK: ret
     40 define <8 x i64> @test4(<8 x i64> %x) nounwind {
     41   %eee = extractelement <8 x i64> %x, i32 4
     42   %rrr2 = insertelement <8 x i64> %x, i64 %eee, i32 1
     43   ret <8 x i64> %rrr2
     44 }
     45 
     46 ;CHECK: test5
     47 ;CHECK: vextractpsz
     48 ;CHECK: ret
     49 define i32 @test5(<4 x float> %x) nounwind {
     50   %ef = extractelement <4 x float> %x, i32 3
     51   %ei = bitcast float %ef to i32
     52   ret i32 %ei
     53 }
     54 
     55 ;CHECK: test6
     56 ;CHECK: vextractpsz {{.*}}, (%rdi)
     57 ;CHECK: ret
     58 define void @test6(<4 x float> %x, float* %out) nounwind {
     59   %ef = extractelement <4 x float> %x, i32 3
     60   store float %ef, float* %out, align 4
     61   ret void
     62 }
     63 
     64