From 3d35abbb4355c8936033fbf8fddcdc4c263b0e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Sun, 28 Feb 2021 03:07:49 +0100 Subject: [PATCH] use `static_assert_imm8` instead of the generic `static_assert` macro --- crates/core_arch/src/x86/sse.rs | 2 +- crates/core_arch/src/x86/sse2.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/core_arch/src/x86/sse.rs b/crates/core_arch/src/x86/sse.rs index 3e7b54e302..98836518da 100644 --- a/crates/core_arch/src/x86/sse.rs +++ b/crates/core_arch/src/x86/sse.rs @@ -1010,7 +1010,7 @@ pub const fn _MM_SHUFFLE(z: u32, y: u32, x: u32, w: u32) -> i32 { #[rustc_legacy_const_generics(2)] #[stable(feature = "simd_x86", since = "1.27.0")] pub unsafe fn _mm_shuffle_ps(a: __m128, b: __m128) -> __m128 { - static_assert!(mask: i32 where mask >= 0 && mask <= 255); + static_assert_imm8!(mask); simd_shuffle4( a, b, diff --git a/crates/core_arch/src/x86/sse2.rs b/crates/core_arch/src/x86/sse2.rs index aff9e96b3c..ae98df5288 100644 --- a/crates/core_arch/src/x86/sse2.rs +++ b/crates/core_arch/src/x86/sse2.rs @@ -1454,7 +1454,7 @@ pub unsafe fn _mm_movemask_epi8(a: __m128i) -> i32 { #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] pub unsafe fn _mm_shuffle_epi32(a: __m128i) -> __m128i { - static_assert!(imm8: i32 where imm8 >= 0 && imm8 <= 255); + static_assert_imm8!(imm8); let a = a.as_i32x4(); let x: i32x4 = simd_shuffle4( a, @@ -1482,7 +1482,7 @@ pub unsafe fn _mm_shuffle_epi32(a: __m128i) -> __m128i { #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] pub unsafe fn _mm_shufflehi_epi16(a: __m128i) -> __m128i { - static_assert!(imm8: i32 where imm8 >= 0 && imm8 <= 255); + static_assert_imm8!(imm8); let a = a.as_i16x8(); let x: i16x8 = simd_shuffle8( a, @@ -1514,7 +1514,7 @@ pub unsafe fn _mm_shufflehi_epi16(a: __m128i) -> __m128i { #[rustc_legacy_const_generics(1)] #[stable(feature = "simd_x86", since = "1.27.0")] pub unsafe fn _mm_shufflelo_epi16(a: __m128i) -> __m128i { - static_assert!(imm8: i32 where imm8 >= 0 && imm8 <= 255); + static_assert_imm8!(imm8); let a = a.as_i16x8(); let x: i16x8 = simd_shuffle8( a,