isa: Add missing argument to `bcctr` and `bclr`

This commit is contained in:
InusualZ 2022-05-31 18:07:17 -04:00
parent d03a713a2b
commit b90b46ef8e
2 changed files with 14 additions and 2 deletions

View File

@ -1133,6 +1133,7 @@ pub enum Field {
ps_offset(Offset), ps_offset(Offset),
BO(OpaqueU), BO(OpaqueU),
BI(OpaqueU), BI(OpaqueU),
BH(OpaqueU),
BD(BranchDest), BD(BranchDest),
LI(BranchDest), LI(BranchDest),
SH(OpaqueU), SH(OpaqueU),
@ -1176,6 +1177,7 @@ impl Field {
Field::ps_offset(x) => Some(Argument::Offset(*x)), Field::ps_offset(x) => Some(Argument::Offset(*x)),
Field::BO(x) => Some(Argument::OpaqueU(*x)), Field::BO(x) => Some(Argument::OpaqueU(*x)),
Field::BI(x) => Some(Argument::OpaqueU(*x)), Field::BI(x) => Some(Argument::OpaqueU(*x)),
Field::BH(x) => Some(Argument::OpaqueU(*x)),
Field::BD(x) => Some(Argument::BranchDest(*x)), Field::BD(x) => Some(Argument::BranchDest(*x)),
Field::LI(x) => Some(Argument::BranchDest(*x)), Field::LI(x) => Some(Argument::BranchDest(*x)),
Field::SH(x) => Some(Argument::OpaqueU(*x)), Field::SH(x) => Some(Argument::OpaqueU(*x)),
@ -1217,6 +1219,7 @@ impl Field {
Field::ps_offset(_) => "ps_offset", Field::ps_offset(_) => "ps_offset",
Field::BO(_) => "BO", Field::BO(_) => "BO",
Field::BI(_) => "BI", Field::BI(_) => "BI",
Field::BH(_) => "BH",
Field::BD(_) => "BD", Field::BD(_) => "BD",
Field::LI(_) => "LI", Field::LI(_) => "LI",
Field::SH(_) => "SH", Field::SH(_) => "SH",
@ -1342,10 +1345,12 @@ impl Ins {
Opcode::Bcctr => vec![ Opcode::Bcctr => vec![
Field::BO(OpaqueU(((self.code >> 21u8) & 0x1f) as _)), Field::BO(OpaqueU(((self.code >> 21u8) & 0x1f) as _)),
Field::BI(OpaqueU(((self.code >> 16u8) & 0x1f) as _)), Field::BI(OpaqueU(((self.code >> 16u8) & 0x1f) as _)),
Field::BH(OpaqueU(((self.code >> 11u8) & 0x3) as _)),
], ],
Opcode::Bclr => vec![ Opcode::Bclr => vec![
Field::BO(OpaqueU(((self.code >> 21u8) & 0x1f) as _)), Field::BO(OpaqueU(((self.code >> 21u8) & 0x1f) as _)),
Field::BI(OpaqueU(((self.code >> 16u8) & 0x1f) as _)), Field::BI(OpaqueU(((self.code >> 16u8) & 0x1f) as _)),
Field::BH(OpaqueU(((self.code >> 11u8) & 0x3) as _)),
], ],
Opcode::Cmp => vec![ Opcode::Cmp => vec![
Field::crfD(CRField(((self.code >> 23u8) & 0x7) as _)), Field::crfD(CRField(((self.code >> 23u8) & 0x7) as _)),
@ -5948,6 +5953,10 @@ impl Ins {
((self.code >> 16u8) & 0x1f) as _ ((self.code >> 16u8) & 0x1f) as _
} }
#[inline(always)] #[inline(always)]
pub fn field_BH(&self) -> usize {
((self.code >> 11u8) & 0x3) as _
}
#[inline(always)]
pub fn field_BD(&self) -> isize { pub fn field_BD(&self) -> isize {
((((((self.code >> 2u8) & 0x3fff) ^ 0x2000).wrapping_sub(0x2000)) as i32) << 2u8) as _ ((((((self.code >> 2u8) & 0x3fff) ^ 0x2000).wrapping_sub(0x2000)) as i32) << 2u8) as _
} }

View File

@ -22,6 +22,9 @@ fields:
- name: BI - name: BI
arg: OpaqueU arg: OpaqueU
bits: 11..16 bits: 11..16
- name: BH
arg: OpaqueU
bits: 19..21
- name: BD - name: BD
arg: BranchDest arg: BranchDest
bits: 16..30 bits: 16..30
@ -289,7 +292,7 @@ opcodes:
bitmask: 0xfc007ffe bitmask: 0xfc007ffe
pattern: 0x4c000420 pattern: 0x4c000420
modifiers: [ LK ] modifiers: [ LK ]
args: [ BO, BI ] args: [ BO, BI, BH ]
uses: [ ctr ] uses: [ ctr ]
- name: bclr - name: bclr
@ -297,7 +300,7 @@ opcodes:
bitmask: 0xfc007ffe bitmask: 0xfc007ffe
pattern: 0x4c000020 pattern: 0x4c000020
modifiers: [ LK ] modifiers: [ LK ]
args: [ BO, BI ] args: [ BO, BI, BH ]
uses: [ lr ] uses: [ lr ]
- name: cmp - name: cmp