File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,14 @@ extern "platform-intrinsic" {
130130 pub ( crate ) fn simd_reduce_xor < T , U > ( x : T ) -> U ;
131131
132132 // truncate integer vector to bitmask
133+ // `fn simd_bitmask(vector) -> unsigned integer` takes a vector of integers and
134+ // returns either an unsigned integer or array of `u8`.
135+ // Every element in the vector becomes a single bit in the returned bitmask.
136+ // If the vector has less than 8 lanes, a u8 is returned with zeroed trailing bits.
137+ // The bit order of the result depends on the byte endianness. LSB-first for little
138+ // endian and MSB-first for big endian.
139+ //
140+ // UB if called on a vector with values other than 0 and -1.
133141 #[ allow( unused) ]
134142 pub ( crate ) fn simd_bitmask < T , U > ( x : T ) -> U ;
135143
Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ macro_rules! impl_integer_intrinsic {
5050}
5151
5252impl_integer_intrinsic ! {
53+ unsafe impl ToBitMask <BitMask =u8 > for Mask <_, 1 >
54+ unsafe impl ToBitMask <BitMask =u8 > for Mask <_, 2 >
55+ unsafe impl ToBitMask <BitMask =u8 > for Mask <_, 4 >
5356 unsafe impl ToBitMask <BitMask =u8 > for Mask <_, 8 >
5457 unsafe impl ToBitMask <BitMask =u16 > for Mask <_, 16 >
5558 unsafe impl ToBitMask <BitMask =u32 > for Mask <_, 32 >
You can’t perform that action at this time.
0 commit comments