Skip to content

Commit 85efc78

Browse files
RalfJungAmanieu
authored andcommitted
make _mm256_zero{upper,all} safe
1 parent 3f38a72 commit 85efc78

File tree

1 file changed

+4
-4
lines changed
  • crates/core_arch/src/x86

1 file changed

+4
-4
lines changed

Diff for: crates/core_arch/src/x86/avx.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1053,8 +1053,8 @@ pub fn _mm256_cvtsi256_si32(a: __m256i) -> i32 {
10531053
#[target_feature(enable = "avx")]
10541054
#[cfg_attr(test, assert_instr(vzeroall))]
10551055
#[stable(feature = "simd_x86", since = "1.27.0")]
1056-
pub unsafe fn _mm256_zeroall() {
1057-
vzeroall()
1056+
pub fn _mm256_zeroall() {
1057+
unsafe { vzeroall() }
10581058
}
10591059

10601060
/// Zeroes the upper 128 bits of all YMM registers;
@@ -1065,8 +1065,8 @@ pub unsafe fn _mm256_zeroall() {
10651065
#[target_feature(enable = "avx")]
10661066
#[cfg_attr(test, assert_instr(vzeroupper))]
10671067
#[stable(feature = "simd_x86", since = "1.27.0")]
1068-
pub unsafe fn _mm256_zeroupper() {
1069-
vzeroupper()
1068+
pub fn _mm256_zeroupper() {
1069+
unsafe { vzeroupper() }
10701070
}
10711071

10721072
/// Shuffles single-precision (32-bit) floating-point elements in `a`

0 commit comments

Comments
 (0)