diff --git a/crates/core_arch/src/x86/f16c.rs b/crates/core_arch/src/x86/f16c.rs index 8b25fd65e8..e213c3d647 100644 --- a/crates/core_arch/src/x86/f16c.rs +++ b/crates/core_arch/src/x86/f16c.rs @@ -29,6 +29,7 @@ extern "unadjusted" { #[inline] #[target_feature(enable = "f16c")] #[cfg_attr(test, assert_instr("vcvtph2ps"))] +#[stable(feature = "x86_f16c_intrinsics", since = "1.68.0")] pub unsafe fn _mm_cvtph_ps(a: __m128i) -> __m128 { transmute(llvm_vcvtph2ps_128(transmute(a))) } @@ -38,6 +39,7 @@ pub unsafe fn _mm_cvtph_ps(a: __m128i) -> __m128 { #[inline] #[target_feature(enable = "f16c")] #[cfg_attr(test, assert_instr("vcvtph2ps"))] +#[stable(feature = "x86_f16c_intrinsics", since = "1.68.0")] pub unsafe fn _mm256_cvtph_ps(a: __m128i) -> __m256 { transmute(llvm_vcvtph2ps_256(transmute(a))) } @@ -57,6 +59,7 @@ pub unsafe fn _mm256_cvtph_ps(a: __m128i) -> __m256 { #[target_feature(enable = "f16c")] #[cfg_attr(test, assert_instr("vcvtps2ph", IMM_ROUNDING = 0))] #[rustc_legacy_const_generics(1)] +#[stable(feature = "x86_f16c_intrinsics", since = "1.68.0")] pub unsafe fn _mm_cvtps_ph(a: __m128) -> __m128i { static_assert_imm3!(IMM_ROUNDING); let a = a.as_f32x4(); @@ -78,6 +81,7 @@ pub unsafe fn _mm_cvtps_ph(a: __m128) -> __m128i { #[target_feature(enable = "f16c")] #[cfg_attr(test, assert_instr("vcvtps2ph", IMM_ROUNDING = 0))] #[rustc_legacy_const_generics(1)] +#[stable(feature = "x86_f16c_intrinsics", since = "1.68.0")] pub unsafe fn _mm256_cvtps_ph(a: __m256) -> __m128i { static_assert_imm3!(IMM_ROUNDING); let a = a.as_f32x8(); diff --git a/crates/std_detect/tests/x86-specific.rs b/crates/std_detect/tests/x86-specific.rs index e481620c7c..6526278747 100644 --- a/crates/std_detect/tests/x86-specific.rs +++ b/crates/std_detect/tests/x86-specific.rs @@ -20,6 +20,7 @@ fn dump() { println!("sse4.2: {:?}", is_x86_feature_detected!("sse4.2")); println!("sse4a: {:?}", is_x86_feature_detected!("sse4a")); println!("sha: {:?}", is_x86_feature_detected!("sha")); + println!("f16c: {:?}", is_x86_feature_detected!("f16c")); println!("avx: {:?}", is_x86_feature_detected!("avx")); println!("avx2: {:?}", is_x86_feature_detected!("avx2")); println!("avx512f {:?}", is_x86_feature_detected!("avx512f")); @@ -108,6 +109,7 @@ fn compare_with_cupid() { assert_eq!(is_x86_feature_detected!("sse4.2"), information.sse4_2()); assert_eq!(is_x86_feature_detected!("sse4a"), information.sse4a()); assert_eq!(is_x86_feature_detected!("sha"), information.sha()); + assert_eq!(is_x86_feature_detected!("f16c"), information.f16c()); assert_eq!(is_x86_feature_detected!("avx"), information.avx()); assert_eq!(is_x86_feature_detected!("avx2"), information.avx2()); assert_eq!(is_x86_feature_detected!("avx512f"), information.avx512f());