From 85efc78bded780789f7339a96c09972069177a28 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 3 Mar 2025 14:47:06 +0100 Subject: [PATCH] make _mm256_zero{upper,all} safe --- crates/core_arch/src/x86/avx.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/core_arch/src/x86/avx.rs b/crates/core_arch/src/x86/avx.rs index 5a8ed54fae..f0a1ec04fc 100644 --- a/crates/core_arch/src/x86/avx.rs +++ b/crates/core_arch/src/x86/avx.rs @@ -1053,8 +1053,8 @@ pub fn _mm256_cvtsi256_si32(a: __m256i) -> i32 { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vzeroall))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_zeroall() { - vzeroall() +pub fn _mm256_zeroall() { + unsafe { vzeroall() } } /// Zeroes the upper 128 bits of all YMM registers; @@ -1065,8 +1065,8 @@ pub unsafe fn _mm256_zeroall() { #[target_feature(enable = "avx")] #[cfg_attr(test, assert_instr(vzeroupper))] #[stable(feature = "simd_x86", since = "1.27.0")] -pub unsafe fn _mm256_zeroupper() { - vzeroupper() +pub fn _mm256_zeroupper() { + unsafe { vzeroupper() } } /// Shuffles single-precision (32-bit) floating-point elements in `a`