@@ -190,14 +190,27 @@ extern "platform-intrinsic" {
190
190
///
191
191
/// `T` must be a vector.
192
192
///
193
- /// `U` must be a const array of `i32`s.
193
+ /// `U` must be a **const** array of `i32`s. This means it must either refer to a named
194
+ /// const or be given as an inline const expression (`const { ... }`).
194
195
///
195
196
/// `V` must be a vector with the same element type as `T` and the same length as `U`.
196
197
///
197
- /// Concatenates `x` and `y`, then returns a new vector such that each element is selected from
198
- /// the concatenation by the matching index in `idx`.
198
+ /// Returns a new vector such that element `i` is selected from `xy[idx[i]]`, where `xy`
199
+ /// is the concatenation of `x` and `y`. It is a compile-time error if `idx[i]` is out-of-bounds
200
+ /// of `xy`.
199
201
pub fn simd_shuffle < T , U , V > ( x : T , y : T , idx : U ) -> V ;
200
202
203
+ /// Shuffle two vectors by const indices.
204
+ ///
205
+ /// `T` must be a vector.
206
+ ///
207
+ /// `U` must be a vector with the same element type as `T` and the same length as `IDX`.
208
+ ///
209
+ /// Returns a new vector such that element `i` is selected from `xy[IDX[i]]`, where `xy`
210
+ /// is the concatenation of `x` and `y`. It is a compile-time error if `IDX[i]` is out-of-bounds
211
+ /// of `xy`.
212
+ pub fn simd_shuffle_generic < T , U , const IDX : & ' static [ u32 ] > ( x : T , y : T ) -> U ;
213
+
201
214
/// Read a vector of pointers.
202
215
///
203
216
/// `T` must be a vector.
@@ -232,6 +245,9 @@ extern "platform-intrinsic" {
232
245
/// corresponding value in `val` to the pointer.
233
246
/// Otherwise if the corresponding value in `mask` is `0`, do nothing.
234
247
///
248
+ /// The stores happen in left-to-right order.
249
+ /// (This is relevant in case two of the stores overlap.)
250
+ ///
235
251
/// # Safety
236
252
/// Unmasked values in `T` must be writeable as if by `<ptr>::write` (e.g. aligned to the element
237
253
/// type).
@@ -468,4 +484,36 @@ extern "platform-intrinsic" {
468
484
///
469
485
/// `T` must be a vector of integers.
470
486
pub fn simd_cttz < T > ( x : T ) -> T ;
487
+
488
+ /// Round up each element to the next highest integer-valued float.
489
+ ///
490
+ /// `T` must be a vector of floats.
491
+ pub fn simd_ceil < T > ( x : T ) -> T ;
492
+
493
+ /// Round down each element to the next lowest integer-valued float.
494
+ ///
495
+ /// `T` must be a vector of floats.
496
+ pub fn simd_floor < T > ( x : T ) -> T ;
497
+
498
+ /// Round each element to the closest integer-valued float.
499
+ /// Ties are resolved by rounding away from 0.
500
+ ///
501
+ /// `T` must be a vector of floats.
502
+ pub fn simd_round < T > ( x : T ) -> T ;
503
+
504
+ /// Return the integer part of each element as an integer-valued float.
505
+ /// In other words, non-integer values are truncated towards zero.
506
+ ///
507
+ /// `T` must be a vector of floats.
508
+ pub fn simd_trunc < T > ( x : T ) -> T ;
509
+
510
+ /// Takes the square root of each element.
511
+ ///
512
+ /// `T` must be a vector of floats.
513
+ pub fn simd_fsqrt < T > ( x : T ) -> T ;
514
+
515
+ /// Computes `(x*y) + z` for each element, but without any intermediate rounding.
516
+ ///
517
+ /// `T` must be a vector of floats.
518
+ pub fn simd_fma < T > ( x : T , y : T , z : T ) -> T ;
471
519
}
0 commit comments