Home | History | Annotate | Download | only in ARM
      1 ; RUN: llc -mtriple=arm -float-abi=soft -mattr=+vfp2 %s -o - | FileCheck %s
      2 
      3 define float @f1(float %a) {
      4 ; CHECK-LABEL: f1:
      5 ; CHECK: mov r0, #0
      6         ret float 0.000000e+00
      7 }
      8 
      9 define float @f2(float* %v, float %u) {
     10 ; CHECK-LABEL: f2:
     11 ; CHECK: vldr{{.*}}[
     12         %tmp = load float, float* %v           ; <float> [#uses=1]
     13         %tmp1 = fadd float %tmp, %u              ; <float> [#uses=1]
     14         ret float %tmp1
     15 }
     16 
     17 define float @f2offset(float* %v, float %u) {
     18 ; CHECK-LABEL: f2offset:
     19 ; CHECK: vldr{{.*}}, #4]
     20         %addr = getelementptr float, float* %v, i32 1
     21         %tmp = load float, float* %addr
     22         %tmp1 = fadd float %tmp, %u
     23         ret float %tmp1
     24 }
     25 
     26 define float @f2noffset(float* %v, float %u) {
     27 ; CHECK-LABEL: f2noffset:
     28 ; CHECK: vldr{{.*}}, #-4]
     29         %addr = getelementptr float, float* %v, i32 -1
     30         %tmp = load float, float* %addr
     31         %tmp1 = fadd float %tmp, %u
     32         ret float %tmp1
     33 }
     34 
     35 define void @f3(float %a, float %b, float* %v) {
     36 ; CHECK-LABEL: f3:
     37 ; CHECK: vstr{{.*}}[
     38         %tmp = fadd float %a, %b         ; <float> [#uses=1]
     39         store float %tmp, float* %v
     40         ret void
     41 }
     42