@@ -25318,8 +25318,29 @@ pub unsafe fn _mm512_castsi512_pd(a: __m512i) -> __m512d {
25318
25318
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
25319
25319
#[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(vmovd))]
25320
25320
pub unsafe fn _mm512_cvtsi512_si32(a: __m512i) -> i32 {
25321
- let extract: i32 = simd_extract!(a.as_i32x16(), 0);
25322
- extract
25321
+ simd_extract!(a.as_i32x16(), 0)
25322
+ }
25323
+
25324
+ /// Copy the lower single-precision (32-bit) floating-point element of a to dst.
25325
+ ///
25326
+ /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cvtss_f32)
25327
+ #[inline]
25328
+ #[target_feature(enable = "avx512f")]
25329
+ #[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
25330
+ #[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(vmovd))]
25331
+ pub unsafe fn _mm512_cvtss_f32(a: __m512) -> f32 {
25332
+ simd_extract!(a, 0)
25333
+ }
25334
+
25335
+ /// Copy the lower double-precision (64-bit) floating-point element of a to dst.
25336
+ ///
25337
+ /// [Intel's documentation](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm512_cvtsd_f64)
25338
+ #[inline]
25339
+ #[target_feature(enable = "avx512f")]
25340
+ #[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
25341
+ #[cfg_attr(all(test, not(target_env = "msvc")), assert_instr(vmovd))]
25342
+ pub unsafe fn _mm512_cvtsd_f64(a: __m512d) -> f64 {
25343
+ simd_extract!(a, 0)
25323
25344
}
25324
25345
25325
25346
/// Broadcast the low packed 32-bit integer from a to all elements of dst.
@@ -58278,6 +58299,22 @@ mod tests {
58278
58299
assert_eq!(r, e);
58279
58300
}
58280
58301
58302
+ #[simd_test(enable = "avx512f")]
58303
+ unsafe fn test_mm512_cvtss_f32() {
58304
+ let a = _mm512_setr_ps(
58305
+ 312.0134, 3., 2., 5., 8., 9., 64., 50., -4., -3., -2., -5., -8., -9., -64., -50.,
58306
+ );
58307
+ assert_eq!(_mm512_cvtss_f32(a), 312.0134);
58308
+ }
58309
+
58310
+ #[simd_test(enable = "avx512f")]
58311
+ unsafe fn test_mm512_cvtsd_f64() {
58312
+ let r = _mm612_cvtsd_f64(_mm512_setr_pd(
58313
+ -1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8,
58314
+ ));
58315
+ assert_eq!(r, -1.1);
58316
+ }
58317
+
58281
58318
#[simd_test(enable = "avx512f")]
58282
58319
unsafe fn test_mm512_shuffle_pd() {
58283
58320
let a = _mm512_setr_pd(1., 4., 5., 8., 1., 4., 5., 8.);
0 commit comments