Home | History | Annotate | Download | only in CellSPU
      1 ;RUN: llc --march=cellspu %s -o - | FileCheck %s
      2 %vec = type <2 x float>
      3 
      4 define %vec @test_ret(%vec %param)
      5 {
      6 ;CHECK: bi $lr
      7  ret %vec %param
      8 }
      9 
     10 define %vec @test_add(%vec %param)
     11 {
     12 ;CHECK: fa {{\$.}}, $3, $3
     13  %1 = fadd %vec %param, %param
     14 ;CHECK: bi $lr
     15  ret %vec %1
     16 }
     17 
     18 define %vec @test_sub(%vec %param)
     19 {
     20 ;CHECK: fs {{\$.}}, $3, $3
     21  %1 = fsub %vec %param, %param
     22 
     23 ;CHECK: bi $lr
     24  ret %vec %1
     25 }
     26 
     27 define %vec @test_mul(%vec %param)
     28 {
     29 ;CHECK: fm {{\$.}}, $3, $3
     30  %1 = fmul %vec %param, %param
     31 
     32 ;CHECK: bi $lr
     33  ret %vec %1
     34 }
     35 
     36 ; CHECK: test_splat:
     37 define %vec @test_splat(float %param ) {
     38 ;CHECK: lqa
     39 ;CHECK: shufb
     40   %sv = insertelement <1 x float> undef, float %param, i32 0 
     41   %rv = shufflevector <1 x float> %sv, <1 x float> undef, <2 x i32> zeroinitializer 
     42 ;CHECK: bi $lr
     43   ret %vec %rv
     44 }
     45 
     46 define void @test_store(%vec %val, %vec* %ptr){
     47 ; CHECK: test_store:
     48 ;CHECK: stqd 
     49   store %vec zeroinitializer, %vec* null
     50 
     51 ;CHECK: stqd $3, 0(${{.*}})
     52 ;CHECK: bi $lr
     53   store %vec %val, %vec* %ptr
     54   ret void
     55 }
     56 
     57 ; CHECK: test_insert:
     58 define %vec @test_insert(){
     59 ;CHECK: cwd
     60 ;CHECK: shufb $3
     61   %rv = insertelement %vec undef, float 0.0e+00, i32 undef
     62 ;CHECK: bi $lr
     63   ret %vec %rv
     64 }
     65 
     66 ; CHECK: test_unaligned_store:
     67 
     68 define void @test_unaligned_store()  {
     69 ;CHECK:	cdd
     70 ;CHECK:	shufb
     71 ;CHECK:	stqd
     72   %data = alloca [4 x float], align 16         ; <[4 x float]*> [#uses=1]
     73   %ptr = getelementptr [4 x float]* %data, i32 0, i32 2 ; <float*> [#uses=1]
     74   %vptr = bitcast float* %ptr to  <2 x float>* ; <[1 x <2 x float>]*> [#uses=1]
     75   store <2 x float> zeroinitializer, <2 x float>* %vptr
     76   ret void
     77 }
     78 
     79