Home | History | Annotate | Download | only in PowerPC
      1 ; RUN: llc < %s -mcpu=g5 | FileCheck %s
      2 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
      3 target triple = "powerpc64-unknown-linux-gnu"
      4 
      5 define void @foo(float* noalias nocapture %a, float* noalias nocapture %b) #0 {
      6 vector.ph:
      7   br label %vector.body
      8 
      9 vector.body:                                      ; preds = %vector.body, %vector.ph
     10   %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
     11   %0 = getelementptr inbounds float, float* %b, i64 %index
     12   %1 = bitcast float* %0 to <4 x float>*
     13   %wide.load = load <4 x float>, <4 x float>* %1, align 4
     14   %.sum11 = or i64 %index, 4
     15   %2 = getelementptr float, float* %b, i64 %.sum11
     16   %3 = bitcast float* %2 to <4 x float>*
     17   %wide.load8 = load <4 x float>, <4 x float>* %3, align 4
     18   %4 = fadd <4 x float> %wide.load, <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>
     19   %5 = fadd <4 x float> %wide.load8, <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>
     20   %6 = getelementptr inbounds float, float* %a, i64 %index
     21   %7 = bitcast float* %6 to <4 x float>*
     22   store <4 x float> %4, <4 x float>* %7, align 4
     23   %.sum12 = or i64 %index, 4
     24   %8 = getelementptr float, float* %a, i64 %.sum12
     25   %9 = bitcast float* %8 to <4 x float>*
     26   store <4 x float> %5, <4 x float>* %9, align 4
     27   %index.next = add i64 %index, 8
     28   %10 = icmp eq i64 %index.next, 16000
     29   br i1 %10, label %for.end, label %vector.body
     30 
     31 ; CHECK: @foo
     32 ; CHECK-DAG: li [[C0:[0-9]+]], 0
     33 ; CHECK-DAG: li [[C15:[0-9]+]], 15
     34 ; CHECK-DAG: lvx [[CNST:[0-9]+]],
     35 ; CHECK: .LBB0_1:
     36 ; CHECK-DAG: lvsl [[MASK1:[0-9]+]], [[B1:[0-9]+]], [[C0]]
     37 ; CHECK-DAG: lvsl [[MASK2:[0-9]+]], [[B2:[0-9]+]], [[C0]]
     38 ; CHECK-DAG: add [[B3:[0-9]+]], [[B1]], [[C0]]
     39 ; CHECK-DAG: add [[B4:[0-9]+]], [[B2]], [[C0]]
     40 ; CHECK-DAG: lvx [[LD1:[0-9]+]], [[B1]], [[C0]]
     41 ; CHECK-DAG: lvx [[LD2:[0-9]+]], [[B3]], [[C15]]
     42 ; CHECK-DAG: lvx [[LD3:[0-9]+]], [[B2]], [[C0]]
     43 ; CHECK-DAG: lvx [[LD4:[0-9]+]], [[B4]], [[C15]]
     44 ; CHECK-DAG: vperm [[R1:[0-9]+]], [[LD1]], [[LD2]], [[MASK1]]
     45 ; CHECK-DAG: vperm [[R2:[0-9]+]], [[LD3]], [[LD4]], [[MASK2]]
     46 ; CHECK-DAG: vaddfp {{[0-9]+}}, [[R1]], [[CNST]]
     47 ; CHECK-DAG: vaddfp {{[0-9]+}}, [[R2]], [[CNST]]
     48 ; CHECK: blr
     49 
     50 for.end:                                          ; preds = %vector.body
     51   ret void
     52 }
     53 
     54 attributes #0 = { nounwind }
     55