1
1
// makes configuration easier
2
2
#![ allow( unused_macros) ]
3
+ #![ feature( f128) ]
3
4
4
5
use testcrate:: * ;
5
6
@@ -122,12 +123,15 @@ macro_rules! pow {
122
123
b < $tolerance
123
124
} else {
124
125
let quo = b / a;
125
- ( quo < ( 1. + $tolerance) ) && ( quo > ( 1. - $tolerance) )
126
+ // FIXME(f16_f128): we do this to block const eval which currently
127
+ // ICEs on f128. Change this once it works correctly.
128
+ ( quo < ( 1. + black_box( $tolerance) ) )
129
+ && ( quo > ( 1. - black_box( $tolerance) ) )
126
130
}
127
131
} ;
128
132
if !good {
129
133
panic!(
130
- "{}({}, {}): std: {}, builtins: {}" ,
134
+ "{}({:? }, {:? }): std: {:? }, builtins: {:? }" ,
131
135
stringify!( $fn) , x, n, tmp0, tmp1
132
136
) ;
133
137
}
@@ -142,8 +146,32 @@ macro_rules! pow {
142
146
mod float_pow {
143
147
use super :: * ;
144
148
149
+ fn black_box < T > ( val : T ) -> T {
150
+ val
151
+ }
152
+
145
153
pow ! {
146
154
f32 , 1e-4 , __powisf2;
147
155
f64 , 1e-12 , __powidf2;
148
156
}
149
157
}
158
+
159
+ #[ cfg( not( all( target_arch = "x86" , not( target_feature = "sse" ) ) ) ) ]
160
+ #[ cfg( not( any( feature = "no-f16-f128" , feature = "no-sys-f128" ) ) ) ]
161
+ mod float_pow_f128 {
162
+ use super :: * ;
163
+ use core:: hint:: black_box;
164
+
165
+ // Windows can't link the required arithmetic functions. See
166
+ // <https://github.com/rust-lang/compiler-builtins/pull/614#issuecomment-2118636613>
167
+ #[ cfg( not( target_family = "windows" ) ) ]
168
+ #[ cfg( not( any( target_arch = "powerpc" , target_arch = "powerpc64" ) ) ) ]
169
+ pow ! {
170
+ f128, 1e-36 , __powitf2;
171
+ }
172
+
173
+ #[ cfg( any( target_arch = "powerpc" , target_arch = "powerpc64" ) ) ]
174
+ pow ! {
175
+ f128, 1e-36 , __powikf2;
176
+ }
177
+ }
0 commit comments