@@ -44,7 +44,7 @@ use crate::sealed::Sealed;
44
44
/// For now this trait is available to permit experimentation with SIMD float
45
45
/// operations that may lack hardware support, such as `mul_add`.
46
46
pub trait StdFloat : Sealed + Sized {
47
- /// Fused multiply-add. Computes `(self * a) + b` with only one rounding error,
47
+ /// Elementwise fused multiply-add. Computes `(self * a) + b` with only one rounding error,
48
48
/// yielding a more accurate result than an unfused multiply-add.
49
49
///
50
50
/// Using `mul_add` *may* be more performant than an unfused multiply-add if the target
@@ -57,87 +57,87 @@ pub trait StdFloat: Sealed + Sized {
57
57
unsafe { intrinsics:: simd_fma ( self , a, b) }
58
58
}
59
59
60
- /// Produces a vector where every lane has the square root value
61
- /// of the equivalently-indexed lane in `self`
60
+ /// Produces a vector where every element has the square root value
61
+ /// of the equivalently-indexed element in `self`
62
62
#[ inline]
63
63
#[ must_use = "method returns a new vector and does not mutate the original value" ]
64
64
fn sqrt ( self ) -> Self {
65
65
unsafe { intrinsics:: simd_fsqrt ( self ) }
66
66
}
67
67
68
- /// Produces a vector where every lane has the sine of the value
69
- /// in the equivalently-indexed lane in `self`.
68
+ /// Produces a vector where every element has the sine of the value
69
+ /// in the equivalently-indexed element in `self`.
70
70
#[ inline]
71
71
#[ must_use = "method returns a new vector and does not mutate the original value" ]
72
72
fn sin ( self ) -> Self {
73
73
unsafe { intrinsics:: simd_fsin ( self ) }
74
74
}
75
75
76
- /// Produces a vector where every lane has the cosine of the value
77
- /// in the equivalently-indexed lane in `self`.
76
+ /// Produces a vector where every element has the cosine of the value
77
+ /// in the equivalently-indexed element in `self`.
78
78
#[ inline]
79
79
#[ must_use = "method returns a new vector and does not mutate the original value" ]
80
80
fn cos ( self ) -> Self {
81
81
unsafe { intrinsics:: simd_fcos ( self ) }
82
82
}
83
83
84
- /// Produces a vector where every lane has the exponential (base e) of the value
85
- /// in the equivalently-indexed lane in `self`.
84
+ /// Produces a vector where every element has the exponential (base e) of the value
85
+ /// in the equivalently-indexed element in `self`.
86
86
#[ inline]
87
87
#[ must_use = "method returns a new vector and does not mutate the original value" ]
88
88
fn exp ( self ) -> Self {
89
89
unsafe { intrinsics:: simd_fexp ( self ) }
90
90
}
91
91
92
- /// Produces a vector where every lane has the exponential (base 2) of the value
93
- /// in the equivalently-indexed lane in `self`.
92
+ /// Produces a vector where every element has the exponential (base 2) of the value
93
+ /// in the equivalently-indexed element in `self`.
94
94
#[ inline]
95
95
#[ must_use = "method returns a new vector and does not mutate the original value" ]
96
96
fn exp2 ( self ) -> Self {
97
97
unsafe { intrinsics:: simd_fexp2 ( self ) }
98
98
}
99
99
100
- /// Produces a vector where every lane has the natural logarithm of the value
101
- /// in the equivalently-indexed lane in `self`.
100
+ /// Produces a vector where every element has the natural logarithm of the value
101
+ /// in the equivalently-indexed element in `self`.
102
102
#[ inline]
103
103
#[ must_use = "method returns a new vector and does not mutate the original value" ]
104
104
fn ln ( self ) -> Self {
105
105
unsafe { intrinsics:: simd_flog ( self ) }
106
106
}
107
107
108
- /// Produces a vector where every lane has the logarithm with respect to an arbitrary
109
- /// in the equivalently-indexed lanes in `self` and `base`.
108
+ /// Produces a vector where every element has the logarithm with respect to an arbitrary
109
+ /// in the equivalently-indexed elements in `self` and `base`.
110
110
#[ inline]
111
111
#[ must_use = "method returns a new vector and does not mutate the original value" ]
112
112
fn log ( self , base : Self ) -> Self {
113
113
unsafe { intrinsics:: simd_div ( self . ln ( ) , base. ln ( ) ) }
114
114
}
115
115
116
116
117
- /// Produces a vector where every lane has the base-2 logarithm of the value
118
- /// in the equivalently-indexed lane in `self`.
117
+ /// Produces a vector where every element has the base-2 logarithm of the value
118
+ /// in the equivalently-indexed element in `self`.
119
119
#[ inline]
120
120
#[ must_use = "method returns a new vector and does not mutate the original value" ]
121
121
fn log2 ( self ) -> Self {
122
122
unsafe { intrinsics:: simd_flog2 ( self ) }
123
123
}
124
124
125
- /// Produces a vector where every lane has the base-10 logarithm of the value
126
- /// in the equivalently-indexed lane in `self`.
125
+ /// Produces a vector where every element has the base-10 logarithm of the value
126
+ /// in the equivalently-indexed element in `self`.
127
127
#[ inline]
128
128
#[ must_use = "method returns a new vector and does not mutate the original value" ]
129
129
fn log10 ( self ) -> Self {
130
130
unsafe { intrinsics:: simd_flog10 ( self ) }
131
131
}
132
132
133
- /// Returns the smallest integer greater than or equal to each lane .
133
+ /// Returns the smallest integer greater than or equal to each element .
134
134
#[ must_use = "method returns a new vector and does not mutate the original value" ]
135
135
#[ inline]
136
136
fn ceil ( self ) -> Self {
137
137
unsafe { intrinsics:: simd_ceil ( self ) }
138
138
}
139
139
140
- /// Returns the largest integer value less than or equal to each lane .
140
+ /// Returns the largest integer value less than or equal to each element .
141
141
#[ must_use = "method returns a new vector and does not mutate the original value" ]
142
142
#[ inline]
143
143
fn floor ( self ) -> Self {
0 commit comments