@@ -199,6 +199,8 @@ extern "platform-intrinsic" {
199
199
///
200
200
/// `V` must be a vector of integers with the same length as `T` (but any element size).
201
201
///
202
+ /// `idx` must be a constant.
203
+ ///
202
204
/// For each pointer in `ptr`, if the corresponding value in `mask` is `!0`, read the pointer.
203
205
/// Otherwise if the corresponding value in `mask` is `0`, return the corresponding value from
204
206
/// `val`.
@@ -319,15 +321,20 @@ extern "platform-intrinsic" {
319
321
/// `T` must be an integer vector.
320
322
///
321
323
/// `U` must be either the smallest unsigned integer with at least as many bits as the length
324
+ /// of `T`, or the smallest array of `u8` with as many bits as the length of `T`.
322
325
///
323
326
/// Each element is truncated to a single bit and packed into the result.
324
327
///
325
- /// The bit order depends on the byte endianness.
326
- /// The bitmask is always packed into the smallest/first bits, but the order is LSB-first for
327
- /// little endian and MSB-first for big endian.
328
- /// In other words, the LSB corresponds to the first vector element for little endian,
329
- /// and the last vector element for big endian.
330
- /// of `T`, or the smallest array of `u8` with as many bits as the length of `T`.
328
+ /// No matter whether the output is an array or an unsigned integer, it is treated as a single
329
+ /// contiguous list of bits. The bitmask is always packed on the least-significant side of the
330
+ /// output, and padded with 0s in the most-significant bits. The order of the bits depends on
331
+ /// endianess:
332
+ ///
333
+ /// * On little endian, the least significant bit corresponds to the first vector element.
334
+ /// * On big endian, the least significant bit corresponds to the last vector element.
335
+ ///
336
+ /// For example, `[-1, 0, -1, -1]` packs to `0b1101` on little endian and `0b1011` on big
337
+ /// endian.
331
338
///
332
339
/// # Safety
333
340
/// `x` must contain only `0` and `!0`.
@@ -349,7 +356,7 @@ extern "platform-intrinsic" {
349
356
350
357
/// Select elements from a bitmask.
351
358
///
352
- /// `M` must be an unsigned integer of type matching `simd_bitmask`.
359
+ /// `M` must be an unsigned integer or array of `u8`, matching `simd_bitmask`.
353
360
///
354
361
/// `T` must be a vector.
355
362
///
@@ -360,7 +367,7 @@ extern "platform-intrinsic" {
360
367
/// The bitmask bit order matches `simd_bitmask`.
361
368
///
362
369
/// # Safety
363
- /// `mask` must only contain `0` and `!0` .
370
+ /// Padding bits must be all zero .
364
371
pub fn simd_select_bitmask < M , T > ( m : M , yes : T , no : T ) -> T ;
365
372
366
373
/// Elementwise calculates the offset from a pointer vector, potentially wrapping.
0 commit comments