Home | History | Annotate | Download | only in vect
      1 ; RUN: llc -march=hexagon < %s | FileCheck %s
      2 
      3 ; Check that we can compile these functions. Don't check anything else for now.
      4 ; CHECK-LABEL: test_0:
      5 ; CHECK: tstbit
      6 ; CHECK-LABEL: test_1:
      7 ; CHECK: tstbit
      8 ; CHECK-LABEL: test_2:
      9 ; CHECK: tstbit
     10 
     11 define i32 @test_0(i32 %a0, i32 %a1) #0 {
     12   %t0 = trunc i32 %a0 to i1
     13   %t1 = trunc i32 %a1 to i1
     14 
     15   %t2 = insertelement <2 x i1> undef, i1 %t0, i32 0
     16   %t3 = insertelement <2 x i1> %t2, i1 %t1, i32 1
     17 
     18   %t4 = shufflevector <2 x i1> %t3, <2 x i1> undef, <8 x i32> <i32 0, i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
     19   %t5 = bitcast <8 x i1> %t4 to i8
     20   %t6 = zext i8 %t5 to i32
     21   ret i32 %t6
     22 }
     23 
     24 define i32 @test_1(i32 %a0, i32 %a1, i32 %a2, i32 %a3) #0 {
     25   %t0 = trunc i32 %a0 to i1
     26   %t1 = trunc i32 %a1 to i1
     27   %t2 = trunc i32 %a2 to i1
     28   %t3 = trunc i32 %a3 to i1
     29 
     30   %t4 = insertelement <4 x i1> undef, i1 %t0, i32 0
     31   %t5 = insertelement <4 x i1> %t4, i1 %t1, i32 1
     32   %t6 = insertelement <4 x i1> %t5, i1 %t2, i32 2
     33   %t7 = insertelement <4 x i1> %t6, i1 %t3, i32 3
     34 
     35   %t8 = shufflevector <4 x i1> %t7, <4 x i1> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef>
     36   %t9 = bitcast <8 x i1> %t8 to i8
     37   %ta = zext i8 %t9 to i32
     38   ret i32 %ta
     39 }
     40 
     41 define i32 @test_2(i32 %a0, i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, i32 %a6, i32 %a7) #0 {
     42   %t0 = trunc i32 %a0 to i1
     43   %t1 = trunc i32 %a1 to i1
     44   %t2 = trunc i32 %a2 to i1
     45   %t3 = trunc i32 %a3 to i1
     46   %t4 = trunc i32 %a4 to i1
     47   %t5 = trunc i32 %a5 to i1
     48   %t6 = trunc i32 %a6 to i1
     49   %t7 = trunc i32 %a7 to i1
     50 
     51   %t8 = insertelement <8 x i1> undef, i1 %t0, i32 0
     52   %t9 = insertelement <8 x i1> %t8, i1 %t1, i32 1
     53   %ta = insertelement <8 x i1> %t9, i1 %t2, i32 2
     54   %tb = insertelement <8 x i1> %ta, i1 %t3, i32 3
     55   %tc = insertelement <8 x i1> %tb, i1 %t4, i32 4
     56   %td = insertelement <8 x i1> %tc, i1 %t5, i32 5
     57   %te = insertelement <8 x i1> %td, i1 %t6, i32 6
     58   %tf = insertelement <8 x i1> %te, i1 %t7, i32 7
     59 
     60   %tg = bitcast <8 x i1> %tf to i8
     61   %th = zext i8 %tg to i32
     62   ret i32 %th
     63 }
     64 
     65 attributes #0 = { nounwind readnone }
     66