@@ -15,12 +15,10 @@ use core::intrinsics::fabsf32;
15
15
use core:: intrinsics:: fabsf64;
16
16
use core:: intrinsics:: floorf32;
17
17
use core:: intrinsics:: floorf64;
18
- use core:: intrinsics:: nearbyintf32;
19
- use core:: intrinsics:: nearbyintf64;
20
18
use core:: intrinsics:: rintf32;
21
19
use core:: intrinsics:: rintf64;
22
- use core:: intrinsics:: roundevenf32 ;
23
- use core:: intrinsics:: roundevenf64 ;
20
+ use core:: intrinsics:: round_ties_even_f32 ;
21
+ use core:: intrinsics:: round_ties_even_f64 ;
24
22
use core:: intrinsics:: roundf32;
25
23
use core:: intrinsics:: roundf64;
26
24
use core:: intrinsics:: truncf32;
@@ -37,10 +35,6 @@ fn main() {
37
35
test_eq ! ( unsafe { fabsf64( x) } , black_box( x) ) ;
38
36
test_eq ! ( unsafe { fabsf64( y) } , black_box( -y) ) ;
39
37
test ! ( unsafe { fabsf64( f64 :: NAN ) } . is_nan( ) ) ;
40
- test_eq ! ( unsafe { nearbyintf32( 2.5f32 ) } , black_box( 2.0 ) ) ;
41
- test_eq ! ( unsafe { nearbyintf32( 3.5f32 ) } , black_box( 4.0 ) ) ;
42
- test_eq ! ( unsafe { nearbyintf64( 2.5f64 ) } , black_box( 2.0 ) ) ;
43
- test_eq ! ( unsafe { nearbyintf64( 3.5f64 ) } , black_box( 4.0 ) ) ;
44
38
let f = 3.3_f32 ;
45
39
let g = -3.3_f32 ;
46
40
let h = 3.5_f32 ;
@@ -61,18 +55,18 @@ fn main() {
61
55
let g = -3.3_f32 ;
62
56
let h = 3.5_f32 ;
63
57
let i = 4.5_f32 ;
64
- test_eq ! ( unsafe { roundevenf32 ( f) } , black_box( 3.0 ) ) ;
65
- test_eq ! ( unsafe { roundevenf32 ( g) } , black_box( -3.0 ) ) ;
66
- test_eq ! ( unsafe { roundevenf32 ( h) } , black_box( 4.0 ) ) ;
67
- test_eq ! ( unsafe { roundevenf32 ( i) } , black_box( 4.0 ) ) ;
58
+ test_eq ! ( unsafe { round_ties_even_f32 ( f) } , black_box( 3.0 ) ) ;
59
+ test_eq ! ( unsafe { round_ties_even_f32 ( g) } , black_box( -3.0 ) ) ;
60
+ test_eq ! ( unsafe { round_ties_even_f32 ( h) } , black_box( 4.0 ) ) ;
61
+ test_eq ! ( unsafe { round_ties_even_f32 ( i) } , black_box( 4.0 ) ) ;
68
62
let f = 3.3_f64 ;
69
63
let g = -3.3_f64 ;
70
64
let h = 3.5_f64 ;
71
65
let i = 4.5_f64 ;
72
- test_eq ! ( unsafe { roundevenf64 ( f) } , black_box( 3.0 ) ) ;
73
- test_eq ! ( unsafe { roundevenf64 ( g) } , black_box( -3.0 ) ) ;
74
- test_eq ! ( unsafe { roundevenf64 ( h) } , black_box( 4.0 ) ) ;
75
- test_eq ! ( unsafe { roundevenf64 ( i) } , black_box( 4.0 ) ) ;
66
+ test_eq ! ( unsafe { round_ties_even_f64 ( f) } , black_box( 3.0 ) ) ;
67
+ test_eq ! ( unsafe { round_ties_even_f64 ( g) } , black_box( -3.0 ) ) ;
68
+ test_eq ! ( unsafe { round_ties_even_f64 ( h) } , black_box( 4.0 ) ) ;
69
+ test_eq ! ( unsafe { round_ties_even_f64 ( i) } , black_box( 4.0 ) ) ;
76
70
let f = 3.3_f32 ;
77
71
let g = -3.3_f32 ;
78
72
let h = -3.7_f32 ;
0 commit comments