Skip to content

Commit

Permalink
isa: asm fix RegAR macro
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Apr 22, 2024
1 parent 3c4d6c2 commit e316464
Showing 1 changed file with 56 additions and 2 deletions.
58 changes: 56 additions & 2 deletions src/isa/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,15 @@ 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),
))
};
(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),
))
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit e316464

Please sign in to comment.