diff options
| author | Eduardo Sánchez Muñoz <eduardosm-dev@e64.io> | 2023-09-29 18:02:47 +0200 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2023-10-01 17:57:00 +0100 |
| commit | 30a663b4ac5d76d7956e5f91afc19ace224af134 (patch) | |
| tree | 11b76242a8b5a848ea50dd426de9656236cdb1ab | |
| parent | 83668823fda74995d65cb2096f0f14bb733ffd5c (diff) | |
| download | rust-30a663b4ac5d76d7956e5f91afc19ace224af134.tar.gz rust-30a663b4ac5d76d7956e5f91afc19ace224af134.zip | |
Add some `#[allow(deprecated)]`
| -rw-r--r-- | library/stdarch/crates/assert-instr-macro/src/lib.rs | 11 | ||||
| -rw-r--r-- | library/stdarch/crates/core_arch/src/x86/sse.rs | 12 | ||||
| -rw-r--r-- | library/stdarch/crates/core_arch/src/x86/sse41.rs | 2 |
3 files changed, 25 insertions, 0 deletions
diff --git a/library/stdarch/crates/assert-instr-macro/src/lib.rs b/library/stdarch/crates/assert-instr-macro/src/lib.rs index 99e37c9105b..dfda3b48bfd 100644 --- a/library/stdarch/crates/assert-instr-macro/src/lib.rs +++ b/library/stdarch/crates/assert-instr-macro/src/lib.rs @@ -35,6 +35,15 @@ pub fn assert_instr( let instr = &invoc.instr; let name = &func.sig.ident; + let maybe_allow_deprecated = if func + .attrs + .iter() + .any(|attr| attr.path.is_ident("deprecated")) + { + quote! { #[allow(deprecated)] } + } else { + quote! {} + }; // Disable assert_instr for x86 targets compiled with avx enabled, which // causes LLVM to generate different intrinsics that the ones we are @@ -135,6 +144,7 @@ pub fn assert_instr( let to_test = if disable_dedup_guard { quote! { #attrs + #maybe_allow_deprecated #[no_mangle] #[inline(never)] pub unsafe extern #abi fn #shim_name(#(#inputs),*) #ret { @@ -147,6 +157,7 @@ pub fn assert_instr( const #shim_name_ptr : *const u8 = #shim_name_str.as_ptr(); #attrs + #maybe_allow_deprecated #[no_mangle] #[inline(never)] pub unsafe extern #abi fn #shim_name(#(#inputs),*) #ret { diff --git a/library/stdarch/crates/core_arch/src/x86/sse.rs b/library/stdarch/crates/core_arch/src/x86/sse.rs index 2e275b065c7..2560b10b0bd 100644 --- a/library/stdarch/crates/core_arch/src/x86/sse.rs +++ b/library/stdarch/crates/core_arch/src/x86/sse.rs @@ -1613,6 +1613,7 @@ pub const _MM_FLUSH_ZERO_OFF: u32 = 0x0000; /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_MM_GET_EXCEPTION_MASK) #[inline] +#[allow(deprecated)] // Deprecated function implemented on top of deprecated function #[allow(non_snake_case)] #[target_feature(enable = "sse")] #[stable(feature = "simd_x86", since = "1.27.0")] @@ -1628,6 +1629,7 @@ pub unsafe fn _MM_GET_EXCEPTION_MASK() -> u32 { /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_MM_GET_EXCEPTION_STATE) #[inline] +#[allow(deprecated)] // Deprecated function implemented on top of deprecated function #[allow(non_snake_case)] #[target_feature(enable = "sse")] #[stable(feature = "simd_x86", since = "1.27.0")] @@ -1643,6 +1645,7 @@ pub unsafe fn _MM_GET_EXCEPTION_STATE() -> u32 { /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_MM_GET_FLUSH_ZERO_MODE) #[inline] +#[allow(deprecated)] // Deprecated function implemented on top of deprecated function #[allow(non_snake_case)] #[target_feature(enable = "sse")] #[stable(feature = "simd_x86", since = "1.27.0")] @@ -1658,6 +1661,7 @@ pub unsafe fn _MM_GET_FLUSH_ZERO_MODE() -> u32 { /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_MM_GET_ROUNDING_MODE) #[inline] +#[allow(deprecated)] // Deprecated function implemented on top of deprecated function #[allow(non_snake_case)] #[target_feature(enable = "sse")] #[stable(feature = "simd_x86", since = "1.27.0")] @@ -1673,6 +1677,7 @@ pub unsafe fn _MM_GET_ROUNDING_MODE() -> u32 { /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_MM_SET_EXCEPTION_MASK) #[inline] +#[allow(deprecated)] // Deprecated function implemented on top of deprecated function #[allow(non_snake_case)] #[target_feature(enable = "sse")] #[stable(feature = "simd_x86", since = "1.27.0")] @@ -1688,6 +1693,7 @@ pub unsafe fn _MM_SET_EXCEPTION_MASK(x: u32) { /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_MM_SET_EXCEPTION_STATE) #[inline] +#[allow(deprecated)] // Deprecated function implemented on top of deprecated function #[allow(non_snake_case)] #[target_feature(enable = "sse")] #[stable(feature = "simd_x86", since = "1.27.0")] @@ -1703,6 +1709,7 @@ pub unsafe fn _MM_SET_EXCEPTION_STATE(x: u32) { /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_MM_SET_FLUSH_ZERO_MODE) #[inline] +#[allow(deprecated)] // Deprecated function implemented on top of deprecated function #[allow(non_snake_case)] #[target_feature(enable = "sse")] #[stable(feature = "simd_x86", since = "1.27.0")] @@ -1720,6 +1727,7 @@ pub unsafe fn _MM_SET_FLUSH_ZERO_MODE(x: u32) { /// /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_MM_SET_ROUNDING_MODE) #[inline] +#[allow(deprecated)] // Deprecated function implemented on top of deprecated function #[allow(non_snake_case)] #[target_feature(enable = "sse")] #[stable(feature = "simd_x86", since = "1.27.0")] @@ -2834,6 +2842,7 @@ mod tests { } } + #[allow(deprecated)] // FIXME: This test uses deprecated CSR access functions #[simd_test(enable = "sse")] unsafe fn test_mm_comieq_ss_vs_ucomieq_ss() { // If one of the arguments is a quiet NaN `comieq_ss` should signal an @@ -3258,6 +3267,7 @@ mod tests { _mm_sfence(); } + #[allow(deprecated)] // FIXME: This tests functions that are immediate UB #[simd_test(enable = "sse")] unsafe fn test_mm_getcsr_setcsr_1() { let saved_csr = _mm_getcsr(); @@ -3274,6 +3284,7 @@ mod tests { assert_eq_m128(r, exp); // first component is a denormalized f32 } + #[allow(deprecated)] // FIXME: This tests functions that are immediate UB #[simd_test(enable = "sse")] unsafe fn test_mm_getcsr_setcsr_2() { // Same as _mm_setcsr_1 test, but with opposite flag value. @@ -3292,6 +3303,7 @@ mod tests { assert_eq_m128(r, exp); // first component is a denormalized f32 } + #[allow(deprecated)] // FIXME: This tests functions that are immediate UB #[simd_test(enable = "sse")] unsafe fn test_mm_getcsr_setcsr_underflow() { _MM_SET_EXCEPTION_STATE(0); diff --git a/library/stdarch/crates/core_arch/src/x86/sse41.rs b/library/stdarch/crates/core_arch/src/x86/sse41.rs index 7ba86e5f79a..a62beb6f68a 100644 --- a/library/stdarch/crates/core_arch/src/x86/sse41.rs +++ b/library/stdarch/crates/core_arch/src/x86/sse41.rs @@ -1668,6 +1668,7 @@ mod tests { assert_eq_m128(r, e); } + #[allow(deprecated)] // FIXME: This test uses deprecated CSR access functions #[simd_test(enable = "sse4.1")] unsafe fn test_mm_round_sd() { let a = _mm_setr_pd(1.5, 3.5); @@ -1680,6 +1681,7 @@ mod tests { assert_eq_m128d(r, e); } + #[allow(deprecated)] // FIXME: This test uses deprecated CSR access functions #[simd_test(enable = "sse4.1")] unsafe fn test_mm_round_ss() { let a = _mm_setr_ps(1.5, 3.5, 7.5, 15.5); |
