@@ -26,28 +26,28 @@ pub const unsafe fn simd_extract<T, U>(_x: T, _idx: u32) -> U;
26
26
27
27
/// Adds two simd vectors elementwise.
28
28
///
29
- /// `T` must be a vector of integer or floating point primitive types .
29
+ /// `T` must be a vector of integers or floats .
30
30
#[ rustc_intrinsic]
31
31
#[ rustc_nounwind]
32
32
pub unsafe fn simd_add < T > ( _x : T , _y : T ) -> T ;
33
33
34
34
/// Subtracts `rhs` from `lhs` elementwise.
35
35
///
36
- /// `T` must be a vector of integer or floating point primitive types .
36
+ /// `T` must be a vector of integers or floats .
37
37
#[ rustc_intrinsic]
38
38
#[ rustc_nounwind]
39
39
pub unsafe fn simd_sub < T > ( _lhs : T , _rhs : T ) -> T ;
40
40
41
41
/// Multiplies two simd vectors elementwise.
42
42
///
43
- /// `T` must be a vector of integer or floating point primitive types .
43
+ /// `T` must be a vector of integers or floats .
44
44
#[ rustc_intrinsic]
45
45
#[ rustc_nounwind]
46
46
pub unsafe fn simd_mul < T > ( _x : T , _y : T ) -> T ;
47
47
48
48
/// Divides `lhs` by `rhs` elementwise.
49
49
///
50
- /// `T` must be a vector of integer or floating point primitive types .
50
+ /// `T` must be a vector of integers or floats .
51
51
///
52
52
/// # Safety
53
53
/// For integers, `rhs` must not contain any zero elements.
@@ -58,7 +58,7 @@ pub unsafe fn simd_div<T>(_lhs: T, _rhs: T) -> T;
58
58
59
59
/// Returns remainder of two vectors elementwise.
60
60
///
61
- /// `T` must be a vector of integer or floating point primitive types .
61
+ /// `T` must be a vector of integers or floats .
62
62
///
63
63
/// # Safety
64
64
/// For integers, `rhs` must not contain any zero elements.
@@ -71,7 +71,7 @@ pub unsafe fn simd_rem<T>(_lhs: T, _rhs: T) -> T;
71
71
///
72
72
/// Shifts `lhs` left by `rhs`, shifting in sign bits for signed types.
73
73
///
74
- /// `T` must be a vector of integer primitive types .
74
+ /// `T` must be a vector of integers .
75
75
///
76
76
/// # Safety
77
77
///
@@ -82,7 +82,7 @@ pub unsafe fn simd_shl<T>(_lhs: T, _rhs: T) -> T;
82
82
83
83
/// Shifts vector right elementwise, with UB on overflow.
84
84
///
85
- /// `T` must be a vector of integer primitive types .
85
+ /// `T` must be a vector of integers .
86
86
///
87
87
/// Shifts `lhs` right by `rhs`, shifting in sign bits for signed types.
88
88
///
@@ -95,29 +95,28 @@ pub unsafe fn simd_shr<T>(_lhs: T, _rhs: T) -> T;
95
95
96
96
/// "Ands" vectors elementwise.
97
97
///
98
- /// `T` must be a vector of integer primitive types .
98
+ /// `T` must be a vector of integers .
99
99
#[ rustc_intrinsic]
100
100
#[ rustc_nounwind]
101
101
pub unsafe fn simd_and < T > ( _x : T , _y : T ) -> T ;
102
102
103
103
/// "Ors" vectors elementwise.
104
104
///
105
- /// `T` must be a vector of integer primitive types .
105
+ /// `T` must be a vector of integers .
106
106
#[ rustc_intrinsic]
107
107
#[ rustc_nounwind]
108
108
pub unsafe fn simd_or < T > ( _x : T , _y : T ) -> T ;
109
109
110
110
/// "Exclusive ors" vectors elementwise.
111
111
///
112
- /// `T` must be a vector of integer primitive types .
112
+ /// `T` must be a vector of integers .
113
113
#[ rustc_intrinsic]
114
114
#[ rustc_nounwind]
115
115
pub unsafe fn simd_xor < T > ( _x : T , _y : T ) -> T ;
116
116
117
117
/// Numerically casts a vector, elementwise.
118
118
///
119
- /// `T` and `U` must be vectors of integer or floating point primitive types, and must have the
120
- /// same length.
119
+ /// `T` and `U` must be vectors of integers or floats, and must have the same length.
121
120
///
122
121
/// When casting floats to integers, the result is truncated. Out-of-bounds result lead to UB.
123
122
/// When casting integers to floats, the result is rounded.
@@ -138,8 +137,7 @@ pub unsafe fn simd_cast<T, U>(_x: T) -> U;
138
137
139
138
/// Numerically casts a vector, elementwise.
140
139
///
141
- /// `T` and `U` be a vectors of integer or floating point primitive types, and must have the
142
- /// same length.
140
+ /// `T` and `U` be a vectors of integers or floats, and must have the same length.
143
141
///
144
142
/// Like `simd_cast`, but saturates float-to-integer conversions (NaN becomes 0).
145
143
/// This matches regular `as` and is always safe.
@@ -153,7 +151,7 @@ pub unsafe fn simd_as<T, U>(_x: T) -> U;
153
151
154
152
/// Negates a vector elementwise.
155
153
///
156
- /// `T` must be a vector of integer or floating-point primitive types .
154
+ /// `T` must be a vector of integers or floats .
157
155
///
158
156
/// Rust panics for `-<int>::Min` due to overflow, but it is not UB with this intrinsic.
159
157
#[ rustc_intrinsic]
@@ -187,7 +185,7 @@ pub unsafe fn simd_fmax<T>(_x: T, _y: T) -> T;
187
185
188
186
/// Tests elementwise equality of two vectors.
189
187
///
190
- /// `T` must be a vector of floating-point primitive types .
188
+ /// `T` must be a vector of integers or floats .
191
189
///
192
190
/// `U` must be a vector of integers with the same number of elements and element size as `T`.
193
191
///
@@ -198,7 +196,7 @@ pub unsafe fn simd_eq<T, U>(_x: T, _y: T) -> U;
198
196
199
197
/// Tests elementwise inequality equality of two vectors.
200
198
///
201
- /// `T` must be a vector of floating-point primitive types .
199
+ /// `T` must be a vector of integers or floats .
202
200
///
203
201
/// `U` must be a vector of integers with the same number of elements and element size as `T`.
204
202
///
@@ -209,7 +207,7 @@ pub unsafe fn simd_ne<T, U>(_x: T, _y: T) -> U;
209
207
210
208
/// Tests if `x` is less than `y`, elementwise.
211
209
///
212
- /// `T` must be a vector of floating-point primitive types .
210
+ /// `T` must be a vector of integers or floats .
213
211
///
214
212
/// `U` must be a vector of integers with the same number of elements and element size as `T`.
215
213
///
@@ -220,7 +218,7 @@ pub unsafe fn simd_lt<T, U>(_x: T, _y: T) -> U;
220
218
221
219
/// Tests if `x` is less than or equal to `y`, elementwise.
222
220
///
223
- /// `T` must be a vector of floating-point primitive types .
221
+ /// `T` must be a vector of integers or floats .
224
222
///
225
223
/// `U` must be a vector of integers with the same number of elements and element size as `T`.
226
224
///
@@ -231,7 +229,7 @@ pub unsafe fn simd_le<T, U>(_x: T, _y: T) -> U;
231
229
232
230
/// Tests if `x` is greater than `y`, elementwise.
233
231
///
234
- /// `T` must be a vector of floating-point primitive types .
232
+ /// `T` must be a vector of integers or floats .
235
233
///
236
234
/// `U` must be a vector of integers with the same number of elements and element size as `T`.
237
235
///
@@ -242,7 +240,7 @@ pub unsafe fn simd_gt<T, U>(_x: T, _y: T) -> U;
242
240
243
241
/// Tests if `x` is greater than or equal to `y`, elementwise.
244
242
///
245
- /// `T` must be a vector of floating-point primitive types .
243
+ /// `T` must be a vector of integers or floats .
246
244
///
247
245
/// `U` must be a vector of integers with the same number of elements and element size as `T`.
248
246
///
@@ -273,7 +271,7 @@ pub unsafe fn simd_shuffle<T, U, V>(_x: T, _y: T, _idx: U) -> V;
273
271
///
274
272
/// `U` must be a vector of pointers to the element type of `T`, with the same length as `T`.
275
273
///
276
- /// `V` must be a vector of integers with the same length as `T` (but any element size).
274
+ /// `V` must be a vector of signed integers with the same length as `T` (but any element size).
277
275
///
278
276
/// For each pointer in `ptr`, if the corresponding value in `mask` is `!0`, read the pointer.
279
277
/// Otherwise if the corresponding value in `mask` is `0`, return the corresponding value from
@@ -294,7 +292,7 @@ pub unsafe fn simd_gather<T, U, V>(_val: T, _ptr: U, _mask: V) -> T;
294
292
///
295
293
/// `U` must be a vector of pointers to the element type of `T`, with the same length as `T`.
296
294
///
297
- /// `V` must be a vector of integers with the same length as `T` (but any element size).
295
+ /// `V` must be a vector of signed integers with the same length as `T` (but any element size).
298
296
///
299
297
/// For each pointer in `ptr`, if the corresponding value in `mask` is `!0`, write the
300
298
/// corresponding value in `val` to the pointer.
@@ -318,7 +316,7 @@ pub unsafe fn simd_scatter<T, U, V>(_val: T, _ptr: U, _mask: V);
318
316
///
319
317
/// `U` must be a pointer to the element type of `T`
320
318
///
321
- /// `V` must be a vector of integers with the same length as `T` (but any element size).
319
+ /// `V` must be a vector of signed integers with the same length as `T` (but any element size).
322
320
///
323
321
/// For each element, if the corresponding value in `mask` is `!0`, read the corresponding
324
322
/// pointer offset from `ptr`.
@@ -341,7 +339,7 @@ pub unsafe fn simd_masked_load<V, U, T>(_mask: V, _ptr: U, _val: T) -> T;
341
339
///
342
340
/// `U` must be a pointer to the element type of `T`
343
341
///
344
- /// `V` must be a vector of integers with the same length as `T` (but any element size).
342
+ /// `V` must be a vector of signed integers with the same length as `T` (but any element size).
345
343
///
346
344
/// For each element, if the corresponding value in `mask` is `!0`, write the corresponding
347
345
/// value in `val` to the pointer offset from `ptr`.
@@ -375,7 +373,7 @@ pub unsafe fn simd_saturating_sub<T>(_lhs: T, _rhs: T) -> T;
375
373
376
374
/// Adds elements within a vector from left to right.
377
375
///
378
- /// `T` must be a vector of integer or floating-point primitive types .
376
+ /// `T` must be a vector of integers or floats .
379
377
///
380
378
/// `U` must be the element type of `T`.
381
379
///
@@ -387,7 +385,7 @@ pub unsafe fn simd_reduce_add_ordered<T, U>(_x: T, _y: U) -> U;
387
385
/// Adds elements within a vector in arbitrary order. May also be re-associated with
388
386
/// unordered additions on the inputs/outputs.
389
387
///
390
- /// `T` must be a vector of integer or floating-point primitive types .
388
+ /// `T` must be a vector of integers or floats .
391
389
///
392
390
/// `U` must be the element type of `T`.
393
391
#[ rustc_intrinsic]
@@ -396,7 +394,7 @@ pub unsafe fn simd_reduce_add_unordered<T, U>(_x: T) -> U;
396
394
397
395
/// Multiplies elements within a vector from left to right.
398
396
///
399
- /// `T` must be a vector of integer or floating-point primitive types .
397
+ /// `T` must be a vector of integers or floats .
400
398
///
401
399
/// `U` must be the element type of `T`.
402
400
///
@@ -408,7 +406,7 @@ pub unsafe fn simd_reduce_mul_ordered<T, U>(_x: T, _y: U) -> U;
408
406
/// Multiplies elements within a vector in arbitrary order. May also be re-associated with
409
407
/// unordered additions on the inputs/outputs.
410
408
///
411
- /// `T` must be a vector of integer or floating-point primitive types .
409
+ /// `T` must be a vector of integers or floats .
412
410
///
413
411
/// `U` must be the element type of `T`.
414
412
#[ rustc_intrinsic]
@@ -437,7 +435,7 @@ pub unsafe fn simd_reduce_any<T>(_x: T) -> bool;
437
435
438
436
/// Returns the maximum element of a vector.
439
437
///
440
- /// `T` must be a vector of integer or floating-point primitive types .
438
+ /// `T` must be a vector of integers or floats .
441
439
///
442
440
/// `U` must be the element type of `T`.
443
441
///
@@ -448,7 +446,7 @@ pub unsafe fn simd_reduce_max<T, U>(_x: T) -> U;
448
446
449
447
/// Returns the minimum element of a vector.
450
448
///
451
- /// `T` must be a vector of integer or floating-point primitive types .
449
+ /// `T` must be a vector of integers or floats .
452
450
///
453
451
/// `U` must be the element type of `T`.
454
452
///
@@ -459,7 +457,7 @@ pub unsafe fn simd_reduce_min<T, U>(_x: T) -> U;
459
457
460
458
/// Logical "ands" all elements together.
461
459
///
462
- /// `T` must be a vector of integer or floating-point primitive types .
460
+ /// `T` must be a vector of integers or floats .
463
461
///
464
462
/// `U` must be the element type of `T`.
465
463
#[ rustc_intrinsic]
@@ -468,7 +466,7 @@ pub unsafe fn simd_reduce_and<T, U>(_x: T) -> U;
468
466
469
467
/// Logical "ors" all elements together.
470
468
///
471
- /// `T` must be a vector of integer or floating-point primitive types .
469
+ /// `T` must be a vector of integers or floats .
472
470
///
473
471
/// `U` must be the element type of `T`.
474
472
#[ rustc_intrinsic]
@@ -477,7 +475,7 @@ pub unsafe fn simd_reduce_or<T, U>(_x: T) -> U;
477
475
478
476
/// Logical "exclusive ors" all elements together.
479
477
///
480
- /// `T` must be a vector of integer or floating-point primitive types .
478
+ /// `T` must be a vector of integers or floats .
481
479
///
482
480
/// `U` must be the element type of `T`.
483
481
#[ rustc_intrinsic]
@@ -523,9 +521,9 @@ pub unsafe fn simd_bitmask<T, U>(_x: T) -> U;
523
521
524
522
/// Selects elements from a mask.
525
523
///
526
- /// `M ` must be an integer vector.
524
+ /// `T ` must be a vector.
527
525
///
528
- /// `T ` must be a vector with the same number of elements as `M` .
526
+ /// `M ` must be a signed integer vector with the same length as `T` (but any element size) .
529
527
///
530
528
/// For each element, if the corresponding value in `mask` is `!0`, select the element from
531
529
/// `if_true`. If the corresponding value in `mask` is `0`, select the element from
0 commit comments