1
1
// makes configuration easier
2
2
#![ allow( unused_macros) ]
3
+ #![ feature( f128) ]
3
4
4
5
use testcrate:: * ;
5
6
@@ -238,12 +239,15 @@ macro_rules! pow {
238
239
b < $tolerance
239
240
} else {
240
241
let quo = b / a;
241
- ( quo < ( 1. + $tolerance) ) && ( quo > ( 1. - $tolerance) )
242
+ // FIXME(f16_f128): we do this to block const eval which currently
243
+ // ICEs on f128. Change this once it works correctly.
244
+ ( quo < ( 1. + black_box( $tolerance) ) )
245
+ && ( quo > ( 1. - black_box( $tolerance) ) )
242
246
}
243
247
} ;
244
248
if !good {
245
249
panic!(
246
- "{}({}, {}): std: {}, builtins: {}" ,
250
+ "{}({:? }, {:? }): std: {:? }, builtins: {:? }" ,
247
251
stringify!( $fn) , x, n, tmp0, tmp1
248
252
) ;
249
253
}
@@ -258,8 +262,32 @@ macro_rules! pow {
258
262
mod float_pow {
259
263
use super :: * ;
260
264
265
+ fn black_box < T > ( val : T ) -> T {
266
+ val
267
+ }
268
+
261
269
pow ! {
262
270
f32 , 1e-4 , __powisf2;
263
271
f64 , 1e-12 , __powidf2;
264
272
}
265
273
}
274
+
275
+ #[ cfg( not( all( target_arch = "x86" , not( target_feature = "sse" ) ) ) ) ]
276
+ #[ cfg( not( any( feature = "no-f16-f128" , feature = "no-sys-f128" ) ) ) ]
277
+ mod float_pow_f128 {
278
+ use super :: * ;
279
+ use core:: hint:: black_box;
280
+
281
+ // Windows can't link the required arithmetic functions. See
282
+ // <https://github.com/rust-lang/compiler-builtins/pull/614#issuecomment-2118636613>
283
+ #[ cfg( not( target_family = "windows" ) ) ]
284
+ #[ cfg( not( any( target_arch = "powerpc" , target_arch = "powerpc64" ) ) ) ]
285
+ pow ! {
286
+ f128, 1e-36 , __powitf2;
287
+ }
288
+
289
+ #[ cfg( any( target_arch = "powerpc" , target_arch = "powerpc64" ) ) ]
290
+ pow ! {
291
+ f128, 1e-36 , __powikf2;
292
+ }
293
+ }
0 commit comments