@@ -28,8 +28,8 @@ unsafe extern "unadjusted" {
28
28
#[ target_feature( enable = "f16c" ) ]
29
29
#[ cfg_attr( test, assert_instr( "vcvtph2ps" ) ) ]
30
30
#[ stable( feature = "x86_f16c_intrinsics" , since = "1.68.0" ) ]
31
- pub unsafe fn _mm_cvtph_ps ( a : __m128i ) -> __m128 {
32
- transmute ( llvm_vcvtph2ps_128 ( transmute ( a) ) )
31
+ pub fn _mm_cvtph_ps ( a : __m128i ) -> __m128 {
32
+ unsafe { transmute ( llvm_vcvtph2ps_128 ( transmute ( a) ) ) }
33
33
}
34
34
35
35
/// Converts the 8 x 16-bit half-precision float values in the 128-bit vector
@@ -40,8 +40,8 @@ pub unsafe fn _mm_cvtph_ps(a: __m128i) -> __m128 {
40
40
#[ target_feature( enable = "f16c" ) ]
41
41
#[ cfg_attr( test, assert_instr( "vcvtph2ps" ) ) ]
42
42
#[ stable( feature = "x86_f16c_intrinsics" , since = "1.68.0" ) ]
43
- pub unsafe fn _mm256_cvtph_ps ( a : __m128i ) -> __m256 {
44
- transmute ( llvm_vcvtph2ps_256 ( transmute ( a) ) )
43
+ pub fn _mm256_cvtph_ps ( a : __m128i ) -> __m256 {
44
+ unsafe { transmute ( llvm_vcvtph2ps_256 ( transmute ( a) ) ) }
45
45
}
46
46
47
47
/// Converts the 4 x 32-bit float values in the 128-bit vector `a` into 4 x
@@ -62,11 +62,13 @@ pub unsafe fn _mm256_cvtph_ps(a: __m128i) -> __m256 {
62
62
#[ cfg_attr( test, assert_instr( "vcvtps2ph" , IMM_ROUNDING = 0 ) ) ]
63
63
#[ rustc_legacy_const_generics( 1 ) ]
64
64
#[ stable( feature = "x86_f16c_intrinsics" , since = "1.68.0" ) ]
65
- pub unsafe fn _mm_cvtps_ph < const IMM_ROUNDING : i32 > ( a : __m128 ) -> __m128i {
65
+ pub fn _mm_cvtps_ph < const IMM_ROUNDING : i32 > ( a : __m128 ) -> __m128i {
66
66
static_assert_uimm_bits ! ( IMM_ROUNDING , 3 ) ;
67
- let a = a. as_f32x4 ( ) ;
68
- let r = llvm_vcvtps2ph_128 ( a, IMM_ROUNDING ) ;
69
- transmute ( r)
67
+ unsafe {
68
+ let a = a. as_f32x4 ( ) ;
69
+ let r = llvm_vcvtps2ph_128 ( a, IMM_ROUNDING ) ;
70
+ transmute ( r)
71
+ }
70
72
}
71
73
72
74
/// Converts the 8 x 32-bit float values in the 256-bit vector `a` into 8 x
@@ -86,11 +88,13 @@ pub unsafe fn _mm_cvtps_ph<const IMM_ROUNDING: i32>(a: __m128) -> __m128i {
86
88
#[ cfg_attr( test, assert_instr( "vcvtps2ph" , IMM_ROUNDING = 0 ) ) ]
87
89
#[ rustc_legacy_const_generics( 1 ) ]
88
90
#[ stable( feature = "x86_f16c_intrinsics" , since = "1.68.0" ) ]
89
- pub unsafe fn _mm256_cvtps_ph < const IMM_ROUNDING : i32 > ( a : __m256 ) -> __m128i {
91
+ pub fn _mm256_cvtps_ph < const IMM_ROUNDING : i32 > ( a : __m256 ) -> __m128i {
90
92
static_assert_uimm_bits ! ( IMM_ROUNDING , 3 ) ;
91
- let a = a. as_f32x8 ( ) ;
92
- let r = llvm_vcvtps2ph_256 ( a, IMM_ROUNDING ) ;
93
- transmute ( r)
93
+ unsafe {
94
+ let a = a. as_f32x8 ( ) ;
95
+ let r = llvm_vcvtps2ph_256 ( a, IMM_ROUNDING ) ;
96
+ transmute ( r)
97
+ }
94
98
}
95
99
96
100
#[ cfg( test) ]
0 commit comments