1 ; RUN: llc -mtriple=i386-pc-linux < %s | FileCheck %s
2 ; RUN: llc -mtriple=x86_64-pc-linux < %s | FileCheck %s
4 ; Function Attrs: nounwind
5 ; CHECK-LABEL: s64_to_d:
6 ; CHECK: call{{l|q}} __floatdidf
7 define double @s64_to_d(i64 %n) #0 {
9 %conv = sitofp i64 %n to double
13 ; CHECK-LABEL: s64_to_f:
14 ; CHECK: call{{l|q}} __floatdisf
15 define float @s64_to_f(i64 %n) #0 {
17 %conv = sitofp i64 %n to float
21 ; CHECK-LABEL: s32_to_d:
22 ; CHECK: call{{l|q}} __floatsidf
23 define double @s32_to_d(i32 %n) #0 {
25 %conv = sitofp i32 %n to double
29 ; CHECK-LABEL: s32_to_f:
30 ; CHECK: call{{l|q}} __floatsisf
31 define float @s32_to_f(i32 %n) #0 {
33 %conv = sitofp i32 %n to float
37 ; CHECK-LABEL: u64_to_d:
38 ; CHECK: call{{l|q}} __floatundidf
39 define double @u64_to_d(i64 %n) #0 {
41 %conv = uitofp i64 %n to double
45 ; CHECK-LABEL: u64_to_f:
46 ; CHECK: call{{l|q}} __floatundisf
47 define float @u64_to_f(i64 %n) #0 {
49 %conv = uitofp i64 %n to float
53 ; CHECK-LABEL: u32_to_d:
54 ; CHECK: call{{l|q}} __floatunsidf
55 define double @u32_to_d(i32 %n) #0 {
57 %conv = uitofp i32 %n to double
61 ; CHECK-LABEL: u32_to_f:
62 ; CHECK: call{{l|q}} __floatunsisf
63 define float @u32_to_f(i32 %n) #0 {
65 %conv = uitofp i32 %n to float
69 ; CHECK-LABEL: d_to_s64:
70 ; CHECK: call{{l|q}} __fixdfdi
71 define i64 @d_to_s64(double %n) #0 {
73 %conv = fptosi double %n to i64
77 ; CHECK-LABEL: d_to_s32:
78 ; CHECK: call{{l|q}} __fixdfsi
79 define i32 @d_to_s32(double %n) #0 {
81 %conv = fptosi double %n to i32
85 ; CHECK-LABEL: f_to_s64:
86 ; CHECK: call{{l|q}} __fixsfdi
87 define i64 @f_to_s64(float %n) #0 {
89 %conv = fptosi float %n to i64
93 ; CHECK-LABEL: f_to_s32:
94 ; CHECK: call{{l|q}} __fixsfsi
95 define i32 @f_to_s32(float %n) #0 {
97 %conv = fptosi float %n to i32
101 ; CHECK-LABEL: d_to_u64:
102 ; CHECK: call{{l|q}} __fixunsdfdi
103 define i64 @d_to_u64(double %n) #0 {
105 %conv = fptoui double %n to i64
109 ; CHECK-LABEL: d_to_u32:
110 ; CHECK: call{{l|q}} __fixunsdfsi
111 define i32 @d_to_u32(double %n) #0 {
113 %conv = fptoui double %n to i32
117 ; CHECK-LABEL: f_to_u64:
118 ; CHECK: call{{l|q}} __fixunssfdi
119 define i64 @f_to_u64(float %n) #0 {
121 %conv = fptoui float %n to i64
125 ; CHECK-LABEL: f_to_u32:
126 ; CHECK: call{{l|q}} __fixunssfsi
127 define i32 @f_to_u32(float %n) #0 {
129 %conv = fptoui float %n to i32
133 ; CHECK-LABEL: f_to_s8:
134 ; CHECK: call{{l|q}} __fixsfsi
135 define i8 @f_to_s8(float %f, i8 %i) #0 {
137 %conv = fptosi float %f to i8
138 %add = add i8 %conv, %i
142 ; CHECK-LABEL: f_to_u8:
143 ; CHECK: call{{l|q}} __fixunssfsi
144 define i8 @f_to_u8(float %f, i8 %i) #0 {
146 %conv = fptoui float %f to i8
147 %add = add i8 %conv, %i
151 ; CHECK-LABEL: f_to_s16:
152 ; CHECK: call{{l|q}} __fixsfsi
153 define i16 @f_to_s16(float %f, i16 %i) #0 {
155 %conv = fptosi float %f to i16
156 %add = add i16 %conv, %i
160 ; CHECK-LABEL: f_to_u16:
161 ; CHECK: call{{l|q}} __fixunssfsi
162 define i16 @f_to_u16(float %f, i16 %i) #0 {
164 %conv = fptoui float %f to i16
165 %add = add i16 %conv, %i
169 attributes #0 = { nounwind "use-soft-float"="true" }