Home | History | Annotate | Download | only in Thumb2
      1 ; RUN: llc < %s -mtriple=thumbv7-none-eabi   -mcpu=cortex-m4 -mattr=-vfp2             | FileCheck %s -check-prefix=CHECK -check-prefix=SOFT
      2 ; RUN: llc < %s -mtriple=thumbv7-none-eabihf -mcpu=cortex-m4 -mattr=+vfp4,+fp-only-sp | FileCheck %s -check-prefix=CHECK -check-prefix=HARD -check-prefix=SP
      3 ; RUN: llc < %s -mtriple=thumbv7-none-eabihf -mcpu=cortex-a8 -mattr=+vfp3             | FileCheck %s -check-prefix=CHECK -check-prefix=HARD -check-prefix=DP
      4 
      5 define float @float_in_reg(float %a, float %b) {
      6 entry:
      7 ; CHECK-LABEL: float_in_reg:
      8 ; SOFT: mov r0, r1
      9 ; HARD: vmov.f32  s0, s1
     10 ; CHECK-NEXT: bx lr
     11   ret float %b
     12 }
     13 
     14 define double @double_in_reg(double %a, double %b) {
     15 entry:
     16 ; CHECK-LABEL: double_in_reg:
     17 ; SOFT: mov r0, r2
     18 ; SOFT: mov r1, r3
     19 ; SP: vmov.f32  s0, s2
     20 ; SP: vmov.f32  s1, s3
     21 ; DP: vmov.f64  d0, d1
     22 ; CHECK-NEXT: bx lr
     23   ret double %b
     24 }
     25 
     26 define float @float_on_stack(double %a, double %b, double %c, double %d, double %e, double %f, double %g, double %h, float %i) {
     27 ; CHECK-LABEL: float_on_stack:
     28 ; SOFT: ldr r0, [sp, #48]
     29 ; HARD: vldr s0, [sp]
     30 ; CHECK-NEXT: bx lr
     31   ret float %i
     32 }
     33 
     34 define double @double_on_stack(double %a, double %b, double %c, double %d, double %e, double %f, double %g, double %h, double %i) {
     35 ; CHECK-LABEL: double_on_stack:
     36 ; SOFT: ldrd r0, r1, [sp, #48]
     37 ; HARD: vldr d0, [sp]
     38 ; CHECK-NEXT: bx lr
     39   ret double %i
     40 }
     41 
     42 define double @double_not_split(double %a, double %b, double %c, double %d, double %e, double %f, double %g, float %h, double %i) {
     43 ; CHECK-LABEL: double_not_split:
     44 ; SOFT: ldrd r0, r1, [sp, #48]
     45 ; HARD: vldr d0, [sp]
     46 ; CHECK-NEXT: bx lr
     47   ret double %i
     48 }
     49