File tree Expand file tree Collapse file tree 3 files changed +25
-43
lines changed Expand file tree Collapse file tree 3 files changed +25
-43
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ mod lane_count;
1414mod masks;
1515mod ops;
1616mod ord;
17- mod round;
1817mod select;
1918mod vector;
2019mod vendor;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -217,6 +217,31 @@ where
217217 unsafe { intrinsics:: simd_as ( self ) }
218218 }
219219
220+ /// Rounds toward zero and converts to the same-width integer type, assuming that
221+ /// the value is finite and fits in that type.
222+ ///
223+ /// # Safety
224+ /// The value must:
225+ ///
226+ /// * Not be NaN
227+ /// * Not be infinite
228+ /// * Be representable in the return type, after truncating off its fractional part
229+ ///
230+ /// If these requirements are infeasible or costly, consider using the safe function [cast],
231+ /// which saturates on conversion.
232+ ///
233+ /// [cast]: Simd::cast
234+ #[ inline]
235+ pub unsafe fn to_int_unchecked < I > ( self ) -> Simd < I , LANES >
236+ where
237+ T : core:: convert:: FloatToInt < I > ,
238+ I : SimdElement ,
239+ {
240+ // Safety: `self` is a vector, and `FloatToInt` ensures the type can be casted to
241+ // an integer.
242+ unsafe { intrinsics:: simd_cast ( self ) }
243+ }
244+
220245 /// Reads from potentially discontiguous indices in `slice` to construct a SIMD vector.
221246 /// If an index is out-of-bounds, the lane is instead selected from the `or` vector.
222247 ///
You can’t perform that action at this time.
0 commit comments