|
1 | 1 | //@compile-flags: -Zmiri-strict-provenance
|
2 | 2 | #![feature(portable_simd, platform_intrinsics, adt_const_params, inline_const)]
|
3 |
| -#![allow(incomplete_features)] |
4 |
| -use std::simd::*; |
| 3 | +#![allow(incomplete_features, internal_features)] |
| 4 | +use std::simd::{prelude::*, StdFloat}; |
5 | 5 |
|
6 | 6 | extern "platform-intrinsic" {
|
7 | 7 | pub(crate) fn simd_bitmask<T, U>(x: T) -> U;
|
@@ -328,14 +328,12 @@ fn simd_cast() {
|
328 | 328 | }
|
329 | 329 |
|
330 | 330 | fn simd_swizzle() {
|
331 |
| - use Which::*; |
332 |
| - |
333 | 331 | let a = f32x4::splat(10.0);
|
334 | 332 | let b = f32x4::from_array([1.0, 2.0, 3.0, -4.0]);
|
335 | 333 |
|
336 | 334 | assert_eq!(simd_swizzle!(b, [3, 0, 0, 2]), f32x4::from_array([-4.0, 1.0, 1.0, 3.0]));
|
337 | 335 | assert_eq!(simd_swizzle!(b, [1, 2]), f32x2::from_array([2.0, 3.0]));
|
338 |
| - assert_eq!(simd_swizzle!(b, a, [First(3), Second(0)]), f32x2::from_array([-4.0, 10.0])); |
| 336 | + assert_eq!(simd_swizzle!(b, a, [3, 4]), f32x2::from_array([-4.0, 10.0])); |
339 | 337 | }
|
340 | 338 |
|
341 | 339 | fn simd_gather_scatter() {
|
@@ -417,13 +415,13 @@ fn simd_intrinsics() {
|
417 | 415 | i32x4::from_array([10, 2, 10, 10])
|
418 | 416 | );
|
419 | 417 | assert_eq!(simd_shuffle_generic::<_, i32x4, { &[3, 1, 0, 2] }>(a, b), a,);
|
420 |
| - assert_eq!(simd_shuffle::<_, _, i32x4>(a, b, const { [3, 1, 0, 2] }), a,); |
| 418 | + assert_eq!(simd_shuffle::<_, _, i32x4>(a, b, const { [3u32, 1, 0, 2] }), a,); |
421 | 419 | assert_eq!(
|
422 | 420 | simd_shuffle_generic::<_, i32x4, { &[7, 5, 4, 6] }>(a, b),
|
423 | 421 | i32x4::from_array([4, 2, 1, 10]),
|
424 | 422 | );
|
425 | 423 | assert_eq!(
|
426 |
| - simd_shuffle::<_, _, i32x4>(a, b, const { [7, 5, 4, 6] }), |
| 424 | + simd_shuffle::<_, _, i32x4>(a, b, const { [7u32, 5, 4, 6] }), |
427 | 425 | i32x4::from_array([4, 2, 1, 10]),
|
428 | 426 | );
|
429 | 427 | }
|
|
0 commit comments