diff --git a/crates/core_arch/src/arm/dsp.rs b/crates/core_arch/src/arm/dsp.rs index 001f642f19..e708bb7061 100644 --- a/crates/core_arch/src/arm/dsp.rs +++ b/crates/core_arch/src/arm/dsp.rs @@ -25,15 +25,6 @@ use stdarch_test::assert_instr; use crate::mem::transmute; -types! { - #![unstable(feature = "stdarch_arm_dsp", issue = "117237")] - - /// ARM-specific 32-bit wide vector of two packed `i16`. - pub struct int16x2_t(2 x i16); - /// ARM-specific 32-bit wide vector of two packed `u16`. - pub struct uint16x2_t(2 x u16); -} - extern "unadjusted" { #[link_name = "llvm.arm.smulbb"] fn arm_smulbb(a: i32, b: i32) -> i32; @@ -85,7 +76,7 @@ extern "unadjusted" { #[inline] #[cfg_attr(test, assert_instr(smulbb))] #[unstable(feature = "stdarch_arm_dsp", issue = "117237")] -pub unsafe fn __smulbb(a: int16x2_t, b: int16x2_t) -> i32 { +pub unsafe fn __smulbb(a: i32, b: i32) -> i32 { arm_smulbb(transmute(a), transmute(b)) } @@ -96,7 +87,7 @@ pub unsafe fn __smulbb(a: int16x2_t, b: int16x2_t) -> i32 { #[inline] #[cfg_attr(test, assert_instr(smultb))] #[unstable(feature = "stdarch_arm_dsp", issue = "117237")] -pub unsafe fn __smultb(a: int16x2_t, b: int16x2_t) -> i32 { +pub unsafe fn __smultb(a: i32, b: i32) -> i32 { arm_smultb(transmute(a), transmute(b)) } @@ -107,7 +98,7 @@ pub unsafe fn __smultb(a: int16x2_t, b: int16x2_t) -> i32 { #[inline] #[cfg_attr(test, assert_instr(smulbt))] #[unstable(feature = "stdarch_arm_dsp", issue = "117237")] -pub unsafe fn __smulbt(a: int16x2_t, b: int16x2_t) -> i32 { +pub unsafe fn __smulbt(a: i32, b: i32) -> i32 { arm_smulbt(transmute(a), transmute(b)) } @@ -118,7 +109,7 @@ pub unsafe fn __smulbt(a: int16x2_t, b: int16x2_t) -> i32 { #[inline] #[cfg_attr(test, assert_instr(smultt))] #[unstable(feature = "stdarch_arm_dsp", issue = "117237")] -pub unsafe fn __smultt(a: int16x2_t, b: int16x2_t) -> i32 { +pub unsafe fn __smultt(a: i32, b: i32) -> i32 { arm_smultt(transmute(a), transmute(b)) } @@ -130,7 +121,7 @@ pub unsafe fn __smultt(a: int16x2_t, b: int16x2_t) -> i32 { #[inline] #[cfg_attr(test, assert_instr(smulwb))] #[unstable(feature = "stdarch_arm_dsp", issue = "117237")] -pub unsafe fn __smulwb(a: int16x2_t, b: i32) -> i32 { +pub unsafe fn __smulwb(a: i32, b: i32) -> i32 { arm_smulwb(transmute(a), b) } @@ -142,7 +133,7 @@ pub unsafe fn __smulwb(a: int16x2_t, b: i32) -> i32 { #[inline] #[cfg_attr(test, assert_instr(smulwt))] #[unstable(feature = "stdarch_arm_dsp", issue = "117237")] -pub unsafe fn __smulwt(a: int16x2_t, b: i32) -> i32 { +pub unsafe fn __smulwt(a: i32, b: i32) -> i32 { arm_smulwt(transmute(a), b) } @@ -187,7 +178,7 @@ pub unsafe fn __qdbl(a: i32) -> i32 { #[inline] #[cfg_attr(test, assert_instr(smlabb))] #[unstable(feature = "stdarch_arm_dsp", issue = "117237")] -pub unsafe fn __smlabb(a: int16x2_t, b: int16x2_t, c: i32) -> i32 { +pub unsafe fn __smlabb(a: i32, b: i32, c: i32) -> i32 { arm_smlabb(transmute(a), transmute(b), c) } @@ -199,7 +190,7 @@ pub unsafe fn __smlabb(a: int16x2_t, b: int16x2_t, c: i32) -> i32 { #[inline] #[cfg_attr(test, assert_instr(smlabt))] #[unstable(feature = "stdarch_arm_dsp", issue = "117237")] -pub unsafe fn __smlabt(a: int16x2_t, b: int16x2_t, c: i32) -> i32 { +pub unsafe fn __smlabt(a: i32, b: i32, c: i32) -> i32 { arm_smlabt(transmute(a), transmute(b), c) } @@ -211,7 +202,7 @@ pub unsafe fn __smlabt(a: int16x2_t, b: int16x2_t, c: i32) -> i32 { #[inline] #[cfg_attr(test, assert_instr(smlatb))] #[unstable(feature = "stdarch_arm_dsp", issue = "117237")] -pub unsafe fn __smlatb(a: int16x2_t, b: int16x2_t, c: i32) -> i32 { +pub unsafe fn __smlatb(a: i32, b: i32, c: i32) -> i32 { arm_smlatb(transmute(a), transmute(b), c) } @@ -223,7 +214,7 @@ pub unsafe fn __smlatb(a: int16x2_t, b: int16x2_t, c: i32) -> i32 { #[inline] #[cfg_attr(test, assert_instr(smlatt))] #[unstable(feature = "stdarch_arm_dsp", issue = "117237")] -pub unsafe fn __smlatt(a: int16x2_t, b: int16x2_t, c: i32) -> i32 { +pub unsafe fn __smlatt(a: i32, b: i32, c: i32) -> i32 { arm_smlatt(transmute(a), transmute(b), c) } @@ -235,7 +226,7 @@ pub unsafe fn __smlatt(a: int16x2_t, b: int16x2_t, c: i32) -> i32 { #[inline] #[cfg_attr(test, assert_instr(smlawb))] #[unstable(feature = "stdarch_arm_dsp", issue = "117237")] -pub unsafe fn __smlawb(a: i32, b: int16x2_t, c: i32) -> i32 { +pub unsafe fn __smlawb(a: i32, b: i32, c: i32) -> i32 { arm_smlawb(a, transmute(b), c) } @@ -247,7 +238,7 @@ pub unsafe fn __smlawb(a: i32, b: int16x2_t, c: i32) -> i32 { #[inline] #[cfg_attr(test, assert_instr(smlawt))] #[unstable(feature = "stdarch_arm_dsp", issue = "117237")] -pub unsafe fn __smlawt(a: i32, b: int16x2_t, c: i32) -> i32 { +pub unsafe fn __smlawt(a: i32, b: i32, c: i32) -> i32 { arm_smlawt(a, transmute(b), c) } diff --git a/crates/core_arch/src/arm/simd32.rs b/crates/core_arch/src/arm/simd32.rs index 260add2464..cb69b2de8b 100644 --- a/crates/core_arch/src/arm/simd32.rs +++ b/crates/core_arch/src/arm/simd32.rs @@ -65,16 +65,27 @@ #[cfg(test)] use stdarch_test::assert_instr; -use crate::{core_arch::arm::dsp::int16x2_t, mem::transmute}; +use crate::mem::transmute; -types! { - #![unstable(feature = "stdarch_arm_dsp", issue = "117237")] +/// ARM-specific vector of four packed `i8` packed into a 32-bit integer. +#[allow(non_camel_case_types)] +#[unstable(feature = "stdarch_arm_dsp", issue = "117237")] +pub type int8x4_t = i32; - /// ARM-specific 32-bit wide vector of four packed `i8`. - pub struct int8x4_t(4 x i8); - /// ARM-specific 32-bit wide vector of four packed `u8`. - pub struct uint8x4_t(4 x u8); -} +/// ARM-specific vector of four packed `u8` packed into a 32-bit integer. +#[allow(non_camel_case_types)] +#[unstable(feature = "stdarch_arm_dsp", issue = "117237")] +pub type uint8x4_t = u32; + +/// ARM-specific vector of two packed `i16` packed into a 32-bit integer. +#[allow(non_camel_case_types)] +#[unstable(feature = "stdarch_arm_dsp", issue = "117237")] +pub type int16x2_t = i32; + +/// ARM-specific vector of two packed `u16` packed into a 32-bit integer. +#[allow(non_camel_case_types)] +#[unstable(feature = "stdarch_arm_dsp", issue = "117237")] +pub type uint16x2_t = u32; macro_rules! dsp_call { ($name:expr, $a:expr, $b:expr) => {