1 ; RUN: llc -mtriple=aarch64-none-linux-gnu -verify-machineinstrs -o - %s | FileCheck %s
2 ; RUN: llc -mtriple=aarch64-linux-android -verify-machineinstrs -o - %s | FileCheck --check-prefix=ANDROID-AARCH64 %s
4 @varfloat = global float 0.0
5 @vardouble = global double 0.0
6 @varfp128 = global fp128 zeroinitializer
8 declare float @llvm.cos.f32(float)
9 declare double @llvm.cos.f64(double)
10 declare fp128 @llvm.cos.f128(fp128)
12 define void @test_cos(float %float, double %double, fp128 %fp128) {
13 ; CHECK-LABEL: test_cos:
15 %cosfloat = call float @llvm.cos.f32(float %float)
16 store float %cosfloat, float* @varfloat
19 %cosdouble = call double @llvm.cos.f64(double %double)
20 store double %cosdouble, double* @vardouble
23 %cosfp128 = call fp128 @llvm.cos.f128(fp128 %fp128)
24 store fp128 %cosfp128, fp128* @varfp128
30 declare float @llvm.exp.f32(float)
31 declare double @llvm.exp.f64(double)
32 declare fp128 @llvm.exp.f128(fp128)
34 define void @test_exp(float %float, double %double, fp128 %fp128) {
35 ; CHECK-LABEL: test_exp:
37 %expfloat = call float @llvm.exp.f32(float %float)
38 store float %expfloat, float* @varfloat
41 %expdouble = call double @llvm.exp.f64(double %double)
42 store double %expdouble, double* @vardouble
45 %expfp128 = call fp128 @llvm.exp.f128(fp128 %fp128)
46 store fp128 %expfp128, fp128* @varfp128
52 declare float @llvm.exp2.f32(float)
53 declare double @llvm.exp2.f64(double)
54 declare fp128 @llvm.exp2.f128(fp128)
56 define void @test_exp2(float %float, double %double, fp128 %fp128) {
57 ; CHECK-LABEL: test_exp2:
59 %exp2float = call float @llvm.exp2.f32(float %float)
60 store float %exp2float, float* @varfloat
63 %exp2double = call double @llvm.exp2.f64(double %double)
64 store double %exp2double, double* @vardouble
67 %exp2fp128 = call fp128 @llvm.exp2.f128(fp128 %fp128)
68 store fp128 %exp2fp128, fp128* @varfp128
74 declare float @llvm.log.f32(float)
75 declare double @llvm.log.f64(double)
76 declare fp128 @llvm.log.f128(fp128)
78 define void @test_log(float %float, double %double, fp128 %fp128) {
79 ; CHECK-LABEL: test_log:
81 %logfloat = call float @llvm.log.f32(float %float)
82 store float %logfloat, float* @varfloat
85 %logdouble = call double @llvm.log.f64(double %double)
86 store double %logdouble, double* @vardouble
89 %logfp128 = call fp128 @llvm.log.f128(fp128 %fp128)
90 store fp128 %logfp128, fp128* @varfp128
96 declare float @llvm.log2.f32(float)
97 declare double @llvm.log2.f64(double)
98 declare fp128 @llvm.log2.f128(fp128)
100 define void @test_log2(float %float, double %double, fp128 %fp128) {
101 ; CHECK-LABEL: test_log2:
103 %log2float = call float @llvm.log2.f32(float %float)
104 store float %log2float, float* @varfloat
107 %log2double = call double @llvm.log2.f64(double %double)
108 store double %log2double, double* @vardouble
111 %log2fp128 = call fp128 @llvm.log2.f128(fp128 %fp128)
112 store fp128 %log2fp128, fp128* @varfp128
118 declare float @llvm.log10.f32(float)
119 declare double @llvm.log10.f64(double)
120 declare fp128 @llvm.log10.f128(fp128)
122 define void @test_log10(float %float, double %double, fp128 %fp128) {
123 ; CHECK-LABEL: test_log10:
125 %log10float = call float @llvm.log10.f32(float %float)
126 store float %log10float, float* @varfloat
129 %log10double = call double @llvm.log10.f64(double %double)
130 store double %log10double, double* @vardouble
133 %log10fp128 = call fp128 @llvm.log10.f128(fp128 %fp128)
134 store fp128 %log10fp128, fp128* @varfp128
140 declare float @llvm.sin.f32(float)
141 declare double @llvm.sin.f64(double)
142 declare fp128 @llvm.sin.f128(fp128)
144 define void @test_sin(float %float, double %double, fp128 %fp128) {
145 ; CHECK-LABEL: test_sin:
147 %sinfloat = call float @llvm.sin.f32(float %float)
148 store float %sinfloat, float* @varfloat
151 %sindouble = call double @llvm.sin.f64(double %double)
152 store double %sindouble, double* @vardouble
155 %sinfp128 = call fp128 @llvm.sin.f128(fp128 %fp128)
156 store fp128 %sinfp128, fp128* @varfp128
162 declare float @llvm.pow.f32(float, float)
163 declare double @llvm.pow.f64(double, double)
164 declare fp128 @llvm.pow.f128(fp128, fp128)
166 define void @test_pow(float %float, double %double, fp128 %fp128) {
167 ; CHECK-LABEL: test_pow:
169 %powfloat = call float @llvm.pow.f32(float %float, float %float)
170 store float %powfloat, float* @varfloat
173 %powdouble = call double @llvm.pow.f64(double %double, double %double)
174 store double %powdouble, double* @vardouble
177 %powfp128 = call fp128 @llvm.pow.f128(fp128 %fp128, fp128 %fp128)
178 store fp128 %powfp128, fp128* @varfp128
184 declare float @llvm.powi.f32(float, i32)
185 declare double @llvm.powi.f64(double, i32)
186 declare fp128 @llvm.powi.f128(fp128, i32)
188 define void @test_powi(float %float, double %double, i32 %exponent, fp128 %fp128) {
189 ; CHECK-LABEL: test_powi:
191 %powifloat = call float @llvm.powi.f32(float %float, i32 %exponent)
192 store float %powifloat, float* @varfloat
193 ; CHECK: bl __powisf2
195 %powidouble = call double @llvm.powi.f64(double %double, i32 %exponent)
196 store double %powidouble, double* @vardouble
197 ; CHECK: bl __powidf2
199 %powifp128 = call fp128 @llvm.powi.f128(fp128 %fp128, i32 %exponent)
200 store fp128 %powifp128, fp128* @varfp128
201 ; CHECK: bl __powitf2
206 define void @test_frem(float %float, double %double, fp128 %fp128) {
207 ; CHECK-LABEL: test_frem:
209 %fremfloat = frem float %float, %float
210 store float %fremfloat, float* @varfloat
213 %fremdouble = frem double %double, %double
214 store double %fremdouble, double* @vardouble
217 %fremfp128 = frem fp128 %fp128, %fp128
218 store fp128 %fremfp128, fp128* @varfp128
224 declare fp128 @llvm.fma.f128(fp128, fp128, fp128)
226 define void @test_fma(fp128 %fp128) {
227 ; CHECK-LABEL: test_fma:
229 %fmafp128 = call fp128 @llvm.fma.f128(fp128 %fp128, fp128 %fp128, fp128 %fp128)
230 store fp128 %fmafp128, fp128* @varfp128
236 declare fp128 @llvm.fmuladd.f128(fp128, fp128, fp128)
238 define void @test_fmuladd(fp128 %fp128) {
239 ; CHECK-LABEL: test_fmuladd:
241 %fmuladdfp128 = call fp128 @llvm.fmuladd.f128(fp128 %fp128, fp128 %fp128, fp128 %fp128)
242 store fp128 %fmuladdfp128, fp128* @varfp128
250 define void @test_exp_finite(double %double) #0 {
251 %expdouble = call double @llvm.exp.f64(double %double)
252 store double %expdouble, double* @vardouble
253 ; ANDROID-AARCH64-NOT: bl __exp_finite
254 ; CHECK: bl __exp_finite
259 define void @test_exp2_finite(double %double) #0 {
260 %expdouble = call double @llvm.exp2.f64(double %double)
261 store double %expdouble, double* @vardouble
262 ; ANDROID-AARCH64-NOT: bl __exp2_finite
263 ; CHECK: bl __exp2_finite
268 define void @test_log_finite(double %double) #0 {
269 %logdouble = call double @llvm.log.f64(double %double)
270 store double %logdouble, double* @vardouble
271 ; ANDROID-AARCH64-NOT: bl __log_finite
272 ; CHECK: bl __log_finite
276 define void @test_log2_finite(double %double) #0 {
277 %log2double = call double @llvm.log2.f64(double %double)
278 store double %log2double, double* @vardouble
279 ; ANDROID-AARCH64-NOT: bl __log2_finite
280 ; CHECK: bl __log2_finite
284 define void @test_log10_finite(double %double) #0 {
285 %log10double = call double @llvm.log10.f64(double %double)
286 store double %log10double, double* @vardouble
287 ; ANDROID-AARCH64-NOT: bl __log10_finite
288 ; CHECK: bl __log10_finite
292 define void @test_pow_finite(double %double) #0 {
293 %powdouble = call double @llvm.pow.f64(double %double, double %double)
294 store double %powdouble, double* @vardouble
295 ; ANDROID-AARCH64-NOT: bl __pow_finite
296 ; CHECK: bl __pow_finite
300 attributes #0 = { "no-infs-fp-math"="true" "no-nans-fp-math"="true" }