progress mnemonics

This commit is contained in:
Richard Patel 2022-04-06 17:41:13 +02:00
parent eb39f9fa47
commit c8c1daaa64
4 changed files with 915 additions and 587 deletions

File diff suppressed because it is too large Load Diff

View File

@ -203,7 +203,7 @@ impl Field {
Field::tbr(x) => Some(Argument::OpaqueU(*x)), Field::tbr(x) => Some(Argument::OpaqueU(*x)),
Field::mtfsf_FM(x) => Some(Argument::OpaqueU(*x)), Field::mtfsf_FM(x) => Some(Argument::OpaqueU(*x)),
Field::mtfsf_IMM(x) => Some(Argument::OpaqueU(*x)), Field::mtfsf_IMM(x) => Some(Argument::OpaqueU(*x)),
Field::tw_TO(x) => Some(Argument::OpaqueU(*x)), Field::TO(x) => Some(Argument::OpaqueU(*x)),
_ => None, _ => None,
} }
} }

View File

@ -8,7 +8,7 @@ use itertools::Itertools;
use proc_macro2::{Ident, Literal, Span, TokenStream, TokenTree}; use proc_macro2::{Ident, Literal, Span, TokenStream, TokenTree};
use quote::quote; use quote::quote;
use serde::{Deserialize, Deserializer}; use serde::{Deserialize, Deserializer};
use syn::LitInt; use syn::{LitInt, LitStr};
macro_rules! token_stream { macro_rules! token_stream {
($stream:ident) => { ($stream:ident) => {
@ -23,6 +23,9 @@ fn main() {
} }
} }
type Error = Box<dyn std::error::Error>;
type Result<T> = std::result::Result<T, Error>;
fn _main() -> Result<()> { fn _main() -> Result<()> {
let isa = load_isa()?; let isa = load_isa()?;
@ -172,6 +175,7 @@ impl Opcode {
pub(crate) struct Mnemonic { pub(crate) struct Mnemonic {
name: String, name: String,
opcode: String, opcode: String,
modifiers: Vec<String>,
args: Vec<String>, args: Vec<String>,
condition: String, condition: String,
#[serde(rename = "match")] #[serde(rename = "match")]
@ -324,14 +328,19 @@ impl Isa {
for field in &self.fields { for field in &self.fields {
field_by_name.insert(field.name.clone(), field); field_by_name.insert(field.name.clone(), field);
} }
// Map mnemonics by opcode.
let mut mnemonics_by_opcode = HashMap::<&String, Vec<&Mnemonic>>::new();
for simple in &self.mnemonics {
mnemonics_by_opcode.entry(&simple.opcode).or_insert_with(|| Vec::new()).push(simple)
}
// Generate match arms for each opcode. // Generate match arms for each opcode.
let mut field_match_arms = Vec::new(); let mut field_match_arms = Vec::new();
let mut def_match_arms = Vec::new(); let mut def_match_arms = Vec::new();
let mut use_match_arms = Vec::new(); let mut use_match_arms = Vec::new();
let mut modifier_match_arms = Vec::new(); let mut modifier_match_arms = Vec::new();
let mut simplified_ins_match_arms = Vec::new();
for opcode in &self.opcodes { for opcode in &self.opcodes {
// Generate fields of opcode. // Generate fields of opcode.
// TODO Support mnemonics.
let mut fields = Vec::new(); let mut fields = Vec::new();
for arg in &opcode.args { for arg in &opcode.args {
let field: &Field = field_by_name.get(arg).ok_or_else(|| { let field: &Field = field_by_name.get(arg).ok_or_else(|| {
@ -348,36 +357,12 @@ impl Isa {
}); });
// Generate modifiers. // Generate modifiers.
let mut set_modifiers: Vec<TokenTree> = Vec::new(); let modifiers = ModifiersExpr {
for modifier in &opcode.modifiers { modifiers: opcode.modifiers.clone(),
set_modifiers.extend(match modifier.as_str() { side_effects: opcode.side_effects.clone(),
"OE" => quote! { m.oe = self.bit(21); }, }.build()?;
"Rc" => quote! { m.rc = self.bit(31); },
"AA" => quote! { m.aa = self.bit(30); },
"LK" => quote! { m.lk = self.bit(31); },
_ => {
return Err(format!("unsupported modifier {}", modifier).into());
}
})
}
for modifier in &opcode.side_effects {
set_modifiers.extend(match modifier.as_str() {
"OE" => quote! { m.oe = true; },
"Rc" => quote! { m.rc = true; },
"AA" => quote! { m.aa = true; },
"LK" => quote! { m.lk = true; },
_ => {
return Err(format!("unsupported modifier {}", modifier).into());
}
})
}
let set_modifiers = token_stream!(set_modifiers);
modifier_match_arms.push(quote! { modifier_match_arms.push(quote! {
Opcode::#ident => { Opcode::#ident => #modifiers,
let mut m = Modifiers::default();
#set_modifiers
m
}
}); });
// Generate defs. // Generate defs.
@ -434,11 +419,59 @@ impl Isa {
uses uses
}, },
}); });
// Generate instruction simplification.
if let Some(mnemonics) = mnemonics_by_opcode.get(&opcode.name) {
let mut simplified_conditions = Vec::new();
for mnemonic in mnemonics {
if mnemonic.matcher.is_empty() {
continue; // TODO else branch
}
// Emit if condition.
simplified_conditions.push(quote!(if));
for (i, condition) in mnemonic.matcher.iter().enumerate() {
if i > 0 {
simplified_conditions.push(quote!(&&));
}
// Express value from opcode.
let field: &Field = field_by_name.get(&condition.arg).ok_or_else(|| {
Error::from(format!("undefined field {}", &condition.arg))
})?;
simplified_conditions.push(field.express_value_self());
// Equate with literal.
let lit_int = LitInt::new(&format!("{}", condition.value), Span::call_site());
simplified_conditions.push(quote!(== #lit_int));
}
// Emit branch.
let mnemonic_lit = LitStr::new(&mnemonic.name, Span::call_site());
let modifiers = ModifiersExpr {
modifiers: mnemonic.modifiers.clone(),
side_effects: vec![],
}.build()?;
simplified_conditions.push(quote! {
{
return SimplifiedIns {
mnemonic: #mnemonic_lit,
modifiers: #modifiers,
args: vec![],
ins: self,
};
}
});
}
let simplified_conditions = token_stream!(simplified_conditions);
simplified_ins_match_arms.push(quote! {
Opcode::#ident => {
#simplified_conditions
},
});
}
} }
let field_match_arms = token_stream!(field_match_arms); let field_match_arms = token_stream!(field_match_arms);
let def_match_arms = token_stream!(def_match_arms); let def_match_arms = token_stream!(def_match_arms);
let use_match_arms = token_stream!(use_match_arms); let use_match_arms = token_stream!(use_match_arms);
let modifier_match_arms = token_stream!(modifier_match_arms); let modifier_match_arms = token_stream!(modifier_match_arms);
let simplified_ins_match_arms = token_stream!(simplified_ins_match_arms);
// Generate final fields function. // Generate final fields function.
let ins_impl = quote! { let ins_impl = quote! {
impl Ins { impl Ins {
@ -474,6 +507,10 @@ impl Isa {
} }
pub(crate) fn _simplified(self) -> SimplifiedIns { pub(crate) fn _simplified(self) -> SimplifiedIns {
match self.op {
#simplified_ins_match_arms
_ => {}
}
SimplifiedIns { SimplifiedIns {
mnemonic: self.op.mnemonic(), mnemonic: self.op.mnemonic(),
modifiers: self._modifiers(), modifiers: self._modifiers(),
@ -532,5 +569,56 @@ fn to_rust_variant_str(key: &str) -> Result<String> {
} }
} }
type Error = Box<dyn std::error::Error>; #[derive(Default)]
type Result<T> = std::result::Result<T, Error>; pub(crate) struct ModifiersExpr {
pub(crate) modifiers: Vec<String>,
pub(crate) side_effects: Vec<String>,
}
impl ModifiersExpr {
fn new() -> Self {
Self::default()
}
fn build(&self) -> Result<TokenStream> {
if self.modifiers.is_empty() && self.side_effects.is_empty() {
return Ok(Self::build_empty());
}
let mut statements: Vec<TokenTree> = Vec::new();
for modifier in &self.modifiers {
statements.extend(match modifier.as_str() {
"OE" => quote! { m.oe = self.bit(21); },
"Rc" => quote! { m.rc = self.bit(31); },
"AA" => quote! { m.aa = self.bit(30); },
"LK" => quote! { m.lk = self.bit(31); },
_ => {
return Err(format!("unsupported modifier {}", modifier).into());
}
})
}
for modifier in &self.side_effects {
statements.extend(match modifier.as_str() {
// TODO dedup modifiers
"OE" => quote! { m.oe = true; },
"Rc" => quote! { m.rc = true; },
"AA" => quote! { m.aa = true; },
"LK" => quote! { m.lk = true; },
_ => {
return Err(format!("unsupported modifier {}", modifier).into());
}
})
}
let statements = token_stream!(statements);
Ok(quote! {
{
let mut m = Modifiers::default();
#statements
m
}
})
}
fn build_empty() -> TokenStream {
quote!(Modifiers::default())
}
}

108
isa.yaml
View File

@ -127,7 +127,7 @@ fields:
arg: "OpaqueU" arg: "OpaqueU"
desc: "Immediate for mtfsfi" desc: "Immediate for mtfsfi"
bits: "16..20" bits: "16..20"
- name: "tw_TO" - name: "TO"
arg: "OpaqueU" arg: "OpaqueU"
desc: "Bitset for tw and twi" desc: "Bitset for tw and twi"
bits: "6..11" bits: "6..11"
@ -1048,7 +1048,7 @@ opcodes:
desc: "Move from FPSCR" desc: "Move from FPSCR"
bitmask: 0xfc1ffffe bitmask: 0xfc1ffffe
pattern: 0xfc00048e pattern: 0xfc00048e
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "crfD" ] args: [ "crfD" ]
defs: [ "crfD" ] defs: [ "crfD" ]
@ -1099,7 +1099,7 @@ opcodes:
desc: "Move to FPSCR Bit 0" desc: "Move to FPSCR Bit 0"
bitmask: 0xfc1ffffe bitmask: 0xfc1ffffe
pattern: 0xfc00008c pattern: 0xfc00008c
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "crbD" ] args: [ "crbD" ]
defs: [ "crbD" ] defs: [ "crbD" ]
@ -1107,7 +1107,7 @@ opcodes:
desc: "Move to FPSCR Bit 1" desc: "Move to FPSCR Bit 1"
bitmask: 0xfc1ffffe bitmask: 0xfc1ffffe
pattern: 0xfc00004c pattern: 0xfc00004c
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "crbD" ] args: [ "crbD" ]
defs: [ "crbD" ] defs: [ "crbD" ]
@ -1115,7 +1115,7 @@ opcodes:
desc: "Move to FPSCR Fields" desc: "Move to FPSCR Fields"
bitmask: 0xfe0107fe bitmask: 0xfe0107fe
pattern: 0xfc00058e pattern: 0xfc00058e
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "mtfsf_FM", "frB" ] args: [ "mtfsf_FM", "frB" ]
uses: [ "frB" ] uses: [ "frB" ]
@ -1123,7 +1123,7 @@ opcodes:
desc: "Move to FPSCR Field Immediate" desc: "Move to FPSCR Field Immediate"
bitmask: 0xfc7f0ffe bitmask: 0xfc7f0ffe
pattern: 0xfc00010c pattern: 0xfc00010c
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "crfD", "mtfsf_IMM" ] args: [ "crfD", "mtfsf_IMM" ]
defs: [ "crfD" ] defs: [ "crfD" ]
@ -1159,7 +1159,7 @@ opcodes:
desc: "Multiply High Word" desc: "Multiply High Word"
bitmask: 0xfc0007fe bitmask: 0xfc0007fe
pattern: 0x7c000096 pattern: 0x7c000096
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "rD", "rA", "rB" ] args: [ "rD", "rA", "rB" ]
defs: [ "rD" ] defs: [ "rD" ]
uses: [ "rA", "rB" ] uses: [ "rA", "rB" ]
@ -1168,7 +1168,7 @@ opcodes:
desc: "Multiply High Word Unsigned" desc: "Multiply High Word Unsigned"
bitmask: 0xfc0007fe bitmask: 0xfc0007fe
pattern: 0x7c000016 pattern: 0x7c000016
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "rD", "rA", "rB" ] args: [ "rD", "rA", "rB" ]
defs: [ "rD" ] defs: [ "rD" ]
uses: [ "rA", "rB" ] uses: [ "rA", "rB" ]
@ -1177,7 +1177,7 @@ opcodes:
desc: "Multiply Low Immediate" desc: "Multiply Low Immediate"
bitmask: 0xfc000000 bitmask: 0xfc000000
pattern: 0x1c000000 pattern: 0x1c000000
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "rD", "rA", "simm" ] args: [ "rD", "rA", "simm" ]
defs: [ "rD" ] defs: [ "rD" ]
uses: [ "rA" ] uses: [ "rA" ]
@ -1186,7 +1186,7 @@ opcodes:
desc: "Multiply Low Word" desc: "Multiply Low Word"
bitmask: 0xfc0003fe bitmask: 0xfc0003fe
pattern: 0x7c0001d6 pattern: 0x7c0001d6
modifier: [ "OE", "Rc" ] modifiers: [ "OE", "Rc" ]
args: [ "rD", "rA", "rB" ] args: [ "rD", "rA", "rB" ]
defs: [ "rD" ] defs: [ "rD" ]
uses: [ "rA", "rB" ] uses: [ "rA", "rB" ]
@ -1195,7 +1195,7 @@ opcodes:
desc: "NAND" desc: "NAND"
bitmask: 0xfc0007fe bitmask: 0xfc0007fe
pattern: 0x7c0003b8 pattern: 0x7c0003b8
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "rA", "rS", "rB" ] args: [ "rA", "rS", "rB" ]
defs: [ "rA" ] defs: [ "rA" ]
uses: [ "rS", "rB" ] uses: [ "rS", "rB" ]
@ -1204,7 +1204,7 @@ opcodes:
desc: "Negate" desc: "Negate"
bitmask: 0xfc00fffe bitmask: 0xfc00fffe
pattern: 0x7c0000d0 pattern: 0x7c0000d0
modifier: [ "OE", "Rc" ] modifiers: [ "OE", "Rc" ]
args: [ "rD", "rA" ] args: [ "rD", "rA" ]
defs: [ "rD" ] defs: [ "rD" ]
uses: [ "rA" ] uses: [ "rA" ]
@ -1213,7 +1213,7 @@ opcodes:
desc: "NOR" desc: "NOR"
bitmask: 0xfc0007fe bitmask: 0xfc0007fe
pattern: 0x7c0000f8 pattern: 0x7c0000f8
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "rA", "rS", "rB" ] args: [ "rA", "rS", "rB" ]
defs: [ "rA" ] defs: [ "rA" ]
uses: [ "rS", "rB" ] uses: [ "rS", "rB" ]
@ -1222,7 +1222,7 @@ opcodes:
desc: "OR" desc: "OR"
bitmask: 0xfc0007fe bitmask: 0xfc0007fe
pattern: 0x7c000378 pattern: 0x7c000378
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "rA", "rS", "rB" ] args: [ "rA", "rS", "rB" ]
defs: [ "rA" ] defs: [ "rA" ]
uses: [ "rS", "rB" ] uses: [ "rS", "rB" ]
@ -1231,7 +1231,7 @@ opcodes:
desc: "OR with Complement" desc: "OR with Complement"
bitmask: 0xfc0007fe bitmask: 0xfc0007fe
pattern: 0x7c000338 pattern: 0x7c000338
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "rA", "rS", "rB" ] args: [ "rA", "rS", "rB" ]
defs: [ "rA" ] defs: [ "rA" ]
uses: [ "rS", "rB" ] uses: [ "rS", "rB" ]
@ -1318,7 +1318,7 @@ opcodes:
desc: "Paired Single Absolute Value" desc: "Paired Single Absolute Value"
bitmask: 0xfc1f07fe bitmask: 0xfc1f07fe
pattern: 0x10000210 pattern: 0x10000210
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frB" ] args: [ "frD", "frA", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frB" ] uses: [ "frA", "frB" ]
@ -1327,7 +1327,7 @@ opcodes:
desc: "Paired Single Add" desc: "Paired Single Add"
bitmask: 0xfc0007fe bitmask: 0xfc0007fe
pattern: 0x1000002a pattern: 0x1000002a
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frB" ] args: [ "frD", "frA", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frB" ] uses: [ "frA", "frB" ]
@ -1368,7 +1368,7 @@ opcodes:
desc: "Paired Single Divide" desc: "Paired Single Divide"
bitmask: 0xfc0007fe bitmask: 0xfc0007fe
pattern: 0x10000024 pattern: 0x10000024
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frB" ] args: [ "frD", "frA", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frB" ] uses: [ "frA", "frB" ]
@ -1377,7 +1377,7 @@ opcodes:
desc: "Paired Single Multiply-Add" desc: "Paired Single Multiply-Add"
bitmask: 0xfc00003e bitmask: 0xfc00003e
pattern: 0x1000003a pattern: 0x1000003a
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frC", "frB" ] args: [ "frD", "frA", "frC", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frC", "frB" ] uses: [ "frA", "frC", "frB" ]
@ -1386,7 +1386,7 @@ opcodes:
desc: "Paired Single Multiply-Add Scalar high" desc: "Paired Single Multiply-Add Scalar high"
bitmask: 0xfc00003e bitmask: 0xfc00003e
pattern: 0x1000001c pattern: 0x1000001c
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frC", "frB" ] args: [ "frD", "frA", "frC", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frC", "frB" ] uses: [ "frA", "frC", "frB" ]
@ -1395,7 +1395,7 @@ opcodes:
desc: "Paired Single Multiply-Add Scalar low" desc: "Paired Single Multiply-Add Scalar low"
bitmask: 0xfc00003e bitmask: 0xfc00003e
pattern: 0x1000001e pattern: 0x1000001e
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frC", "frB" ] args: [ "frD", "frA", "frC", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frC", "frB" ] uses: [ "frA", "frC", "frB" ]
@ -1404,7 +1404,7 @@ opcodes:
desc: "Paired Single MERGE high" desc: "Paired Single MERGE high"
bitmask: 0xfc0007fe bitmask: 0xfc0007fe
pattern: 0x10000420 pattern: 0x10000420
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frB" ] args: [ "frD", "frA", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frB" ] uses: [ "frA", "frB" ]
@ -1413,7 +1413,7 @@ opcodes:
desc: "Paired Single MERGE direct" desc: "Paired Single MERGE direct"
bitmask: 0xfc0007fe bitmask: 0xfc0007fe
pattern: 0x10000460 pattern: 0x10000460
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frB" ] args: [ "frD", "frA", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frB" ] uses: [ "frA", "frB" ]
@ -1422,7 +1422,7 @@ opcodes:
desc: "Paired Single MERGE swapped" desc: "Paired Single MERGE swapped"
bitmask: 0xfc0007fe bitmask: 0xfc0007fe
pattern: 0x100004a0 pattern: 0x100004a0
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frB" ] args: [ "frD", "frA", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frB" ] uses: [ "frA", "frB" ]
@ -1431,7 +1431,7 @@ opcodes:
desc: "Paired Single MERGE low" desc: "Paired Single MERGE low"
bitmask: 0xfc0007fe bitmask: 0xfc0007fe
pattern: 0x100004e0 pattern: 0x100004e0
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frB" ] args: [ "frD", "frA", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frB" ] uses: [ "frA", "frB" ]
@ -1440,7 +1440,7 @@ opcodes:
desc: "Paired Single Move Register" desc: "Paired Single Move Register"
bitmask: 0xfc1f07fe bitmask: 0xfc1f07fe
pattern: 0x10000090 pattern: 0x10000090
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frB" ] args: [ "frD", "frA", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frB" ] uses: [ "frB" ]
@ -1449,7 +1449,7 @@ opcodes:
desc: "Paired Single Multiply-Subtract" desc: "Paired Single Multiply-Subtract"
bitmask: 0xfc00003e bitmask: 0xfc00003e
pattern: 0x10000038 pattern: 0x10000038
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frC", "frB" ] args: [ "frD", "frA", "frC", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frC", "frB" ] uses: [ "frA", "frC", "frB" ]
@ -1458,7 +1458,7 @@ opcodes:
desc: "Paired Single Multiply" desc: "Paired Single Multiply"
bitmask: 0xfc00f83e bitmask: 0xfc00f83e
pattern: 0x10000032 pattern: 0x10000032
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frC" ] args: [ "frD", "frA", "frC" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frC" ] uses: [ "frA", "frC" ]
@ -1467,7 +1467,7 @@ opcodes:
desc: "Paired Single Multiply Scalar high" desc: "Paired Single Multiply Scalar high"
bitmask: 0xfc00f83e bitmask: 0xfc00f83e
pattern: 0x10000018 pattern: 0x10000018
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frC" ] args: [ "frD", "frA", "frC" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frC" ] uses: [ "frA", "frC" ]
@ -1476,7 +1476,7 @@ opcodes:
desc: "Paired Single Multiply Scalar low" desc: "Paired Single Multiply Scalar low"
bitmask: 0xfc00f83e bitmask: 0xfc00f83e
pattern: 0x1000001a pattern: 0x1000001a
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frC" ] args: [ "frD", "frA", "frC" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frC" ] uses: [ "frA", "frC" ]
@ -1485,7 +1485,7 @@ opcodes:
desc: "Paired Single Negative Absolute Value" desc: "Paired Single Negative Absolute Value"
bitmask: 0xfc1f07fe bitmask: 0xfc1f07fe
pattern: 0x10000110 pattern: 0x10000110
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frB" ] args: [ "frD", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frB" ] uses: [ "frB" ]
@ -1494,7 +1494,7 @@ opcodes:
desc: "Paired Single Negate" desc: "Paired Single Negate"
bitmask: 0xfc1f07fe bitmask: 0xfc1f07fe
pattern: 0x10000050 pattern: 0x10000050
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frB" ] args: [ "frD", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frB" ] uses: [ "frB" ]
@ -1503,7 +1503,7 @@ opcodes:
desc: "Paired Single Negative Multiply-Add" desc: "Paired Single Negative Multiply-Add"
bitmask: 0xfc00003e bitmask: 0xfc00003e
pattern: 0x1000003e pattern: 0x1000003e
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frC", "frB" ] args: [ "frD", "frA", "frC", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frC", "frB" ] uses: [ "frA", "frC", "frB" ]
@ -1512,7 +1512,7 @@ opcodes:
desc: "Paired Single Negative Multiply-Subtract" desc: "Paired Single Negative Multiply-Subtract"
bitmask: 0xfc00003e bitmask: 0xfc00003e
pattern: 0x1000003c pattern: 0x1000003c
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frC", "frB" ] args: [ "frD", "frA", "frC", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frC", "frB" ] uses: [ "frA", "frC", "frB" ]
@ -1521,7 +1521,7 @@ opcodes:
desc: "Paired Single Reciprocal Estimate" desc: "Paired Single Reciprocal Estimate"
bitmask: 0xfc1f07fe bitmask: 0xfc1f07fe
pattern: 0x10000030 pattern: 0x10000030
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frB" ] args: [ "frD", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frB" ] uses: [ "frB" ]
@ -1530,7 +1530,7 @@ opcodes:
desc: "Paired Single Reciprocal Square Root Estimate" desc: "Paired Single Reciprocal Square Root Estimate"
bitmask: 0xfc1f07fe bitmask: 0xfc1f07fe
pattern: 0x10000034 pattern: 0x10000034
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frB" ] args: [ "frD", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frB" ] uses: [ "frB" ]
@ -1539,7 +1539,7 @@ opcodes:
desc: "Paired Single Select" desc: "Paired Single Select"
bitmask: 0xfc00003e bitmask: 0xfc00003e
pattern: 0x1000002e pattern: 0x1000002e
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frC", "frB" ] args: [ "frD", "frA", "frC", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frC", "frB" ] uses: [ "frA", "frC", "frB" ]
@ -1548,7 +1548,7 @@ opcodes:
desc: "Paired Single Subtract" desc: "Paired Single Subtract"
bitmask: 0xfc0007fe bitmask: 0xfc0007fe
pattern: 0x10000028 pattern: 0x10000028
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frB" ] args: [ "frD", "frA", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frB" ] uses: [ "frA", "frB" ]
@ -1557,7 +1557,7 @@ opcodes:
desc: "Paired Single vector SUM high" desc: "Paired Single vector SUM high"
bitmask: 0xfc00003e bitmask: 0xfc00003e
pattern: 0x10000014 pattern: 0x10000014
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frC", "frB" ] args: [ "frD", "frA", "frC", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frC", "frB" ] uses: [ "frA", "frC", "frB" ]
@ -1566,7 +1566,7 @@ opcodes:
desc: "Paired Single vector SUM low" desc: "Paired Single vector SUM low"
bitmask: 0xfc00003e bitmask: 0xfc00003e
pattern: 0x10000016 pattern: 0x10000016
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "frD", "frA", "frC", "frB" ] args: [ "frD", "frA", "frC", "frB" ]
defs: [ "frD" ] defs: [ "frD" ]
uses: [ "frA", "frC", "frB" ] uses: [ "frA", "frC", "frB" ]
@ -1580,7 +1580,7 @@ opcodes:
desc: "Rotate Left Word Immediate then Mask Insert" desc: "Rotate Left Word Immediate then Mask Insert"
bitmask: 0xfc000000 bitmask: 0xfc000000
pattern: 0x50000000 pattern: 0x50000000
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "rA", "rS", "SH", "MB", "ME" ] args: [ "rA", "rS", "SH", "MB", "ME" ]
defs: [ "rA" ] defs: [ "rA" ]
uses: [ "rA", "rS", "SH" ] uses: [ "rA", "rS", "SH" ]
@ -1589,7 +1589,7 @@ opcodes:
desc: "Rotate Left Word Immediate then AND with Mask" desc: "Rotate Left Word Immediate then AND with Mask"
bitmask: 0xfc000000 bitmask: 0xfc000000
pattern: 0x54000000 pattern: 0x54000000
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "rA", "rS", "SH", "MB", "ME" ] args: [ "rA", "rS", "SH", "MB", "ME" ]
defs: [ "rA" ] defs: [ "rA" ]
uses: [ "rS", "SH" ] uses: [ "rS", "SH" ]
@ -1598,7 +1598,7 @@ opcodes:
desc: "Rotate Left Word then AND with Mask" desc: "Rotate Left Word then AND with Mask"
bitmask: 0xfc000000 bitmask: 0xfc000000
pattern: 0x5c000000 pattern: 0x5c000000
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "rA", "rS", "rB", "MB", "ME" ] args: [ "rA", "rS", "rB", "MB", "ME" ]
defs: [ "rA" ] defs: [ "rA" ]
uses: [ "rS", "rB" ] uses: [ "rS", "rB" ]
@ -1612,7 +1612,7 @@ opcodes:
desc: "Shift Left Word" desc: "Shift Left Word"
bitmask: 0xfc0007fe bitmask: 0xfc0007fe
pattern: 0x7c000030 pattern: 0x7c000030
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "rA", "rS", "rB" ] args: [ "rA", "rS", "rB" ]
defs: [ "rA" ] defs: [ "rA" ]
uses: [ "rS", "rB" ] uses: [ "rS", "rB" ]
@ -1621,7 +1621,7 @@ opcodes:
desc: "Shift Right Algebraic Word" desc: "Shift Right Algebraic Word"
bitmask: 0xfc0007fe bitmask: 0xfc0007fe
pattern: 0x7c000630 pattern: 0x7c000630
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "rA", "rS", "rB" ] args: [ "rA", "rS", "rB" ]
defs: [ "rA" ] defs: [ "rA" ]
uses: [ "rS", "rB" ] uses: [ "rS", "rB" ]
@ -1630,7 +1630,7 @@ opcodes:
desc: "Shift Right Algebraic Word Immediate" desc: "Shift Right Algebraic Word Immediate"
bitmask: 0xfc0007fe bitmask: 0xfc0007fe
pattern: 0x7c000670 pattern: 0x7c000670
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "rA", "rS", "SH" ] args: [ "rA", "rS", "SH" ]
defs: [ "rA" ] defs: [ "rA" ]
uses: [ "rS" ] uses: [ "rS" ]
@ -1639,7 +1639,7 @@ opcodes:
desc: "Shift Right Word" desc: "Shift Right Word"
bitmask: 0xfc0007fe bitmask: 0xfc0007fe
pattern: 0x7c000430 pattern: 0x7c000430
modifier: [ "Rc" ] modifiers: [ "Rc" ]
args: [ "rS", "rA", "rB" ] args: [ "rS", "rA", "rB" ]
defs: [ "rA" ] defs: [ "rA" ]
uses: [ "rA", "rB" ] uses: [ "rA", "rB" ]
@ -1847,7 +1847,7 @@ opcodes:
desc: "Subtract From Carrying" desc: "Subtract From Carrying"
bitmask: 0xfc0003fe bitmask: 0xfc0003fe
pattern: 0x7c000050 pattern: 0x7c000050
modifier: [ "OE", "Rc" ] modifiers: [ "OE", "Rc" ]
args: [ "rD", "rA", "rB" ] args: [ "rD", "rA", "rB" ]
defs: [ "rD" ] defs: [ "rD" ]
uses: [ "rA", "rB" ] uses: [ "rA", "rB" ]
@ -1856,7 +1856,7 @@ opcodes:
desc: "Subtract from Carrying" desc: "Subtract from Carrying"
bitmask: 0xfc0003fe bitmask: 0xfc0003fe
pattern: 0x7c000010 pattern: 0x7c000010
modifier: [ "OE", "Rc" ] modifiers: [ "OE", "Rc" ]
args: [ "rD", "rA", "rB" ] args: [ "rD", "rA", "rB" ]
defs: [ "rD" ] defs: [ "rD" ]
uses: [ "rA", "rB" ] uses: [ "rA", "rB" ]
@ -1865,7 +1865,7 @@ opcodes:
desc: "Subtract from Extended" desc: "Subtract from Extended"
bitmask: 0xfc0003fe bitmask: 0xfc0003fe
pattern: 0x7c000110 pattern: 0x7c000110
modifier: [ "OE", "Rc" ] modifiers: [ "OE", "Rc" ]
args: [ "rD", "rA", "rB" ] args: [ "rD", "rA", "rB" ]
defs: [ "rD" ] defs: [ "rD" ]
uses: [ "rA", "rB" ] uses: [ "rA", "rB" ]
@ -1882,7 +1882,7 @@ opcodes:
desc: "Subtract from Minus One Extended" desc: "Subtract from Minus One Extended"
bitmask: 0xfc00fbfe bitmask: 0xfc00fbfe
pattern: 0x7c0001d0 pattern: 0x7c0001d0
modifier: [ "OE", "Rc" ] modifiers: [ "OE", "Rc" ]
args: [ "rD", "rA" ] args: [ "rD", "rA" ]
defs: [ "rD" ] defs: [ "rD" ]
uses: [ "rA" ] uses: [ "rA" ]
@ -1891,7 +1891,7 @@ opcodes:
desc: "Subtract from Zero Extended" desc: "Subtract from Zero Extended"
bitmask: 0xfc00fbfe bitmask: 0xfc00fbfe
pattern: 0x7c000190 pattern: 0x7c000190
modifier: [ "OE", "Rc" ] modifiers: [ "OE", "Rc" ]
args: [ "rD", "rA" ] args: [ "rD", "rA" ]
defs: [ "rD" ] defs: [ "rD" ]
uses: [ "rA" ] uses: [ "rA" ]
@ -1917,14 +1917,14 @@ opcodes:
desc: "Trap Word" desc: "Trap Word"
bitmask: 0xfc0007ff bitmask: 0xfc0007ff
pattern: 0x7c000008 pattern: 0x7c000008
args: [ "tw_TO", "rA", "rB" ] args: [ "TO", "rA", "rB" ]
uses: [ "rA", "rB" ] uses: [ "rA", "rB" ]
- name: "twi" - name: "twi"
desc: "Trap Word Immediate" desc: "Trap Word Immediate"
bitmask: 0xfc000000 bitmask: 0xfc000000
pattern: 0xc0000000 pattern: 0xc0000000
args: [ "tw_TO", "rA", "simm" ] args: [ "TO", "rA", "simm" ]
uses: [ "rA" ] uses: [ "rA" ]
- name: "xor" - name: "xor"