File tree Expand file tree Collapse file tree 3 files changed +25
-22
lines changed Expand file tree Collapse file tree 3 files changed +25
-22
lines changed Original file line number Diff line number Diff line change @@ -46,13 +46,6 @@ extern "platform-intrinsic" {
46
46
/// fabs
47
47
pub ( crate ) fn simd_fabs < T > ( x : T ) -> T ;
48
48
49
- /// fsqrt
50
- #[ cfg( feature = "std" ) ]
51
- pub ( crate ) fn simd_fsqrt < T > ( x : T ) -> T ;
52
-
53
- /// fma
54
- pub ( crate ) fn simd_fma < T > ( x : T , y : T , z : T ) -> T ;
55
-
56
49
pub ( crate ) fn simd_eq < T , U > ( x : T , y : T ) -> U ;
57
50
pub ( crate ) fn simd_ne < T , U > ( x : T , y : T ) -> U ;
58
51
pub ( crate ) fn simd_lt < T , U > ( x : T , y : T ) -> U ;
@@ -110,6 +103,12 @@ mod std {
110
103
111
104
// trunc
112
105
pub ( crate ) fn simd_trunc < T > ( x : T ) -> T ;
106
+
107
+ // fsqrt
108
+ pub ( crate ) fn simd_fsqrt < T > ( x : T ) -> T ;
109
+
110
+ // fma
111
+ pub ( crate ) fn simd_fma < T > ( x : T , y : T , z : T ) -> T ;
113
112
}
114
113
}
115
114
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ macro_rules! impl_float_vector {
42
42
/// architecture has a dedicated `fma` CPU instruction. However, this is not always
43
43
/// true, and will be heavily dependent on designing algorithms with specific target
44
44
/// hardware in mind.
45
+ #[ cfg( feature = "std" ) ]
45
46
#[ inline]
46
47
pub fn mul_add( self , a: Self , b: Self ) -> Self {
47
48
unsafe { intrinsics:: simd_fma( self , a, b) }
Original file line number Diff line number Diff line change @@ -437,14 +437,6 @@ macro_rules! impl_float_tests {
437
437
)
438
438
}
439
439
440
- fn mul_add<const LANES : usize >( ) {
441
- test_helpers:: test_ternary_elementwise(
442
- & Vector :: <LANES >:: mul_add,
443
- & Scalar :: mul_add,
444
- & |_, _, _| true ,
445
- )
446
- }
447
-
448
440
fn recip<const LANES : usize >( ) {
449
441
test_helpers:: test_unary_elementwise(
450
442
& Vector :: <LANES >:: recip,
@@ -601,13 +593,24 @@ macro_rules! impl_float_tests {
601
593
}
602
594
603
595
#[ cfg( feature = "std" ) ]
604
- test_helpers:: test_lanes! {
605
- fn sqrt<const LANES : usize >( ) {
606
- test_helpers:: test_unary_elementwise(
607
- & Vector :: <LANES >:: sqrt,
608
- & Scalar :: sqrt,
609
- & |_| true ,
610
- )
596
+ mod std {
597
+ use super :: * ;
598
+ test_helpers:: test_lanes! {
599
+ fn sqrt<const LANES : usize >( ) {
600
+ test_helpers:: test_unary_elementwise(
601
+ & Vector :: <LANES >:: sqrt,
602
+ & Scalar :: sqrt,
603
+ & |_| true ,
604
+ )
605
+ }
606
+
607
+ fn mul_add<const LANES : usize >( ) {
608
+ test_helpers:: test_ternary_elementwise(
609
+ & Vector :: <LANES >:: mul_add,
610
+ & Scalar :: mul_add,
611
+ & |_, _, _| true ,
612
+ )
613
+ }
611
614
}
612
615
}
613
616
}
You can’t perform that action at this time.
0 commit comments