diff --git a/src/isa/macros.rs b/src/isa/macros.rs index 74cbde3..623136a 100644 --- a/src/isa/macros.rs +++ b/src/isa/macros.rs @@ -220,7 +220,7 @@ macro_rules! instr { (extr s16[$idx:literal], $reg:ident[$reg_idx:literal], a16[$offset_idx:literal]) => { Instr::Bytes(BytesOp::Extr( RegS::from($idx), - $crate::_reg_ty!(Reg, $reg), + $crate::_reg_tyar!(Reg, $reg), $crate::_reg_idx16!($reg_idx), $crate::_reg_idx16!($offset_idx), )) @@ -228,7 +228,7 @@ macro_rules! instr { (inj s16[$idx:literal], $reg:ident[$reg_idx:literal], a16[$offset_idx:literal]) => { Instr::Bytes(BytesOp::Inj( RegS::from($idx), - $crate::_reg_ty!(Reg, $reg), + $crate::_reg_tyar!(Reg, $reg), $crate::_reg_idx16!($reg_idx), $crate::_reg_idx16!($offset_idx), )) @@ -1355,6 +1355,60 @@ macro_rules! _reg_tyr { }; } +#[doc(hidden)] +#[macro_export] +macro_rules! _reg_tyar { + ($ident:ident,a8) => { + $crate::paste! { [<$ident AR>] :: A8 } + }; + ($ident:ident,a16) => { + $crate::paste! { [<$ident AR>] :: A16 } + }; + ($ident:ident,a32) => { + $crate::paste! { [<$ident AR>] :: A32 } + }; + ($ident:ident,a64) => { + $crate::paste! { [<$ident AR>] :: A64 } + }; + ($ident:ident,a128) => { + $crate::paste! { [<$ident AR>] :: A128 } + }; + ($ident:ident,a256) => { + $crate::paste! { [<$ident AR>] :: A256 } + }; + ($ident:ident,a512) => { + $crate::paste! { [<$ident AR>] :: A512 } + }; + ($ident:ident,a1024) => { + $crate::paste! { [<$ident AR>] :: A1024 } + }; + + ($ident:ident,r128) => { + $crate::paste! { [<$ident AR>] :: R128 } + }; + ($ident:ident,r160) => { + $crate::paste! { [<$ident AR>] :: R160 } + }; + ($ident:ident,r256) => { + $crate::paste! { [<$ident AR>] :: R256 } + }; + ($ident:ident,r512) => { + $crate::paste! { [<$ident AR>] :: R512 } + }; + ($ident:ident,r1024) => { + $crate::paste! { [<$ident AR>] :: R1024 } + }; + ($ident:ident,r2048) => { + $crate::paste! { [<$ident AR>] :: R2048 } + }; + ($ident:ident,r4096) => { + $crate::paste! { [<$ident AR>] :: R4096 } + }; + ($ident:ident,r8192) => { + $crate::paste! { [<$ident AR>] :: R8192 } + }; +} + #[doc(hidden)] #[macro_export] macro_rules! _reg_idx {