Home | History | Annotate | Download | only in ARM
      1 ; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s --check-prefix=CHECK-VFP
      2 ; RUN: llc < %s -mtriple=arm-apple-darwin | FileCheck %s
      3 
      4 define float @f1(double %x) {
      5 ;CHECK-VFP-LABEL: f1:
      6 ;CHECK-VFP: vcvt.f32.f64
      7 ;CHECK-LABEL: f1:
      8 ;CHECK: truncdfsf2
      9 entry:
     10 	%tmp1 = fptrunc double %x to float		; <float> [#uses=1]
     11 	ret float %tmp1
     12 }
     13 
     14 define double @f2(float %x) {
     15 ;CHECK-VFP-LABEL: f2:
     16 ;CHECK-VFP: vcvt.f64.f32
     17 ;CHECK-LABEL: f2:
     18 ;CHECK: extendsfdf2
     19 entry:
     20 	%tmp1 = fpext float %x to double		; <double> [#uses=1]
     21 	ret double %tmp1
     22 }
     23 
     24 define i32 @f3(float %x) {
     25 ;CHECK-VFP-LABEL: f3:
     26 ;CHECK-VFP: vcvt.s32.f32
     27 ;CHECK-LABEL: f3:
     28 ;CHECK: fixsfsi
     29 entry:
     30 	%tmp = fptosi float %x to i32		; <i32> [#uses=1]
     31 	ret i32 %tmp
     32 }
     33 
     34 define i32 @f4(float %x) {
     35 ;CHECK-VFP-LABEL: f4:
     36 ;CHECK-VFP: vcvt.u32.f32
     37 ;CHECK-LABEL: f4:
     38 ;CHECK: fixunssfsi
     39 entry:
     40 	%tmp = fptoui float %x to i32		; <i32> [#uses=1]
     41 	ret i32 %tmp
     42 }
     43 
     44 define i32 @f5(double %x) {
     45 ;CHECK-VFP-LABEL: f5:
     46 ;CHECK-VFP: vcvt.s32.f64
     47 ;CHECK-LABEL: f5:
     48 ;CHECK: fixdfsi
     49 entry:
     50 	%tmp = fptosi double %x to i32		; <i32> [#uses=1]
     51 	ret i32 %tmp
     52 }
     53 
     54 define i32 @f6(double %x) {
     55 ;CHECK-VFP-LABEL: f6:
     56 ;CHECK-VFP: vcvt.u32.f64
     57 ;CHECK-LABEL: f6:
     58 ;CHECK: fixunsdfsi
     59 entry:
     60 	%tmp = fptoui double %x to i32		; <i32> [#uses=1]
     61 	ret i32 %tmp
     62 }
     63 
     64 define float @f7(i32 %a) {
     65 ;CHECK-VFP-LABEL: f7:
     66 ;CHECK-VFP: vcvt.f32.s32
     67 ;CHECK-LABEL: f7:
     68 ;CHECK: floatsisf
     69 entry:
     70 	%tmp = sitofp i32 %a to float		; <float> [#uses=1]
     71 	ret float %tmp
     72 }
     73 
     74 define double @f8(i32 %a) {
     75 ;CHECK-VFP-LABEL: f8:
     76 ;CHECK-VFP: vcvt.f64.s32
     77 ;CHECK-LABEL: f8:
     78 ;CHECK: floatsidf
     79 entry:
     80 	%tmp = sitofp i32 %a to double		; <double> [#uses=1]
     81 	ret double %tmp
     82 }
     83 
     84 define float @f9(i32 %a) {
     85 ;CHECK-VFP-LABEL: f9:
     86 ;CHECK-VFP: vcvt.f32.u32
     87 ;CHECK-LABEL: f9:
     88 ;CHECK: floatunsisf
     89 entry:
     90 	%tmp = uitofp i32 %a to float		; <float> [#uses=1]
     91 	ret float %tmp
     92 }
     93 
     94 define double @f10(i32 %a) {
     95 ;CHECK-VFP-LABEL: f10:
     96 ;CHECK-VFP: vcvt.f64.u32
     97 ;CHECK-LABEL: f10:
     98 ;CHECK: floatunsidf
     99 entry:
    100 	%tmp = uitofp i32 %a to double		; <double> [#uses=1]
    101 	ret double %tmp
    102 }
    103