[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGen / X86 / math-builtins.c
blobbf107437fc63a32c2b9d8892d6a4b66832693636
1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -w -o - -emit-llvm %s | FileCheck %s -check-prefix=NO__ERRNO
2 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -w -o - -emit-llvm -fmath-errno %s | FileCheck %s -check-prefix=HAS_ERRNO
3 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -w -o - -emit-llvm -disable-llvm-passes -O2 %s | FileCheck %s -check-prefix=NO__ERRNO
4 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -w -o - -emit-llvm -disable-llvm-passes -O2 -fmath-errno %s | FileCheck %s -check-prefix=HAS_ERRNO
5 // RUN: %clang_cc1 -triple x86_64-unknown-unknown-gnu -w -o - -emit-llvm -fmath-errno %s | FileCheck %s --check-prefix=HAS_ERRNO_GNU
6 // RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -w -o - -emit-llvm -fmath-errno %s | FileCheck %s --check-prefix=HAS_ERRNO_WIN
8 // Test attributes and codegen of math builtins.
10 void foo(double *d, float f, float *fp, long double *l, int *i, const char *c) {
11 f = __builtin_fmod(f,f); f = __builtin_fmodf(f,f); f = __builtin_fmodl(f,f); f = __builtin_fmodf128(f,f);
13 // NO__ERRNO: frem double
14 // NO__ERRNO: frem float
15 // NO__ERRNO: frem x86_fp80
16 // NO__ERRNO: frem fp128
18 // NO__ERRNO: [[FREXP_F64:%.+]] = call { double, i32 } @llvm.frexp.f64.i32(double %{{.+}})
19 // NO__ERRNO-NEXT: [[FREXP_F64_1:%.+]] = extractvalue { double, i32 } [[FREXP_F64]], 1
20 // NO__ERRNO-NEXT: store i32 [[FREXP_F64_1]], ptr %{{.+}}, align 4
21 // NO__ERRNO-NEXT: [[FREXP_F64_0:%.+]] = extractvalue { double, i32 } [[FREXP_F64]], 0
23 // NO__ERRNO: [[FREXP_F32:%.+]] = call { float, i32 } @llvm.frexp.f32.i32(float %{{.+}})
24 // NO__ERRNO-NEXT: [[FREXP_F32_1:%.+]] = extractvalue { float, i32 } [[FREXP_F32]], 1
25 // NO__ERRNO-NEXT: store i32 [[FREXP_F32_1]], ptr %{{.+}}, align 4
26 // NO__ERRNO-NEXT: [[FREXP_F32_0:%.+]] = extractvalue { float, i32 } [[FREXP_F32]], 0
29 // NO__ERRNO: [[FREXP_F80:%.+]] = call { x86_fp80, i32 } @llvm.frexp.f80.i32(x86_fp80 %{{.+}})
30 // NO__ERRNO-NEXT: [[FREXP_F80_1:%.+]] = extractvalue { x86_fp80, i32 } [[FREXP_F80]], 1
31 // NO__ERRNO-NEXT: store i32 [[FREXP_F80_1]], ptr %{{.+}}, align 4
32 // NO__ERRNO-NEXT: [[FREXP_F80_0:%.+]] = extractvalue { x86_fp80, i32 } [[FREXP_F80]], 0
35 // NO__ERRNO: [[FREXP_F128:%.+]] = call { fp128, i32 } @llvm.frexp.f128.i32(fp128 %{{.+}})
36 // NO__ERRNO-NEXT: [[FREXP_F128_1:%.+]] = extractvalue { fp128, i32 } [[FREXP_F128]], 1
37 // NO__ERRNO-NEXT: store i32 [[FREXP_F128_1]], ptr %{{.+}}, align 4
38 // NO__ERRNO-NEXT: [[FREXP_F128_0:%.+]] = extractvalue { fp128, i32 } [[FREXP_F128]], 0
41 // HAS_ERRNO: declare double @fmod(double noundef, double noundef) [[NOT_READNONE:#[0-9]+]]
42 // HAS_ERRNO: declare float @fmodf(float noundef, float noundef) [[NOT_READNONE]]
43 // HAS_ERRNO: declare x86_fp80 @fmodl(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]
44 // HAS_ERRNO: declare fp128 @fmodf128(fp128 noundef, fp128 noundef) [[NOT_READNONE]]
46 __builtin_atan2(f,f); __builtin_atan2f(f,f) ; __builtin_atan2l(f, f); __builtin_atan2f128(f,f);
48 // NO__ERRNO: declare double @llvm.atan2.f64(double, double) [[READNONE_INTRINSIC:#[0-9]+]]
49 // NO__ERRNO: declare float @llvm.atan2.f32(float, float) [[READNONE_INTRINSIC]]
50 // NO__ERRNO: declare x86_fp80 @llvm.atan2.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC]]
51 // NO__ERRNO: declare fp128 @llvm.atan2.f128(fp128, fp128) [[READNONE_INTRINSIC]]
52 // HAS_ERRNO: declare double @atan2(double noundef, double noundef) [[NOT_READNONE]]
53 // HAS_ERRNO: declare float @atan2f(float noundef, float noundef) [[NOT_READNONE]]
54 // HAS_ERRNO: declare x86_fp80 @atan2l(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]
55 // HAS_ERRNO: declare fp128 @atan2f128(fp128 noundef, fp128 noundef) [[NOT_READNONE]]
57 __builtin_copysign(f,f); __builtin_copysignf(f,f); __builtin_copysignl(f,f); __builtin_copysignf128(f,f);
59 // NO__ERRNO: declare double @llvm.copysign.f64(double, double) [[READNONE_INTRINSIC]]
60 // NO__ERRNO: declare float @llvm.copysign.f32(float, float) [[READNONE_INTRINSIC]]
61 // NO__ERRNO: declare x86_fp80 @llvm.copysign.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC]]
62 // NO__ERRNO: declare fp128 @llvm.copysign.f128(fp128, fp128) [[READNONE_INTRINSIC]]
63 // HAS_ERRNO: declare double @llvm.copysign.f64(double, double) [[READNONE_INTRINSIC:#[0-9]+]]
64 // HAS_ERRNO: declare float @llvm.copysign.f32(float, float) [[READNONE_INTRINSIC]]
65 // HAS_ERRNO: declare x86_fp80 @llvm.copysign.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC]]
66 // HAS_ERRNO: declare fp128 @llvm.copysign.f128(fp128, fp128) [[READNONE_INTRINSIC]]
68 __builtin_fabs(f); __builtin_fabsf(f); __builtin_fabsl(f); __builtin_fabsf128(f);
70 // NO__ERRNO: declare double @llvm.fabs.f64(double) [[READNONE_INTRINSIC]]
71 // NO__ERRNO: declare float @llvm.fabs.f32(float) [[READNONE_INTRINSIC]]
72 // NO__ERRNO: declare x86_fp80 @llvm.fabs.f80(x86_fp80) [[READNONE_INTRINSIC]]
73 // NO__ERRNO: declare fp128 @llvm.fabs.f128(fp128) [[READNONE_INTRINSIC]]
74 // HAS_ERRNO: declare double @llvm.fabs.f64(double) [[READNONE_INTRINSIC]]
75 // HAS_ERRNO: declare float @llvm.fabs.f32(float) [[READNONE_INTRINSIC]]
76 // HAS_ERRNO: declare x86_fp80 @llvm.fabs.f80(x86_fp80) [[READNONE_INTRINSIC]]
77 // HAS_ERRNO: declare fp128 @llvm.fabs.f128(fp128) [[READNONE_INTRINSIC]]
79 __builtin_frexp(f,i); __builtin_frexpf(f,i); __builtin_frexpl(f,i); __builtin_frexpf128(f,i);
81 // NO__ERRNO: declare { double, i32 } @llvm.frexp.f64.i32(double) [[READNONE_INTRINSIC]]
82 // NO__ERRNO: declare { float, i32 } @llvm.frexp.f32.i32(float) [[READNONE_INTRINSIC]]
83 // NO__ERRNO: declare { x86_fp80, i32 } @llvm.frexp.f80.i32(x86_fp80) [[READNONE_INTRINSIC]]
84 // NO__ERRNO: declare { fp128, i32 } @llvm.frexp.f128.i32(fp128) [[READNONE_INTRINSIC]]
85 // HAS_ERRNO: declare { double, i32 } @llvm.frexp.f64.i32(double) [[READNONE_INTRINSIC]]
86 // HAS_ERRNO: declare { float, i32 } @llvm.frexp.f32.i32(float) [[READNONE_INTRINSIC]]
87 // HAS_ERRNO: declare { x86_fp80, i32 } @llvm.frexp.f80.i32(x86_fp80) [[READNONE_INTRINSIC]]
88 // HAS_ERRNO: declare { fp128, i32 } @llvm.frexp.f128.i32(fp128) [[READNONE_INTRINSIC]]
90 __builtin_huge_val(); __builtin_huge_valf(); __builtin_huge_vall(); __builtin_huge_valf128();
92 // NO__ERRNO-NOT: .huge
93 // NO__ERRNO-NOT: @huge
94 // HAS_ERRNO-NOT: .huge
95 // HAS_ERRNO-NOT: @huge
97 __builtin_inf(); __builtin_inff(); __builtin_infl(); __builtin_inff128();
99 // NO__ERRNO-NOT: .inf
100 // NO__ERRNO-NOT: @inf
101 // HAS_ERRNO-NOT: .inf
102 // HAS_ERRNO-NOT: @inf
104 __builtin_ldexp(f,f); __builtin_ldexpf(f,f); __builtin_ldexpl(f,f); __builtin_ldexpf128(f,f);
106 // NO__ERRNO: declare double @llvm.ldexp.f64.i32(double, i32) [[READNONE_INTRINSIC]]
107 // NO__ERRNO: declare float @llvm.ldexp.f32.i32(float, i32) [[READNONE_INTRINSIC]]
108 // NO__ERRNO: declare x86_fp80 @llvm.ldexp.f80.i32(x86_fp80, i32) [[READNONE_INTRINSIC]]
109 // NO__ERRNO: declare fp128 @llvm.ldexp.f128.i32(fp128, i32) [[READNONE_INTRINSIC]]
110 // HAS_ERRNO: declare double @ldexp(double noundef, i32 noundef) [[NOT_READNONE]]
111 // HAS_ERRNO: declare float @ldexpf(float noundef, i32 noundef) [[NOT_READNONE]]
112 // HAS_ERRNO: declare x86_fp80 @ldexpl(x86_fp80 noundef, i32 noundef) [[NOT_READNONE]]
113 // HAS_ERRNO: declare fp128 @ldexpf128(fp128 noundef, i32 noundef) [[NOT_READNONE]]
115 __builtin_modf(f,d); __builtin_modff(f,fp); __builtin_modfl(f,l); __builtin_modff128(f,l);
117 // NO__ERRNO: declare double @modf(double noundef, ptr noundef) [[NOT_READNONE:#[0-9]+]]
118 // NO__ERRNO: declare float @modff(float noundef, ptr noundef) [[NOT_READNONE]]
119 // NO__ERRNO: declare x86_fp80 @modfl(x86_fp80 noundef, ptr noundef) [[NOT_READNONE]]
120 // NO__ERRNO: declare fp128 @modff128(fp128 noundef, ptr noundef) [[NOT_READNONE]]
121 // HAS_ERRNO: declare double @modf(double noundef, ptr noundef) [[NOT_READNONE]]
122 // HAS_ERRNO: declare float @modff(float noundef, ptr noundef) [[NOT_READNONE]]
123 // HAS_ERRNO: declare x86_fp80 @modfl(x86_fp80 noundef, ptr noundef) [[NOT_READNONE]]
124 // HAS_ERRNO: declare fp128 @modff128(fp128 noundef, ptr noundef) [[NOT_READNONE]]
126 __builtin_nan(c); __builtin_nanf(c); __builtin_nanl(c); __builtin_nanf128(c);
128 // NO__ERRNO: declare double @nan(ptr noundef) [[PURE:#[0-9]+]]
129 // NO__ERRNO: declare float @nanf(ptr noundef) [[PURE]]
130 // NO__ERRNO: declare x86_fp80 @nanl(ptr noundef) [[PURE]]
131 // NO__ERRNO: declare fp128 @nanf128(ptr noundef) [[PURE]]
132 // HAS_ERRNO: declare double @nan(ptr noundef) [[PURE:#[0-9]+]]
133 // HAS_ERRNO: declare float @nanf(ptr noundef) [[PURE]]
134 // HAS_ERRNO: declare x86_fp80 @nanl(ptr noundef) [[PURE]]
135 // HAS_ERRNO: declare fp128 @nanf128(ptr noundef) [[PURE]]
137 __builtin_nans(c); __builtin_nansf(c); __builtin_nansl(c); __builtin_nansf128(c);
139 // NO__ERRNO: declare double @nans(ptr noundef) [[PURE]]
140 // NO__ERRNO: declare float @nansf(ptr noundef) [[PURE]]
141 // NO__ERRNO: declare x86_fp80 @nansl(ptr noundef) [[PURE]]
142 // NO__ERRNO: declare fp128 @nansf128(ptr noundef) [[PURE]]
143 // HAS_ERRNO: declare double @nans(ptr noundef) [[PURE]]
144 // HAS_ERRNO: declare float @nansf(ptr noundef) [[PURE]]
145 // HAS_ERRNO: declare x86_fp80 @nansl(ptr noundef) [[PURE]]
146 // HAS_ERRNO: declare fp128 @nansf128(ptr noundef) [[PURE]]
148 __builtin_pow(f,f); __builtin_powf(f,f); __builtin_powl(f,f); __builtin_powf128(f,f);
150 // NO__ERRNO: declare double @llvm.pow.f64(double, double) [[READNONE_INTRINSIC]]
151 // NO__ERRNO: declare float @llvm.pow.f32(float, float) [[READNONE_INTRINSIC]]
152 // NO__ERRNO: declare x86_fp80 @llvm.pow.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC]]
153 // NO__ERRNO: declare fp128 @llvm.pow.f128(fp128, fp128) [[READNONE_INTRINSIC]]
154 // HAS_ERRNO: declare double @pow(double noundef, double noundef) [[NOT_READNONE]]
155 // HAS_ERRNO: declare float @powf(float noundef, float noundef) [[NOT_READNONE]]
156 // HAS_ERRNO: declare x86_fp80 @powl(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]
157 // HAS_ERRNO: declare fp128 @powf128(fp128 noundef, fp128 noundef) [[NOT_READNONE]]
159 __builtin_powi(f,f); __builtin_powif(f,f); __builtin_powil(f,f);
161 // NO__ERRNO: declare double @llvm.powi.f64.i32(double, i32) [[READNONE_INTRINSIC]]
162 // NO__ERRNO: declare float @llvm.powi.f32.i32(float, i32) [[READNONE_INTRINSIC]]
163 // NO__ERRNO: declare x86_fp80 @llvm.powi.f80.i32(x86_fp80, i32) [[READNONE_INTRINSIC]]
164 // HAS_ERRNO: declare double @llvm.powi.f64.i32(double, i32) [[READNONE_INTRINSIC]]
165 // HAS_ERRNO: declare float @llvm.powi.f32.i32(float, i32) [[READNONE_INTRINSIC]]
166 // HAS_ERRNO: declare x86_fp80 @llvm.powi.f80.i32(x86_fp80, i32) [[READNONE_INTRINSIC]]
168 /* math */
169 __builtin_acos(f); __builtin_acosf(f); __builtin_acosl(f); __builtin_acosf128(f);
171 // NO__ERRNO: declare double @llvm.acos.f64(double) [[READNONE_INTRINSIC]]
172 // NO__ERRNO: declare float @llvm.acos.f32(float) [[READNONE_INTRINSIC]]
173 // NO__ERRNO: declare x86_fp80 @llvm.acos.f80(x86_fp80) [[READNONE_INTRINSIC]]
174 // NO__ERRNO: declare fp128 @llvm.acos.f128(fp128) [[READNONE_INTRINSIC]]
175 // HAS_ERRNO: declare double @acos(double noundef) [[NOT_READNONE]]
176 // HAS_ERRNO: declare float @acosf(float noundef) [[NOT_READNONE]]
177 // HAS_ERRNO: declare x86_fp80 @acosl(x86_fp80 noundef) [[NOT_READNONE]]
178 // HAS_ERRNO: declare fp128 @acosf128(fp128 noundef) [[NOT_READNONE]]
180 __builtin_acosh(f); __builtin_acoshf(f); __builtin_acoshl(f); __builtin_acoshf128(f);
182 // NO__ERRNO: declare double @acosh(double noundef) [[READNONE:#[0-9]+]]
183 // NO__ERRNO: declare float @acoshf(float noundef) [[READNONE]]
184 // NO__ERRNO: declare x86_fp80 @acoshl(x86_fp80 noundef) [[READNONE]]
185 // NO__ERRNO: declare fp128 @acoshf128(fp128 noundef) [[READNONE]]
186 // HAS_ERRNO: declare double @acosh(double noundef) [[NOT_READNONE]]
187 // HAS_ERRNO: declare float @acoshf(float noundef) [[NOT_READNONE]]
188 // HAS_ERRNO: declare x86_fp80 @acoshl(x86_fp80 noundef) [[NOT_READNONE]]
189 // HAS_ERRNO: declare fp128 @acoshf128(fp128 noundef) [[NOT_READNONE]]
191 __builtin_asin(f); __builtin_asinf(f); __builtin_asinl(f); __builtin_asinf128(f);
193 // NO__ERRNO: declare double @llvm.asin.f64(double) [[READNONE_INTRINSIC]]
194 // NO__ERRNO: declare float @llvm.asin.f32(float) [[READNONE_INTRINSIC]]
195 // NO__ERRNO: declare x86_fp80 @llvm.asin.f80(x86_fp80) [[READNONE_INTRINSIC]]
196 // NO__ERRNO: declare fp128 @llvm.asin.f128(fp128) [[READNONE_INTRINSIC]]
197 // HAS_ERRNO: declare double @asin(double noundef) [[NOT_READNONE]]
198 // HAS_ERRNO: declare float @asinf(float noundef) [[NOT_READNONE]]
199 // HAS_ERRNO: declare x86_fp80 @asinl(x86_fp80 noundef) [[NOT_READNONE]]
200 // HAS_ERRNO: declare fp128 @asinf128(fp128 noundef) [[NOT_READNONE]]
202 __builtin_asinh(f); __builtin_asinhf(f); __builtin_asinhl(f); __builtin_asinhf128(f);
204 // NO__ERRNO: declare double @asinh(double noundef) [[READNONE]]
205 // NO__ERRNO: declare float @asinhf(float noundef) [[READNONE]]
206 // NO__ERRNO: declare x86_fp80 @asinhl(x86_fp80 noundef) [[READNONE]]
207 // NO__ERRNO: declare fp128 @asinhf128(fp128 noundef) [[READNONE]]
208 // HAS_ERRNO: declare double @asinh(double noundef) [[NOT_READNONE]]
209 // HAS_ERRNO: declare float @asinhf(float noundef) [[NOT_READNONE]]
210 // HAS_ERRNO: declare x86_fp80 @asinhl(x86_fp80 noundef) [[NOT_READNONE]]
211 // HAS_ERRNO: declare fp128 @asinhf128(fp128 noundef) [[NOT_READNONE]]
213 __builtin_atan(f); __builtin_atanf(f); __builtin_atanl(f); __builtin_atanf128(f);
215 // NO__ERRNO: declare double @llvm.atan.f64(double) [[READNONE_INTRINSIC]]
216 // NO__ERRNO: declare float @llvm.atan.f32(float) [[READNONE_INTRINSIC]]
217 // NO__ERRNO: declare x86_fp80 @llvm.atan.f80(x86_fp80) [[READNONE_INTRINSIC]]
218 // NO__ERRNO: declare fp128 @llvm.atan.f128(fp128) [[READNONE_INTRINSIC]]
219 // HAS_ERRNO: declare double @atan(double noundef) [[NOT_READNONE]]
220 // HAS_ERRNO: declare float @atanf(float noundef) [[NOT_READNONE]]
221 // HAS_ERRNO: declare x86_fp80 @atanl(x86_fp80 noundef) [[NOT_READNONE]]
222 // HAS_ERRNO: declare fp128 @atanf128(fp128 noundef) [[NOT_READNONE]]
224 __builtin_atanh(f); __builtin_atanhf(f); __builtin_atanhl(f); __builtin_atanhf128(f);
226 // NO__ERRNO: declare double @atanh(double noundef) [[READNONE]]
227 // NO__ERRNO: declare float @atanhf(float noundef) [[READNONE]]
228 // NO__ERRNO: declare x86_fp80 @atanhl(x86_fp80 noundef) [[READNONE]]
229 // NO__ERRNO: declare fp128 @atanhf128(fp128 noundef) [[READNONE]]
230 // HAS_ERRNO: declare double @atanh(double noundef) [[NOT_READNONE]]
231 // HAS_ERRNO: declare float @atanhf(float noundef) [[NOT_READNONE]]
232 // HAS_ERRNO: declare x86_fp80 @atanhl(x86_fp80 noundef) [[NOT_READNONE]]
233 // HAS_ERRNO: declare fp128 @atanhf128(fp128 noundef) [[NOT_READNONE]]
235 __builtin_cbrt(f); __builtin_cbrtf(f); __builtin_cbrtl(f); __builtin_cbrtf128(f);
237 // NO__ERRNO: declare double @cbrt(double noundef) [[READNONE]]
238 // NO__ERRNO: declare float @cbrtf(float noundef) [[READNONE]]
239 // NO__ERRNO: declare x86_fp80 @cbrtl(x86_fp80 noundef) [[READNONE]]
240 // NO__ERRNO: declare fp128 @cbrtf128(fp128 noundef) [[READNONE]]
241 // HAS_ERRNO: declare double @cbrt(double noundef) [[READNONE:#[0-9]+]]
242 // HAS_ERRNO: declare float @cbrtf(float noundef) [[READNONE]]
243 // HAS_ERRNO: declare x86_fp80 @cbrtl(x86_fp80 noundef) [[READNONE]]
244 // HAS_ERRNO: declare fp128 @cbrtf128(fp128 noundef) [[READNONE]]
246 __builtin_ceil(f); __builtin_ceilf(f); __builtin_ceill(f); __builtin_ceilf128(f);
248 // NO__ERRNO: declare double @llvm.ceil.f64(double) [[READNONE_INTRINSIC]]
249 // NO__ERRNO: declare float @llvm.ceil.f32(float) [[READNONE_INTRINSIC]]
250 // NO__ERRNO: declare x86_fp80 @llvm.ceil.f80(x86_fp80) [[READNONE_INTRINSIC]]
251 // NO__ERRNO: declare fp128 @llvm.ceil.f128(fp128) [[READNONE_INTRINSIC]]
252 // HAS_ERRNO: declare double @llvm.ceil.f64(double) [[READNONE_INTRINSIC]]
253 // HAS_ERRNO: declare float @llvm.ceil.f32(float) [[READNONE_INTRINSIC]]
254 // HAS_ERRNO: declare x86_fp80 @llvm.ceil.f80(x86_fp80) [[READNONE_INTRINSIC]]
255 // HAS_ERRNO: declare fp128 @llvm.ceil.f128(fp128) [[READNONE_INTRINSIC]]
257 __builtin_cos(f); __builtin_cosf(f); __builtin_cosl(f); __builtin_cosf128(f);
259 // NO__ERRNO: declare double @llvm.cos.f64(double) [[READNONE_INTRINSIC]]
260 // NO__ERRNO: declare float @llvm.cos.f32(float) [[READNONE_INTRINSIC]]
261 // NO__ERRNO: declare x86_fp80 @llvm.cos.f80(x86_fp80) [[READNONE_INTRINSIC]]
262 // NO__ERRNO: declare fp128 @llvm.cos.f128(fp128) [[READNONE_INTRINSIC]]
263 // HAS_ERRNO: declare double @cos(double noundef) [[NOT_READNONE]]
264 // HAS_ERRNO: declare float @cosf(float noundef) [[NOT_READNONE]]
265 // HAS_ERRNO: declare x86_fp80 @cosl(x86_fp80 noundef) [[NOT_READNONE]]
266 // HAS_ERRNO: declare fp128 @cosf128(fp128 noundef) [[NOT_READNONE]]
268 __builtin_cosh(f); __builtin_coshf(f); __builtin_coshl(f); __builtin_coshf128(f);
270 // NO__ERRNO: declare double @llvm.cosh.f64(double) [[READNONE_INTRINSIC]]
271 // NO__ERRNO: declare float @llvm.cosh.f32(float) [[READNONE_INTRINSIC]]
272 // NO__ERRNO: declare x86_fp80 @llvm.cosh.f80(x86_fp80) [[READNONE_INTRINSIC]]
273 // NO__ERRNO: declare fp128 @llvm.cosh.f128(fp128) [[READNONE_INTRINSIC]]
274 // HAS_ERRNO: declare double @cosh(double noundef) [[NOT_READNONE]]
275 // HAS_ERRNO: declare float @coshf(float noundef) [[NOT_READNONE]]
276 // HAS_ERRNO: declare x86_fp80 @coshl(x86_fp80 noundef) [[NOT_READNONE]]
277 // HAS_ERRNO: declare fp128 @coshf128(fp128 noundef) [[NOT_READNONE]]
279 __builtin_erf(f); __builtin_erff(f); __builtin_erfl(f); __builtin_erff128(f);
281 // NO__ERRNO: declare double @erf(double noundef) [[READNONE]]
282 // NO__ERRNO: declare float @erff(float noundef) [[READNONE]]
283 // NO__ERRNO: declare x86_fp80 @erfl(x86_fp80 noundef) [[READNONE]]
284 // NO__ERRNO: declare fp128 @erff128(fp128 noundef) [[READNONE]]
285 // HAS_ERRNO: declare double @erf(double noundef) [[NOT_READNONE]]
286 // HAS_ERRNO: declare float @erff(float noundef) [[NOT_READNONE]]
287 // HAS_ERRNO: declare x86_fp80 @erfl(x86_fp80 noundef) [[NOT_READNONE]]
288 // HAS_ERRNO: declare fp128 @erff128(fp128 noundef) [[NOT_READNONE]]
290 __builtin_erfc(f); __builtin_erfcf(f); __builtin_erfcl(f); __builtin_erfcf128(f);
292 // NO__ERRNO: declare double @erfc(double noundef) [[READNONE]]
293 // NO__ERRNO: declare float @erfcf(float noundef) [[READNONE]]
294 // NO__ERRNO: declare x86_fp80 @erfcl(x86_fp80 noundef) [[READNONE]]
295 // NO__ERRNO: declare fp128 @erfcf128(fp128 noundef) [[READNONE]]
296 // HAS_ERRNO: declare double @erfc(double noundef) [[NOT_READNONE]]
297 // HAS_ERRNO: declare float @erfcf(float noundef) [[NOT_READNONE]]
298 // HAS_ERRNO: declare x86_fp80 @erfcl(x86_fp80 noundef) [[NOT_READNONE]]
299 // HAS_ERRNO: declare fp128 @erfcf128(fp128 noundef) [[NOT_READNONE]]
301 __builtin_exp(f); __builtin_expf(f); __builtin_expl(f); __builtin_expf128(f);
303 // NO__ERRNO: declare double @llvm.exp.f64(double) [[READNONE_INTRINSIC]]
304 // NO__ERRNO: declare float @llvm.exp.f32(float) [[READNONE_INTRINSIC]]
305 // NO__ERRNO: declare x86_fp80 @llvm.exp.f80(x86_fp80) [[READNONE_INTRINSIC]]
306 // NO__ERRNO: declare fp128 @llvm.exp.f128(fp128) [[READNONE_INTRINSIC]]
307 // HAS_ERRNO: declare double @exp(double noundef) [[NOT_READNONE]]
308 // HAS_ERRNO: declare float @expf(float noundef) [[NOT_READNONE]]
309 // HAS_ERRNO: declare x86_fp80 @expl(x86_fp80 noundef) [[NOT_READNONE]]
310 // HAS_ERRNO: declare fp128 @expf128(fp128 noundef) [[NOT_READNONE]]
312 __builtin_exp2(f); __builtin_exp2f(f); __builtin_exp2l(f); __builtin_exp2f128(f);
314 // NO__ERRNO: declare double @llvm.exp2.f64(double) [[READNONE_INTRINSIC]]
315 // NO__ERRNO: declare float @llvm.exp2.f32(float) [[READNONE_INTRINSIC]]
316 // NO__ERRNO: declare x86_fp80 @llvm.exp2.f80(x86_fp80) [[READNONE_INTRINSIC]]
317 // NO__ERRNO: declare fp128 @llvm.exp2.f128(fp128) [[READNONE_INTRINSIC]]
318 // HAS_ERRNO: declare double @exp2(double noundef) [[NOT_READNONE]]
319 // HAS_ERRNO: declare float @exp2f(float noundef) [[NOT_READNONE]]
320 // HAS_ERRNO: declare x86_fp80 @exp2l(x86_fp80 noundef) [[NOT_READNONE]]
321 // HAS_ERRNO: declare fp128 @exp2f128(fp128 noundef) [[NOT_READNONE]]
323 __builtin_exp10(f); __builtin_exp10f(f); __builtin_exp10l(f); __builtin_exp10f128(f);
325 // NO__ERRNO: declare double @llvm.exp10.f64(double) [[READNONE_INTRINSIC]]
326 // NO__ERRNO: declare float @llvm.exp10.f32(float) [[READNONE_INTRINSIC]]
327 // NO__ERRNO: declare x86_fp80 @llvm.exp10.f80(x86_fp80) [[READNONE_INTRINSIC]]
328 // NO__ERRNO: declare fp128 @llvm.exp10.f128(fp128) [[READNONE_INTRINSIC]]
329 // HAS_ERRNO: declare double @exp10(double noundef) [[NOT_READNONE]]
330 // HAS_ERRNO: declare float @exp10f(float noundef) [[NOT_READNONE]]
331 // HAS_ERRNO: declare x86_fp80 @exp10l(x86_fp80 noundef) [[NOT_READNONE]]
332 // HAS_ERRNO: declare fp128 @exp10f128(fp128 noundef) [[NOT_READNONE]]
334 __builtin_expm1(f); __builtin_expm1f(f); __builtin_expm1l(f); __builtin_expm1f128(f);
336 // NO__ERRNO: declare double @expm1(double noundef) [[READNONE]]
337 // NO__ERRNO: declare float @expm1f(float noundef) [[READNONE]]
338 // NO__ERRNO: declare x86_fp80 @expm1l(x86_fp80 noundef) [[READNONE]]
339 // NO__ERRNO: declare fp128 @expm1f128(fp128 noundef) [[READNONE]]
340 // HAS_ERRNO: declare double @expm1(double noundef) [[NOT_READNONE]]
341 // HAS_ERRNO: declare float @expm1f(float noundef) [[NOT_READNONE]]
342 // HAS_ERRNO: declare x86_fp80 @expm1l(x86_fp80 noundef) [[NOT_READNONE]]
343 // HAS_ERRNO: declare fp128 @expm1f128(fp128 noundef) [[NOT_READNONE]]
345 __builtin_fdim(f,f); __builtin_fdimf(f,f); __builtin_fdiml(f,f); __builtin_fdimf128(f,f);
347 // NO__ERRNO: declare double @fdim(double noundef, double noundef) [[READNONE]]
348 // NO__ERRNO: declare float @fdimf(float noundef, float noundef) [[READNONE]]
349 // NO__ERRNO: declare x86_fp80 @fdiml(x86_fp80 noundef, x86_fp80 noundef) [[READNONE]]
350 // NO__ERRNO: declare fp128 @fdimf128(fp128 noundef, fp128 noundef) [[READNONE]]
351 // HAS_ERRNO: declare double @fdim(double noundef, double noundef) [[NOT_READNONE]]
352 // HAS_ERRNO: declare float @fdimf(float noundef, float noundef) [[NOT_READNONE]]
353 // HAS_ERRNO: declare x86_fp80 @fdiml(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]
354 // HAS_ERRNO: declare fp128 @fdimf128(fp128 noundef, fp128 noundef) [[NOT_READNONE]]
356 __builtin_floor(f); __builtin_floorf(f); __builtin_floorl(f); __builtin_floorf128(f);
358 // NO__ERRNO: declare double @llvm.floor.f64(double) [[READNONE_INTRINSIC]]
359 // NO__ERRNO: declare float @llvm.floor.f32(float) [[READNONE_INTRINSIC]]
360 // NO__ERRNO: declare x86_fp80 @llvm.floor.f80(x86_fp80) [[READNONE_INTRINSIC]]
361 // NO__ERRNO: declare fp128 @llvm.floor.f128(fp128) [[READNONE_INTRINSIC]]
362 // HAS_ERRNO: declare double @llvm.floor.f64(double) [[READNONE_INTRINSIC]]
363 // HAS_ERRNO: declare float @llvm.floor.f32(float) [[READNONE_INTRINSIC]]
364 // HAS_ERRNO: declare x86_fp80 @llvm.floor.f80(x86_fp80) [[READNONE_INTRINSIC]]
365 // HAS_ERRNO: declare fp128 @llvm.floor.f128(fp128) [[READNONE_INTRINSIC]]
367 __builtin_fma(f,f,f); __builtin_fmaf(f,f,f); __builtin_fmal(f,f,f); __builtin_fmaf128(f,f,f); __builtin_fmaf16(f,f,f);
369 // NO__ERRNO: declare double @llvm.fma.f64(double, double, double) [[READNONE_INTRINSIC]]
370 // NO__ERRNO: declare float @llvm.fma.f32(float, float, float) [[READNONE_INTRINSIC]]
371 // NO__ERRNO: declare x86_fp80 @llvm.fma.f80(x86_fp80, x86_fp80, x86_fp80) [[READNONE_INTRINSIC]]
372 // NO__ERRNO: declare fp128 @llvm.fma.f128(fp128, fp128, fp128) [[READNONE_INTRINSIC]]
373 // NO__ERRONO: declare half @llvm.fma.f16(half, half, half) [[READNONE_INTRINSIC]]
374 // HAS_ERRNO: declare double @fma(double noundef, double noundef, double noundef) [[NOT_READNONE]]
375 // HAS_ERRNO: declare float @fmaf(float noundef, float noundef, float noundef) [[NOT_READNONE]]
376 // HAS_ERRNO: declare x86_fp80 @fmal(x86_fp80 noundef, x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]
377 // HAS_ERRNO: declare fp128 @fmaf128(fp128 noundef, fp128 noundef, fp128 noundef) [[NOT_READNONE]]
378 // HAS_ERRNO: declare half @fmaf16(half noundef, half noundef, half noundef) [[NOT_READNONE]]
380 // On GNU or Win, fma never sets errno, so we can convert to the intrinsic.
382 // HAS_ERRNO_GNU: declare double @llvm.fma.f64(double, double, double) [[READNONE_INTRINSIC:#[0-9]+]]
383 // HAS_ERRNO_GNU: declare float @llvm.fma.f32(float, float, float) [[READNONE_INTRINSIC]]
384 // HAS_ERRNO_GNU: declare x86_fp80 @llvm.fma.f80(x86_fp80, x86_fp80, x86_fp80) [[READNONE_INTRINSIC]]
385 // HAS_ERRNO_GNU: declare half @llvm.fma.f16(half, half, half) [[READNONE_INTRINSIC]]
387 // HAS_ERRNO_WIN: declare double @llvm.fma.f64(double, double, double) [[READNONE_INTRINSIC:#[0-9]+]]
388 // HAS_ERRNO_WIN: declare float @llvm.fma.f32(float, float, float) [[READNONE_INTRINSIC]]
389 // Long double is just double on win, so no f80 use/declaration.
390 // HAS_ERRNO_WIN-NOT: declare x86_fp80 @llvm.fma.f80(x86_fp80, x86_fp80, x86_fp80)
391 // HAS_ERRNO_WIN: declare half @llvm.fma.f16(half, half, half) [[READNONE_INTRINSIC]]
393 __builtin_fmax(f,f); __builtin_fmaxf(f,f); __builtin_fmaxl(f,f); __builtin_fmaxf128(f,f);
395 // NO__ERRNO: declare double @llvm.maxnum.f64(double, double) [[READNONE_INTRINSIC]]
396 // NO__ERRNO: declare float @llvm.maxnum.f32(float, float) [[READNONE_INTRINSIC]]
397 // NO__ERRNO: declare x86_fp80 @llvm.maxnum.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC]]
398 // NO__ERRNO: declare fp128 @llvm.maxnum.f128(fp128, fp128) [[READNONE_INTRINSIC]]
399 // HAS_ERRNO: declare double @llvm.maxnum.f64(double, double) [[READNONE_INTRINSIC]]
400 // HAS_ERRNO: declare float @llvm.maxnum.f32(float, float) [[READNONE_INTRINSIC]]
401 // HAS_ERRNO: declare x86_fp80 @llvm.maxnum.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC]]
402 // HAS_ERRNO: declare fp128 @llvm.maxnum.f128(fp128, fp128) [[READNONE_INTRINSIC]]
404 __builtin_fmin(f,f); __builtin_fminf(f,f); __builtin_fminl(f,f); __builtin_fminf128(f,f);
406 // NO__ERRNO: declare double @llvm.minnum.f64(double, double) [[READNONE_INTRINSIC]]
407 // NO__ERRNO: declare float @llvm.minnum.f32(float, float) [[READNONE_INTRINSIC]]
408 // NO__ERRNO: declare x86_fp80 @llvm.minnum.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC]]
409 // NO__ERRNO: declare fp128 @llvm.minnum.f128(fp128, fp128) [[READNONE_INTRINSIC]]
410 // HAS_ERRNO: declare double @llvm.minnum.f64(double, double) [[READNONE_INTRINSIC]]
411 // HAS_ERRNO: declare float @llvm.minnum.f32(float, float) [[READNONE_INTRINSIC]]
412 // HAS_ERRNO: declare x86_fp80 @llvm.minnum.f80(x86_fp80, x86_fp80) [[READNONE_INTRINSIC]]
413 // HAS_ERRNO: declare fp128 @llvm.minnum.f128(fp128, fp128) [[READNONE_INTRINSIC]]
415 __builtin_hypot(f,f); __builtin_hypotf(f,f); __builtin_hypotl(f,f); __builtin_hypotf128(f,f);
417 // NO__ERRNO: declare double @hypot(double noundef, double noundef) [[READNONE]]
418 // NO__ERRNO: declare float @hypotf(float noundef, float noundef) [[READNONE]]
419 // NO__ERRNO: declare x86_fp80 @hypotl(x86_fp80 noundef, x86_fp80 noundef) [[READNONE]]
420 // NO__ERRNO: declare fp128 @hypotf128(fp128 noundef, fp128 noundef) [[READNONE]]
421 // HAS_ERRNO: declare double @hypot(double noundef, double noundef) [[NOT_READNONE]]
422 // HAS_ERRNO: declare float @hypotf(float noundef, float noundef) [[NOT_READNONE]]
423 // HAS_ERRNO: declare x86_fp80 @hypotl(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]
424 // HAS_ERRNO: declare fp128 @hypotf128(fp128 noundef, fp128 noundef) [[NOT_READNONE]]
426 __builtin_ilogb(f); __builtin_ilogbf(f); __builtin_ilogbl(f); __builtin_ilogbf128(f);
428 // NO__ERRNO: declare i32 @ilogb(double noundef) [[READNONE]]
429 // NO__ERRNO: declare i32 @ilogbf(float noundef) [[READNONE]]
430 // NO__ERRNO: declare i32 @ilogbl(x86_fp80 noundef) [[READNONE]]
431 // NO__ERRNO: declare i32 @ilogbf128(fp128 noundef) [[READNONE]]
432 // HAS_ERRNO: declare i32 @ilogb(double noundef) [[NOT_READNONE]]
433 // HAS_ERRNO: declare i32 @ilogbf(float noundef) [[NOT_READNONE]]
434 // HAS_ERRNO: declare i32 @ilogbl(x86_fp80 noundef) [[NOT_READNONE]]
435 // HAS_ERRNO: declare i32 @ilogbf128(fp128 noundef) [[NOT_READNONE]]
437 __builtin_lgamma(f); __builtin_lgammaf(f); __builtin_lgammal(f); __builtin_lgammaf128(f);
439 // NO__ERRNO: declare double @lgamma(double noundef) [[NOT_READNONE]]
440 // NO__ERRNO: declare float @lgammaf(float noundef) [[NOT_READNONE]]
441 // NO__ERRNO: declare x86_fp80 @lgammal(x86_fp80 noundef) [[NOT_READNONE]]
442 // NO__ERRNO: declare fp128 @lgammaf128(fp128 noundef) [[NOT_READNONE]]
443 // HAS_ERRNO: declare double @lgamma(double noundef) [[NOT_READNONE]]
444 // HAS_ERRNO: declare float @lgammaf(float noundef) [[NOT_READNONE]]
445 // HAS_ERRNO: declare x86_fp80 @lgammal(x86_fp80 noundef) [[NOT_READNONE]]
446 // HAS_ERRNO: declare fp128 @lgammaf128(fp128 noundef) [[NOT_READNONE]]
448 __builtin_llrint(f); __builtin_llrintf(f); __builtin_llrintl(f); __builtin_llrintf128(f);
450 // NO__ERRNO: declare i64 @llvm.llrint.i64.f64(double) [[READNONE_INTRINSIC]]
451 // NO__ERRNO: declare i64 @llvm.llrint.i64.f32(float) [[READNONE_INTRINSIC]]
452 // NO__ERRNO: declare i64 @llvm.llrint.i64.f80(x86_fp80) [[READNONE_INTRINSIC]]
453 // NO__ERRNO: declare i64 @llvm.llrint.i64.f128(fp128) [[READNONE_INTRINSIC]]
454 // HAS_ERRNO: declare i64 @llrint(double noundef) [[NOT_READNONE]]
455 // HAS_ERRNO: declare i64 @llrintf(float noundef) [[NOT_READNONE]]
456 // HAS_ERRNO: declare i64 @llrintl(x86_fp80 noundef) [[NOT_READNONE]]
457 // HAS_ERRNO: declare i64 @llrintf128(fp128 noundef) [[NOT_READNONE]]
459 __builtin_llround(f); __builtin_llroundf(f); __builtin_llroundl(f); __builtin_llroundf128(f);
461 // NO__ERRNO: declare i64 @llvm.llround.i64.f64(double) [[READNONE_INTRINSIC]]
462 // NO__ERRNO: declare i64 @llvm.llround.i64.f32(float) [[READNONE_INTRINSIC]]
463 // NO__ERRNO: declare i64 @llvm.llround.i64.f80(x86_fp80) [[READNONE_INTRINSIC]]
464 // NO__ERRNO: declare i64 @llvm.llround.i64.f128(fp128) [[READNONE_INTRINSIC]]
465 // HAS_ERRNO: declare i64 @llround(double noundef) [[NOT_READNONE]]
466 // HAS_ERRNO: declare i64 @llroundf(float noundef) [[NOT_READNONE]]
467 // HAS_ERRNO: declare i64 @llroundl(x86_fp80 noundef) [[NOT_READNONE]]
468 // HAS_ERRNO: declare i64 @llroundf128(fp128 noundef) [[NOT_READNONE]]
470 __builtin_log(f); __builtin_logf(f); __builtin_logl(f); __builtin_logf128(f);
472 // NO__ERRNO: declare double @llvm.log.f64(double) [[READNONE_INTRINSIC]]
473 // NO__ERRNO: declare float @llvm.log.f32(float) [[READNONE_INTRINSIC]]
474 // NO__ERRNO: declare x86_fp80 @llvm.log.f80(x86_fp80) [[READNONE_INTRINSIC]]
475 // NO__ERRNO: declare fp128 @llvm.log.f128(fp128) [[READNONE_INTRINSIC]]
476 // HAS_ERRNO: declare double @log(double noundef) [[NOT_READNONE]]
477 // HAS_ERRNO: declare float @logf(float noundef) [[NOT_READNONE]]
478 // HAS_ERRNO: declare x86_fp80 @logl(x86_fp80 noundef) [[NOT_READNONE]]
479 // HAS_ERRNO: declare fp128 @logf128(fp128 noundef) [[NOT_READNONE]]
481 __builtin_log10(f); __builtin_log10f(f); __builtin_log10l(f); __builtin_log10f128(f);
483 // NO__ERRNO: declare double @llvm.log10.f64(double) [[READNONE_INTRINSIC]]
484 // NO__ERRNO: declare float @llvm.log10.f32(float) [[READNONE_INTRINSIC]]
485 // NO__ERRNO: declare x86_fp80 @llvm.log10.f80(x86_fp80) [[READNONE_INTRINSIC]]
486 // NO__ERRNO: declare fp128 @llvm.log10.f128(fp128) [[READNONE_INTRINSIC]]
487 // HAS_ERRNO: declare double @log10(double noundef) [[NOT_READNONE]]
488 // HAS_ERRNO: declare float @log10f(float noundef) [[NOT_READNONE]]
489 // HAS_ERRNO: declare x86_fp80 @log10l(x86_fp80 noundef) [[NOT_READNONE]]
490 // HAS_ERRNO: declare fp128 @log10f128(fp128 noundef) [[NOT_READNONE]]
492 __builtin_log1p(f); __builtin_log1pf(f); __builtin_log1pl(f); __builtin_log1pf128(f);
494 // NO__ERRNO: declare double @log1p(double noundef) [[READNONE]]
495 // NO__ERRNO: declare float @log1pf(float noundef) [[READNONE]]
496 // NO__ERRNO: declare x86_fp80 @log1pl(x86_fp80 noundef) [[READNONE]]
497 // NO__ERRNO: declare fp128 @log1pf128(fp128 noundef) [[READNONE]]
498 // HAS_ERRNO: declare double @log1p(double noundef) [[NOT_READNONE]]
499 // HAS_ERRNO: declare float @log1pf(float noundef) [[NOT_READNONE]]
500 // HAS_ERRNO: declare x86_fp80 @log1pl(x86_fp80 noundef) [[NOT_READNONE]]
501 // HAS_ERRNO: declare fp128 @log1pf128(fp128 noundef) [[NOT_READNONE]]
503 __builtin_log2(f); __builtin_log2f(f); __builtin_log2l(f); __builtin_log2f128(f);
505 // NO__ERRNO: declare double @llvm.log2.f64(double) [[READNONE_INTRINSIC]]
506 // NO__ERRNO: declare float @llvm.log2.f32(float) [[READNONE_INTRINSIC]]
507 // NO__ERRNO: declare x86_fp80 @llvm.log2.f80(x86_fp80) [[READNONE_INTRINSIC]]
508 // NO__ERRNO: declare fp128 @llvm.log2.f128(fp128) [[READNONE_INTRINSIC]]
509 // HAS_ERRNO: declare double @log2(double noundef) [[NOT_READNONE]]
510 // HAS_ERRNO: declare float @log2f(float noundef) [[NOT_READNONE]]
511 // HAS_ERRNO: declare x86_fp80 @log2l(x86_fp80 noundef) [[NOT_READNONE]]
512 // HAS_ERRNO: declare fp128 @log2f128(fp128 noundef) [[NOT_READNONE]]
514 __builtin_logb(f); __builtin_logbf(f); __builtin_logbl(f); __builtin_logbf128(f);
516 // NO__ERRNO: declare double @logb(double noundef) [[READNONE]]
517 // NO__ERRNO: declare float @logbf(float noundef) [[READNONE]]
518 // NO__ERRNO: declare x86_fp80 @logbl(x86_fp80 noundef) [[READNONE]]
519 // NO__ERRNO: declare fp128 @logbf128(fp128 noundef) [[READNONE]]
520 // HAS_ERRNO: declare double @logb(double noundef) [[NOT_READNONE]]
521 // HAS_ERRNO: declare float @logbf(float noundef) [[NOT_READNONE]]
522 // HAS_ERRNO: declare x86_fp80 @logbl(x86_fp80 noundef) [[NOT_READNONE]]
523 // HAS_ERRNO: declare fp128 @logbf128(fp128 noundef) [[NOT_READNONE]]
525 __builtin_lrint(f); __builtin_lrintf(f); __builtin_lrintl(f); __builtin_lrintf128(f);
527 // NO__ERRNO: declare i64 @llvm.lrint.i64.f64(double) [[READNONE_INTRINSIC]]
528 // NO__ERRNO: declare i64 @llvm.lrint.i64.f32(float) [[READNONE_INTRINSIC]]
529 // NO__ERRNO: declare i64 @llvm.lrint.i64.f80(x86_fp80) [[READNONE_INTRINSIC]]
530 // NO__ERRNO: declare i64 @llvm.lrint.i64.f128(fp128) [[READNONE_INTRINSIC]]
531 // HAS_ERRNO: declare i64 @lrint(double noundef) [[NOT_READNONE]]
532 // HAS_ERRNO: declare i64 @lrintf(float noundef) [[NOT_READNONE]]
533 // HAS_ERRNO: declare i64 @lrintl(x86_fp80 noundef) [[NOT_READNONE]]
534 // HAS_ERRNO: declare i64 @lrintf128(fp128 noundef) [[NOT_READNONE]]
536 __builtin_lround(f); __builtin_lroundf(f); __builtin_lroundl(f); __builtin_lroundf128(f);
538 // NO__ERRNO: declare i64 @llvm.lround.i64.f64(double) [[READNONE_INTRINSIC]]
539 // NO__ERRNO: declare i64 @llvm.lround.i64.f32(float) [[READNONE_INTRINSIC]]
540 // NO__ERRNO: declare i64 @llvm.lround.i64.f80(x86_fp80) [[READNONE_INTRINSIC]]
541 // NO__ERRNO: declare i64 @llvm.lround.i64.f128(fp128) [[READNONE_INTRINSIC]]
542 // HAS_ERRNO: declare i64 @lround(double noundef) [[NOT_READNONE]]
543 // HAS_ERRNO: declare i64 @lroundf(float noundef) [[NOT_READNONE]]
544 // HAS_ERRNO: declare i64 @lroundl(x86_fp80 noundef) [[NOT_READNONE]]
545 // HAS_ERRNO: declare i64 @lroundf128(fp128 noundef) [[NOT_READNONE]]
547 __builtin_nearbyint(f); __builtin_nearbyintf(f); __builtin_nearbyintl(f); __builtin_nearbyintf128(f);
549 // NO__ERRNO: declare double @llvm.nearbyint.f64(double) [[READNONE_INTRINSIC]]
550 // NO__ERRNO: declare float @llvm.nearbyint.f32(float) [[READNONE_INTRINSIC]]
551 // NO__ERRNO: declare x86_fp80 @llvm.nearbyint.f80(x86_fp80) [[READNONE_INTRINSIC]]
552 // NO__ERRNO: declare fp128 @llvm.nearbyint.f128(fp128) [[READNONE_INTRINSIC]]
553 // HAS_ERRNO: declare double @llvm.nearbyint.f64(double) [[READNONE_INTRINSIC]]
554 // HAS_ERRNO: declare float @llvm.nearbyint.f32(float) [[READNONE_INTRINSIC]]
555 // HAS_ERRNO: declare x86_fp80 @llvm.nearbyint.f80(x86_fp80) [[READNONE_INTRINSIC]]
556 // HAS_ERRNO: declare fp128 @llvm.nearbyint.f128(fp128) [[READNONE_INTRINSIC]]
558 __builtin_nextafter(f,f); __builtin_nextafterf(f,f); __builtin_nextafterl(f,f); __builtin_nextafterf128(f,f);
560 // NO__ERRNO: declare double @nextafter(double noundef, double noundef) [[READNONE]]
561 // NO__ERRNO: declare float @nextafterf(float noundef, float noundef) [[READNONE]]
562 // NO__ERRNO: declare x86_fp80 @nextafterl(x86_fp80 noundef, x86_fp80 noundef) [[READNONE]]
563 // NO__ERRNO: declare fp128 @nextafterf128(fp128 noundef, fp128 noundef) [[READNONE]]
564 // HAS_ERRNO: declare double @nextafter(double noundef, double noundef) [[NOT_READNONE]]
565 // HAS_ERRNO: declare float @nextafterf(float noundef, float noundef) [[NOT_READNONE]]
566 // HAS_ERRNO: declare x86_fp80 @nextafterl(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]
567 // HAS_ERRNO: declare fp128 @nextafterf128(fp128 noundef, fp128 noundef) [[NOT_READNONE]]
569 __builtin_nexttoward(f,f); __builtin_nexttowardf(f,f);__builtin_nexttowardl(f,f); __builtin_nexttowardf128(f,f);
571 // NO__ERRNO: declare double @nexttoward(double noundef, x86_fp80 noundef) [[READNONE]]
572 // NO__ERRNO: declare float @nexttowardf(float noundef, x86_fp80 noundef) [[READNONE]]
573 // NO__ERRNO: declare x86_fp80 @nexttowardl(x86_fp80 noundef, x86_fp80 noundef) [[READNONE]]
574 // NO__ERRNO: declare fp128 @nexttowardf128(fp128 noundef, fp128 noundef) [[READNONE]]
575 // HAS_ERRNO: declare double @nexttoward(double noundef, x86_fp80 noundef) [[NOT_READNONE]]
576 // HAS_ERRNO: declare float @nexttowardf(float noundef, x86_fp80 noundef) [[NOT_READNONE]]
577 // HAS_ERRNO: declare x86_fp80 @nexttowardl(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]
578 // HAS_ERRNO: declare fp128 @nexttowardf128(fp128 noundef, fp128 noundef) [[NOT_READNONE]]
580 __builtin_remainder(f,f); __builtin_remainderf(f,f); __builtin_remainderl(f,f); __builtin_remainderf128(f,f);
582 // NO__ERRNO: declare double @remainder(double noundef, double noundef) [[READNONE]]
583 // NO__ERRNO: declare float @remainderf(float noundef, float noundef) [[READNONE]]
584 // NO__ERRNO: declare x86_fp80 @remainderl(x86_fp80 noundef, x86_fp80 noundef) [[READNONE]]
585 // NO__ERRNO: declare fp128 @remainderf128(fp128 noundef, fp128 noundef) [[READNONE]]
586 // HAS_ERRNO: declare double @remainder(double noundef, double noundef) [[NOT_READNONE]]
587 // HAS_ERRNO: declare float @remainderf(float noundef, float noundef) [[NOT_READNONE]]
588 // HAS_ERRNO: declare x86_fp80 @remainderl(x86_fp80 noundef, x86_fp80 noundef) [[NOT_READNONE]]
589 // HAS_ERRNO: declare fp128 @remainderf128(fp128 noundef, fp128 noundef) [[NOT_READNONE]]
591 __builtin_remquo(f,f,i); __builtin_remquof(f,f,i); __builtin_remquol(f,f,i); __builtin_remquof128(f,f,i);
593 // NO__ERRNO: declare double @remquo(double noundef, double noundef, ptr noundef) [[NOT_READNONE]]
594 // NO__ERRNO: declare float @remquof(float noundef, float noundef, ptr noundef) [[NOT_READNONE]]
595 // NO__ERRNO: declare x86_fp80 @remquol(x86_fp80 noundef, x86_fp80 noundef, ptr noundef) [[NOT_READNONE]]
596 // NO__ERRNO: declare fp128 @remquof128(fp128 noundef, fp128 noundef, ptr noundef) [[NOT_READNONE]]
597 // HAS_ERRNO: declare double @remquo(double noundef, double noundef, ptr noundef) [[NOT_READNONE]]
598 // HAS_ERRNO: declare float @remquof(float noundef, float noundef, ptr noundef) [[NOT_READNONE]]
599 // HAS_ERRNO: declare x86_fp80 @remquol(x86_fp80 noundef, x86_fp80 noundef, ptr noundef) [[NOT_READNONE]]
600 // HAS_ERRNO: declare fp128 @remquof128(fp128 noundef, fp128 noundef, ptr noundef) [[NOT_READNONE]]
602 __builtin_rint(f); __builtin_rintf(f); __builtin_rintl(f); __builtin_rintf128(f);
604 // NO__ERRNO: declare double @llvm.rint.f64(double) [[READNONE_INTRINSIC]]
605 // NO__ERRNO: declare float @llvm.rint.f32(float) [[READNONE_INTRINSIC]]
606 // NO__ERRNO: declare x86_fp80 @llvm.rint.f80(x86_fp80) [[READNONE_INTRINSIC]]
607 // NO__ERRNO: declare fp128 @llvm.rint.f128(fp128) [[READNONE_INTRINSIC]]
608 // HAS_ERRNO: declare double @llvm.rint.f64(double) [[READNONE_INTRINSIC]]
609 // HAS_ERRNO: declare float @llvm.rint.f32(float) [[READNONE_INTRINSIC]]
610 // HAS_ERRNO: declare x86_fp80 @llvm.rint.f80(x86_fp80) [[READNONE_INTRINSIC]]
611 // HAS_ERRNO: declare fp128 @llvm.rint.f128(fp128) [[READNONE_INTRINSIC]]
613 __builtin_round(f); __builtin_roundf(f); __builtin_roundl(f); __builtin_roundf128(f);
615 // NO__ERRNO: declare double @llvm.round.f64(double) [[READNONE_INTRINSIC]]
616 // NO__ERRNO: declare float @llvm.round.f32(float) [[READNONE_INTRINSIC]]
617 // NO__ERRNO: declare x86_fp80 @llvm.round.f80(x86_fp80) [[READNONE_INTRINSIC]]
618 // NO__ERRNO: declare fp128 @llvm.round.f128(fp128) [[READNONE_INTRINSIC]]
619 // HAS_ERRNO: declare double @llvm.round.f64(double) [[READNONE_INTRINSIC]]
620 // HAS_ERRNO: declare float @llvm.round.f32(float) [[READNONE_INTRINSIC]]
621 // HAS_ERRNO: declare x86_fp80 @llvm.round.f80(x86_fp80) [[READNONE_INTRINSIC]]
622 // HAS_ERRNO: declare fp128 @llvm.round.f128(fp128) [[READNONE_INTRINSIC]]
624 __builtin_scalbln(f,f); __builtin_scalblnf(f,f); __builtin_scalblnl(f,f); __builtin_scalblnf128(f,f);
626 // NO__ERRNO: declare double @scalbln(double noundef, i64 noundef) [[READNONE]]
627 // NO__ERRNO: declare float @scalblnf(float noundef, i64 noundef) [[READNONE]]
628 // NO__ERRNO: declare x86_fp80 @scalblnl(x86_fp80 noundef, i64 noundef) [[READNONE]]
629 // NO__ERRNO: declare fp128 @scalblnf128(fp128 noundef, i64 noundef) [[READNONE]]
630 // HAS_ERRNO: declare double @scalbln(double noundef, i64 noundef) [[NOT_READNONE]]
631 // HAS_ERRNO: declare float @scalblnf(float noundef, i64 noundef) [[NOT_READNONE]]
632 // HAS_ERRNO: declare x86_fp80 @scalblnl(x86_fp80 noundef, i64 noundef) [[NOT_READNONE]]
633 // HAS_ERRNO: declare fp128 @scalblnf128(fp128 noundef, i64 noundef) [[NOT_READNONE]]
635 __builtin_scalbn(f,f); __builtin_scalbnf(f,f); __builtin_scalbnl(f,f); __builtin_scalbnf128(f,f);
637 // NO__ERRNO: declare double @scalbn(double noundef, i32 noundef) [[READNONE]]
638 // NO__ERRNO: declare float @scalbnf(float noundef, i32 noundef) [[READNONE]]
639 // NO__ERRNO: declare x86_fp80 @scalbnl(x86_fp80 noundef, i32 noundef) [[READNONE]]
640 // NO__ERRNO: declare fp128 @scalbnf128(fp128 noundef, i32 noundef) [[READNONE]]
641 // HAS_ERRNO: declare double @scalbn(double noundef, i32 noundef) [[NOT_READNONE]]
642 // HAS_ERRNO: declare float @scalbnf(float noundef, i32 noundef) [[NOT_READNONE]]
643 // HAS_ERRNO: declare x86_fp80 @scalbnl(x86_fp80 noundef, i32 noundef) [[NOT_READNONE]]
644 // HAS_ERRNO: declare fp128 @scalbnf128(fp128 noundef, i32 noundef) [[NOT_READNONE]]
646 __builtin_sin(f); __builtin_sinf(f); __builtin_sinl(f); __builtin_sinf128(f);
648 // NO__ERRNO: declare double @llvm.sin.f64(double) [[READNONE_INTRINSIC]]
649 // NO__ERRNO: declare float @llvm.sin.f32(float) [[READNONE_INTRINSIC]]
650 // NO__ERRNO: declare x86_fp80 @llvm.sin.f80(x86_fp80) [[READNONE_INTRINSIC]]
651 // NO__ERRNO: declare fp128 @llvm.sin.f128(fp128) [[READNONE_INTRINSIC]]
652 // HAS_ERRNO: declare double @sin(double noundef) [[NOT_READNONE]]
653 // HAS_ERRNO: declare float @sinf(float noundef) [[NOT_READNONE]]
654 // HAS_ERRNO: declare x86_fp80 @sinl(x86_fp80 noundef) [[NOT_READNONE]]
655 // HAS_ERRNO: declare fp128 @sinf128(fp128 noundef) [[NOT_READNONE]]
657 __builtin_sinh(f); __builtin_sinhf(f); __builtin_sinhl(f); __builtin_sinhf128(f);
659 // NO__ERRNO: declare double @llvm.sinh.f64(double) [[READNONE_INTRINSIC]]
660 // NO__ERRNO: declare float @llvm.sinh.f32(float) [[READNONE_INTRINSIC]]
661 // NO__ERRNO: declare x86_fp80 @llvm.sinh.f80(x86_fp80) [[READNONE_INTRINSIC]]
662 // NO__ERRNO: declare fp128 @llvm.sinh.f128(fp128) [[READNONE_INTRINSIC]]
663 // HAS_ERRNO: declare double @sinh(double noundef) [[NOT_READNONE]]
664 // HAS_ERRNO: declare float @sinhf(float noundef) [[NOT_READNONE]]
665 // HAS_ERRNO: declare x86_fp80 @sinhl(x86_fp80 noundef) [[NOT_READNONE]]
666 // HAS_ERRNO: declare fp128 @sinhf128(fp128 noundef) [[NOT_READNONE]]
668 __builtin_sqrt(f); __builtin_sqrtf(f); __builtin_sqrtl(f); __builtin_sqrtf128(f);
670 // NO__ERRNO: declare double @llvm.sqrt.f64(double) [[READNONE_INTRINSIC]]
671 // NO__ERRNO: declare float @llvm.sqrt.f32(float) [[READNONE_INTRINSIC]]
672 // NO__ERRNO: declare x86_fp80 @llvm.sqrt.f80(x86_fp80) [[READNONE_INTRINSIC]]
673 // NO__ERRNO: declare fp128 @llvm.sqrt.f128(fp128) [[READNONE_INTRINSIC]]
674 // HAS_ERRNO: declare double @sqrt(double noundef) [[NOT_READNONE]]
675 // HAS_ERRNO: declare float @sqrtf(float noundef) [[NOT_READNONE]]
676 // HAS_ERRNO: declare x86_fp80 @sqrtl(x86_fp80 noundef) [[NOT_READNONE]]
677 // HAS_ERRNO: declare fp128 @sqrtf128(fp128 noundef) [[NOT_READNONE]]
679 __builtin_tan(f); __builtin_tanf(f); __builtin_tanl(f); __builtin_tanf128(f);
681 // NO__ERRNO: declare double @llvm.tan.f64(double) [[READNONE_INTRINSIC]]
682 // NO__ERRNO: declare float @llvm.tan.f32(float) [[READNONE_INTRINSIC]]
683 // NO__ERRNO: declare x86_fp80 @llvm.tan.f80(x86_fp80) [[READNONE_INTRINSIC]]
684 // NO__ERRNO: declare fp128 @llvm.tan.f128(fp128) [[READNONE_INTRINSIC]]
685 // HAS_ERRNO: declare double @tan(double noundef) [[NOT_READNONE]]
686 // HAS_ERRNO: declare float @tanf(float noundef) [[NOT_READNONE]]
687 // HAS_ERRNO: declare x86_fp80 @tanl(x86_fp80 noundef) [[NOT_READNONE]]
688 // HAS_ERRNO: declare fp128 @tanf128(fp128 noundef) [[NOT_READNONE]]
690 __builtin_tanh(f); __builtin_tanhf(f); __builtin_tanhl(f); __builtin_tanhf128(f);
692 // NO__ERRNO: declare double @llvm.tanh.f64(double) [[READNONE_INTRINSIC]]
693 // NO__ERRNO: declare float @llvm.tanh.f32(float) [[READNONE_INTRINSIC]]
694 // NO__ERRNO: declare x86_fp80 @llvm.tanh.f80(x86_fp80) [[READNONE_INTRINSIC]]
695 // NO__ERRNO: declare fp128 @llvm.tanh.f128(fp128) [[READNONE_INTRINSIC]]
696 // HAS_ERRNO: declare double @tanh(double noundef) [[NOT_READNONE]]
697 // HAS_ERRNO: declare float @tanhf(float noundef) [[NOT_READNONE]]
698 // HAS_ERRNO: declare x86_fp80 @tanhl(x86_fp80 noundef) [[NOT_READNONE]]
699 // HAS_ERRNO: declare fp128 @tanhf128(fp128 noundef) [[NOT_READNONE]]
701 __builtin_tgamma(f); __builtin_tgammaf(f); __builtin_tgammal(f); __builtin_tgammaf128(f);
703 // NO__ERRNO: declare double @tgamma(double noundef) [[READNONE]]
704 // NO__ERRNO: declare float @tgammaf(float noundef) [[READNONE]]
705 // NO__ERRNO: declare x86_fp80 @tgammal(x86_fp80 noundef) [[READNONE]]
706 // NO__ERRNO: declare fp128 @tgammaf128(fp128 noundef) [[READNONE]]
707 // HAS_ERRNO: declare double @tgamma(double noundef) [[NOT_READNONE]]
708 // HAS_ERRNO: declare float @tgammaf(float noundef) [[NOT_READNONE]]
709 // HAS_ERRNO: declare x86_fp80 @tgammal(x86_fp80 noundef) [[NOT_READNONE]]
710 // HAS_ERRNO: declare fp128 @tgammaf128(fp128 noundef) [[NOT_READNONE]]
712 __builtin_trunc(f); __builtin_truncf(f); __builtin_truncl(f); __builtin_truncf128(f);
714 // NO__ERRNO: declare double @llvm.trunc.f64(double) [[READNONE_INTRINSIC]]
715 // NO__ERRNO: declare float @llvm.trunc.f32(float) [[READNONE_INTRINSIC]]
716 // NO__ERRNO: declare x86_fp80 @llvm.trunc.f80(x86_fp80) [[READNONE_INTRINSIC]]
717 // NO__ERRNO: declare fp128 @llvm.trunc.f128(fp128) [[READNONE_INTRINSIC]]
718 // HAS_ERRNO: declare double @llvm.trunc.f64(double) [[READNONE_INTRINSIC]]
719 // HAS_ERRNO: declare float @llvm.trunc.f32(float) [[READNONE_INTRINSIC]]
720 // HAS_ERRNO: declare x86_fp80 @llvm.trunc.f80(x86_fp80) [[READNONE_INTRINSIC]]
721 // HAS_ERRNO: declare fp128 @llvm.trunc.f128(fp128) [[READNONE_INTRINSIC]]
724 // NO__ERRNO: attributes [[READNONE_INTRINSIC]] = { {{.*}}memory(none){{.*}} }
725 // NO__ERRNO: attributes [[NOT_READNONE]] = { nounwind {{.*}} }
726 // NO__ERRNO: attributes [[PURE]] = { {{.*}}memory(read){{.*}} }
727 // NO__ERRNO: attributes [[READNONE]] = { {{.*}}memory(none){{.*}} }
729 // HAS_ERRNO: attributes [[NOT_READNONE]] = { nounwind {{.*}} }
730 // HAS_ERRNO: attributes [[READNONE_INTRINSIC]] = { {{.*}}memory(none){{.*}} }
731 // HAS_ERRNO: attributes [[PURE]] = { {{.*}}memory(read){{.*}} }
732 // HAS_ERRNO: attributes [[READNONE]] = { {{.*}}memory(none){{.*}} }
734 // HAS_ERRNO_GNU: attributes [[READNONE_INTRINSIC]] = { {{.*}}memory(none){{.*}} }
735 // HAS_ERRNO_WIN: attributes [[READNONE_INTRINSIC]] = { {{.*}}memory(none){{.*}} }