File tree 2 files changed +11
-0
lines changed 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,14 @@ extern "platform-intrinsic" {
130
130
pub ( crate ) fn simd_reduce_xor < T , U > ( x : T ) -> U ;
131
131
132
132
// 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.
133
141
#[ allow( unused) ]
134
142
pub ( crate ) fn simd_bitmask < T , U > ( x : T ) -> U ;
135
143
Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ macro_rules! impl_integer_intrinsic {
50
50
}
51
51
52
52
impl_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 >
53
56
unsafe impl ToBitMask <BitMask =u8 > for Mask <_, 8 >
54
57
unsafe impl ToBitMask <BitMask =u16 > for Mask <_, 16 >
55
58
unsafe impl ToBitMask <BitMask =u32 > for Mask <_, 32 >
You can’t perform that action at this time.
0 commit comments