@@ -73,6 +73,9 @@ pub fn i8x16_relaxed_swizzle(a: v128, s: v128) -> v128 {
73
73
unsafe { llvm_relaxed_swizzle ( a. as_i8x16 ( ) , s. as_i8x16 ( ) ) . v128 ( ) }
74
74
}
75
75
76
+ #[ stable( feature = "stdarch_wasm_relaxed_simd" , since = "CURRENT_RUSTC_VERSION" ) ]
77
+ pub use i8x16_relaxed_swizzle as u8x16_relaxed_swizzle;
78
+
76
79
/// A relaxed version of `i32x4_trunc_sat_f32x4(a)` converts the `f32` lanes
77
80
/// of `a` to signed 32-bit integers.
78
81
///
@@ -185,6 +188,9 @@ pub fn i8x16_relaxed_laneselect(a: v128, b: v128, m: v128) -> v128 {
185
188
unsafe { llvm_i8x16_laneselect ( a. as_i8x16 ( ) , b. as_i8x16 ( ) , m. as_i8x16 ( ) ) . v128 ( ) }
186
189
}
187
190
191
+ #[ stable( feature = "stdarch_wasm_relaxed_simd" , since = "CURRENT_RUSTC_VERSION" ) ]
192
+ pub use i8x16_relaxed_laneselect as u8x16_relaxed_laneselect;
193
+
188
194
/// A relaxed version of `v128_bitselect` where this either behaves the same as
189
195
/// `v128_bitselect` or the high bit of each lane `m` is inspected and the
190
196
/// corresponding lane of `a` is chosen if the bit is 1 or the lane of `b` is
@@ -201,6 +207,9 @@ pub fn i16x8_relaxed_laneselect(a: v128, b: v128, m: v128) -> v128 {
201
207
unsafe { llvm_i16x8_laneselect ( a. as_i16x8 ( ) , b. as_i16x8 ( ) , m. as_i16x8 ( ) ) . v128 ( ) }
202
208
}
203
209
210
+ #[ stable( feature = "stdarch_wasm_relaxed_simd" , since = "CURRENT_RUSTC_VERSION" ) ]
211
+ pub use i16x8_relaxed_laneselect as u16x8_relaxed_laneselect;
212
+
204
213
/// A relaxed version of `v128_bitselect` where this either behaves the same as
205
214
/// `v128_bitselect` or the high bit of each lane `m` is inspected and the
206
215
/// corresponding lane of `a` is chosen if the bit is 1 or the lane of `b` is
@@ -217,6 +226,9 @@ pub fn i32x4_relaxed_laneselect(a: v128, b: v128, m: v128) -> v128 {
217
226
unsafe { llvm_i32x4_laneselect ( a. as_i32x4 ( ) , b. as_i32x4 ( ) , m. as_i32x4 ( ) ) . v128 ( ) }
218
227
}
219
228
229
+ #[ stable( feature = "stdarch_wasm_relaxed_simd" , since = "CURRENT_RUSTC_VERSION" ) ]
230
+ pub use i32x4_relaxed_laneselect as u32x4_relaxed_laneselect;
231
+
220
232
/// A relaxed version of `v128_bitselect` where this either behaves the same as
221
233
/// `v128_bitselect` or the high bit of each lane `m` is inspected and the
222
234
/// corresponding lane of `a` is chosen if the bit is 1 or the lane of `b` is
@@ -233,6 +245,9 @@ pub fn i64x2_relaxed_laneselect(a: v128, b: v128, m: v128) -> v128 {
233
245
unsafe { llvm_i64x2_laneselect ( a. as_i64x2 ( ) , b. as_i64x2 ( ) , m. as_i64x2 ( ) ) . v128 ( ) }
234
246
}
235
247
248
+ #[ stable( feature = "stdarch_wasm_relaxed_simd" , since = "CURRENT_RUSTC_VERSION" ) ]
249
+ pub use i64x2_relaxed_laneselect as u64x2_relaxed_laneselect;
250
+
236
251
/// A relaxed version of `f32x4_min` which is either `f32x4_min` or
237
252
/// `f32x4_pmin`.
238
253
#[ inline]
@@ -288,6 +303,9 @@ pub fn i16x8_relaxed_q15mulr(a: v128, b: v128) -> v128 {
288
303
unsafe { llvm_relaxed_q15mulr_signed ( a. as_i16x8 ( ) , b. as_i16x8 ( ) ) . v128 ( ) }
289
304
}
290
305
306
+ #[ stable( feature = "stdarch_wasm_relaxed_simd" , since = "CURRENT_RUSTC_VERSION" ) ]
307
+ pub use i16x8_relaxed_q15mulr as u16x8_relaxed_q15mulr;
308
+
291
309
/// A relaxed dot-product instruction.
292
310
///
293
311
/// This instruction will perform pairwise products of the 8-bit values in `a`
@@ -308,6 +326,9 @@ pub fn i16x8_relaxed_dot_i8x16_i7x16(a: v128, b: v128) -> v128 {
308
326
unsafe { llvm_i16x8_relaxed_dot_i8x16_i7x16_s ( a. as_i8x16 ( ) , b. as_i8x16 ( ) ) . v128 ( ) }
309
327
}
310
328
329
+ #[ stable( feature = "stdarch_wasm_relaxed_simd" , since = "CURRENT_RUSTC_VERSION" ) ]
330
+ pub use i16x8_relaxed_dot_i8x16_i7x16 as u16x8_relaxed_dot_i8x16_i7x16;
331
+
311
332
/// Similar to [`i16x8_relaxed_dot_i8x16_i7x16`] except that the intermediate
312
333
/// `i16x8` result is fed into `i32x4_extadd_pairwise_i16x8` followed by
313
334
/// `i32x4_add` to add the value `c` to the result.
@@ -322,6 +343,9 @@ pub fn i32x4_relaxed_dot_i8x16_i7x16_add(a: v128, b: v128, c: v128) -> v128 {
322
343
}
323
344
}
324
345
346
+ #[ stable( feature = "stdarch_wasm_relaxed_simd" , since = "CURRENT_RUSTC_VERSION" ) ]
347
+ pub use i32x4_relaxed_dot_i8x16_i7x16_add as u32x4_relaxed_dot_i8x16_i7x16_add;
348
+
325
349
#[ cfg( test) ]
326
350
mod tests {
327
351
use super :: super :: simd128:: * ;
@@ -367,6 +391,22 @@ mod tests {
367
391
i8x16 ( 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ) ,
368
392
] ,
369
393
) ;
394
+ compare_bytes (
395
+ u8x16_relaxed_swizzle (
396
+ u8x16 (
397
+ 128 , 129 , 130 , 131 , 132 , 133 , 134 , 135 , 136 , 137 , 138 , 139 , 140 , 141 , 142 , 143 ,
398
+ ) ,
399
+ u8x16 ( 0x80 , 0xff , 16 , 17 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ) ,
400
+ ) ,
401
+ & [
402
+ u8x16 (
403
+ 128 , 128 , 128 , 129 , 128 , 128 , 128 , 128 , 128 , 128 , 128 , 128 , 128 , 128 , 128 , 128 ,
404
+ ) ,
405
+ u8x16 (
406
+ 0 , 0 , 0 , 0 , 128 , 128 , 128 , 128 , 128 , 128 , 128 , 128 , 128 , 128 , 128 , 128 ,
407
+ ) ,
408
+ ] ,
409
+ ) ;
370
410
}
371
411
372
412
#[ test]
0 commit comments