diff --git a/library/stdarch/crates/core_arch/src/simd_llvm.rs b/library/stdarch/crates/core_arch/src/simd_llvm.rs index 5b5c6dd0a8ad..729953faeae5 100644 --- a/library/stdarch/crates/core_arch/src/simd_llvm.rs +++ b/library/stdarch/crates/core_arch/src/simd_llvm.rs @@ -61,5 +61,7 @@ extern "platform-intrinsic" { pub fn simd_fmax(a: T, b: T) -> T; pub fn simd_fsqrt(a: T) -> T; + pub fn simd_floor(a: T) -> T; + pub fn simd_ceil(a: T) -> T; pub fn simd_fma(a: T, b: T, c: T) -> T; } diff --git a/library/stdarch/crates/core_arch/src/x86/avx.rs b/library/stdarch/crates/core_arch/src/x86/avx.rs index b4d8647d7358..76d648274310 100644 --- a/library/stdarch/crates/core_arch/src/x86/avx.rs +++ b/library/stdarch/crates/core_arch/src/x86/avx.rs @@ -426,7 +426,7 @@ pub unsafe fn _mm256_round_pd(a: __m256d, b: i32) -> __m256d { #[cfg_attr(test, assert_instr(vroundpd))] #[stable(feature = "simd_x86", since = "1.27.0")] pub unsafe fn _mm256_ceil_pd(a: __m256d) -> __m256d { - roundpd256(a, 0x02) + simd_ceil(a) } /// Rounds packed double-precision (64-bit) floating point elements in `a` @@ -438,7 +438,7 @@ pub unsafe fn _mm256_ceil_pd(a: __m256d) -> __m256d { #[cfg_attr(test, assert_instr(vroundpd))] #[stable(feature = "simd_x86", since = "1.27.0")] pub unsafe fn _mm256_floor_pd(a: __m256d) -> __m256d { - roundpd256(a, 0x01) + simd_floor(a) } /// Rounds packed single-precision (32-bit) floating point elements in `a` @@ -477,7 +477,7 @@ pub unsafe fn _mm256_round_ps(a: __m256, b: i32) -> __m256 { #[cfg_attr(test, assert_instr(vroundps))] #[stable(feature = "simd_x86", since = "1.27.0")] pub unsafe fn _mm256_ceil_ps(a: __m256) -> __m256 { - roundps256(a, 0x02) + simd_ceil(a) } /// Rounds packed single-precision (32-bit) floating point elements in `a` @@ -489,7 +489,7 @@ pub unsafe fn _mm256_ceil_ps(a: __m256) -> __m256 { #[cfg_attr(test, assert_instr(vroundps))] #[stable(feature = "simd_x86", since = "1.27.0")] pub unsafe fn _mm256_floor_ps(a: __m256) -> __m256 { - roundps256(a, 0x01) + simd_floor(a) } /// Returns the square root of packed single-precision (32-bit) floating point