2323#[ cfg( test) ]
2424use stdarch_test:: assert_instr;
2525
26- use crate :: mem:: transmute;
27-
28- types ! {
29- #![ unstable( feature = "stdarch_arm_dsp" , issue = "117237" ) ]
30-
31- /// ARM-specific 32-bit wide vector of two packed `i16`.
32- pub struct int16x2_t( 2 x i16 ) ;
33- /// ARM-specific 32-bit wide vector of two packed `u16`.
34- pub struct uint16x2_t( 2 x u16 ) ;
35- }
36-
3726extern "unadjusted" {
3827 #[ link_name = "llvm.arm.smulbb" ]
3928 fn arm_smulbb ( a : i32 , b : i32 ) -> i32 ;
@@ -85,8 +74,8 @@ extern "unadjusted" {
8574#[ inline]
8675#[ cfg_attr( test, assert_instr( smulbb) ) ]
8776#[ unstable( feature = "stdarch_arm_dsp" , issue = "117237" ) ]
88- pub unsafe fn __smulbb ( a : int16x2_t , b : int16x2_t ) -> i32 {
89- arm_smulbb ( transmute ( a ) , transmute ( b ) )
77+ pub unsafe fn __smulbb ( a : i32 , b : i32 ) -> i32 {
78+ arm_smulbb ( a , b )
9079}
9180
9281/// Insert a SMULTB instruction
@@ -96,8 +85,8 @@ pub unsafe fn __smulbb(a: int16x2_t, b: int16x2_t) -> i32 {
9685#[ inline]
9786#[ cfg_attr( test, assert_instr( smultb) ) ]
9887#[ unstable( feature = "stdarch_arm_dsp" , issue = "117237" ) ]
99- pub unsafe fn __smultb ( a : int16x2_t , b : int16x2_t ) -> i32 {
100- arm_smultb ( transmute ( a ) , transmute ( b ) )
88+ pub unsafe fn __smultb ( a : i32 , b : i32 ) -> i32 {
89+ arm_smultb ( a , b )
10190}
10291
10392/// Insert a SMULTB instruction
@@ -107,8 +96,8 @@ pub unsafe fn __smultb(a: int16x2_t, b: int16x2_t) -> i32 {
10796#[ inline]
10897#[ cfg_attr( test, assert_instr( smulbt) ) ]
10998#[ unstable( feature = "stdarch_arm_dsp" , issue = "117237" ) ]
110- pub unsafe fn __smulbt ( a : int16x2_t , b : int16x2_t ) -> i32 {
111- arm_smulbt ( transmute ( a ) , transmute ( b ) )
99+ pub unsafe fn __smulbt ( a : i32 , b : i32 ) -> i32 {
100+ arm_smulbt ( a , b )
112101}
113102
114103/// Insert a SMULTT instruction
@@ -118,8 +107,8 @@ pub unsafe fn __smulbt(a: int16x2_t, b: int16x2_t) -> i32 {
118107#[ inline]
119108#[ cfg_attr( test, assert_instr( smultt) ) ]
120109#[ unstable( feature = "stdarch_arm_dsp" , issue = "117237" ) ]
121- pub unsafe fn __smultt ( a : int16x2_t , b : int16x2_t ) -> i32 {
122- arm_smultt ( transmute ( a ) , transmute ( b ) )
110+ pub unsafe fn __smultt ( a : i32 , b : i32 ) -> i32 {
111+ arm_smultt ( a , b )
123112}
124113
125114/// Insert a SMULWB instruction
@@ -130,8 +119,8 @@ pub unsafe fn __smultt(a: int16x2_t, b: int16x2_t) -> i32 {
130119#[ inline]
131120#[ cfg_attr( test, assert_instr( smulwb) ) ]
132121#[ unstable( feature = "stdarch_arm_dsp" , issue = "117237" ) ]
133- pub unsafe fn __smulwb ( a : int16x2_t , b : i32 ) -> i32 {
134- arm_smulwb ( transmute ( a ) , b)
122+ pub unsafe fn __smulwb ( a : i32 , b : i32 ) -> i32 {
123+ arm_smulwb ( a , b)
135124}
136125
137126/// Insert a SMULWT instruction
@@ -142,8 +131,8 @@ pub unsafe fn __smulwb(a: int16x2_t, b: i32) -> i32 {
142131#[ inline]
143132#[ cfg_attr( test, assert_instr( smulwt) ) ]
144133#[ unstable( feature = "stdarch_arm_dsp" , issue = "117237" ) ]
145- pub unsafe fn __smulwt ( a : int16x2_t , b : i32 ) -> i32 {
146- arm_smulwt ( transmute ( a ) , b)
134+ pub unsafe fn __smulwt ( a : i32 , b : i32 ) -> i32 {
135+ arm_smulwt ( a , b)
147136}
148137
149138/// Signed saturating addition
@@ -187,8 +176,8 @@ pub unsafe fn __qdbl(a: i32) -> i32 {
187176#[ inline]
188177#[ cfg_attr( test, assert_instr( smlabb) ) ]
189178#[ unstable( feature = "stdarch_arm_dsp" , issue = "117237" ) ]
190- pub unsafe fn __smlabb ( a : int16x2_t , b : int16x2_t , c : i32 ) -> i32 {
191- arm_smlabb ( transmute ( a ) , transmute ( b ) , c)
179+ pub unsafe fn __smlabb ( a : i32 , b : i32 , c : i32 ) -> i32 {
180+ arm_smlabb ( a , b , c)
192181}
193182
194183/// Insert a SMLABT instruction
@@ -199,8 +188,8 @@ pub unsafe fn __smlabb(a: int16x2_t, b: int16x2_t, c: i32) -> i32 {
199188#[ inline]
200189#[ cfg_attr( test, assert_instr( smlabt) ) ]
201190#[ unstable( feature = "stdarch_arm_dsp" , issue = "117237" ) ]
202- pub unsafe fn __smlabt ( a : int16x2_t , b : int16x2_t , c : i32 ) -> i32 {
203- arm_smlabt ( transmute ( a ) , transmute ( b ) , c)
191+ pub unsafe fn __smlabt ( a : i32 , b : i32 , c : i32 ) -> i32 {
192+ arm_smlabt ( a , b , c)
204193}
205194
206195/// Insert a SMLATB instruction
@@ -211,8 +200,8 @@ pub unsafe fn __smlabt(a: int16x2_t, b: int16x2_t, c: i32) -> i32 {
211200#[ inline]
212201#[ cfg_attr( test, assert_instr( smlatb) ) ]
213202#[ unstable( feature = "stdarch_arm_dsp" , issue = "117237" ) ]
214- pub unsafe fn __smlatb ( a : int16x2_t , b : int16x2_t , c : i32 ) -> i32 {
215- arm_smlatb ( transmute ( a ) , transmute ( b ) , c)
203+ pub unsafe fn __smlatb ( a : i32 , b : i32 , c : i32 ) -> i32 {
204+ arm_smlatb ( a , b , c)
216205}
217206
218207/// Insert a SMLATT instruction
@@ -223,8 +212,8 @@ pub unsafe fn __smlatb(a: int16x2_t, b: int16x2_t, c: i32) -> i32 {
223212#[ inline]
224213#[ cfg_attr( test, assert_instr( smlatt) ) ]
225214#[ unstable( feature = "stdarch_arm_dsp" , issue = "117237" ) ]
226- pub unsafe fn __smlatt ( a : int16x2_t , b : int16x2_t , c : i32 ) -> i32 {
227- arm_smlatt ( transmute ( a ) , transmute ( b ) , c)
215+ pub unsafe fn __smlatt ( a : i32 , b : i32 , c : i32 ) -> i32 {
216+ arm_smlatt ( a , b , c)
228217}
229218
230219/// Insert a SMLAWB instruction
@@ -235,8 +224,8 @@ pub unsafe fn __smlatt(a: int16x2_t, b: int16x2_t, c: i32) -> i32 {
235224#[ inline]
236225#[ cfg_attr( test, assert_instr( smlawb) ) ]
237226#[ unstable( feature = "stdarch_arm_dsp" , issue = "117237" ) ]
238- pub unsafe fn __smlawb ( a : i32 , b : int16x2_t , c : i32 ) -> i32 {
239- arm_smlawb ( a, transmute ( b ) , c)
227+ pub unsafe fn __smlawb ( a : i32 , b : i32 , c : i32 ) -> i32 {
228+ arm_smlawb ( a, b , c)
240229}
241230
242231/// Insert a SMLAWT instruction
@@ -247,8 +236,8 @@ pub unsafe fn __smlawb(a: i32, b: int16x2_t, c: i32) -> i32 {
247236#[ inline]
248237#[ cfg_attr( test, assert_instr( smlawt) ) ]
249238#[ unstable( feature = "stdarch_arm_dsp" , issue = "117237" ) ]
250- pub unsafe fn __smlawt ( a : i32 , b : int16x2_t , c : i32 ) -> i32 {
251- arm_smlawt ( a, transmute ( b ) , c)
239+ pub unsafe fn __smlawt ( a : i32 , b : i32 , c : i32 ) -> i32 {
240+ arm_smlawt ( a, b , c)
252241}
253242
254243#[ cfg( test) ]
0 commit comments