#![allow(non_snake_case)]
#![allow(unused)]
use crate::error::Result;
use crate::utils::*;
use super::super::formatter::*;
use super::super::instruction::*;
use super::super::operand::*;
use super::super::consts::*;
use super::super::config::*;
use super::super::decoder::*;
pub(crate) struct IclassSmulbbT1;
impl IclassSmulbbT1 {
pub(crate) fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let M = (data >> 4) & 1;
let M_post = M;
let op1 = (data >> 20) & 7;
let op1_post = op1;
let Rm = (data >> 0) & 15;
let Rm_post = Rm;
let N = (data >> 5) & 1;
let N_post = N;
let Ra = (data >> 12) & 15;
let Ra_post = Ra;
let Rd = (data >> 8) & 15;
let Rd_post = Rd;
let field_31 = (data >> 23) & 511;
let field_31_post = field_31;
let Rn = (data >> 16) & 15;
let Rn_post = Rn;
let field_7 = (data >> 6) & 3;
let field_7_post = field_7;
if ((N_post == 0) && (M_post == 0)) {
return SmulbbT1::decode(data as u32, decoder);
}
if ((N_post == 0) && (M_post == 1)) {
return SmulbtT1::decode(data as u32, decoder);
}
if ((N_post == 1) && (M_post == 0)) {
return SmultbT1::decode(data as u32, decoder);
}
if ((N_post == 1) && (M_post == 1)) {
return SmulttT1::decode(data as u32, decoder);
}
unreachable!()
}
}
pub struct SmulbbT1;
impl SmulbbT1 {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::SMULBB
}
pub fn condition(instr: &Instruction) -> ConditionalInstruction {
ConditionalInstruction::Condition(0, false, false)
}
pub fn size(_instr: &Instruction) -> usize {4}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rn = (data >> 16) & 15;
let Rn_post = Rn;
let Rd = (data >> 8) & 15;
let Rd_post = Rd;
let Rm = (data >> 0) & 15;
let Rm_post = Rm;
let Rd_post = Rd;
let Rn_post = Rn;
let Rm_post = Rm;
let op_0 = MnemonicCondition::Al;
let op_1 = Register::decode(Rd_post)?;
let op_2 = Register::decode(Rn_post)?;
let op_3 = Register::decode(Rm_post)?;
let mut instr = Instruction::builder(Code::SMULBB_T1)
.operand(0, op_0)?
.operand(1, op_1)?
.operand(2, op_2)?
.operand(3, op_3)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let Rd_pre = instr.op1().as_register()?.encode();
let Rn_pre = instr.op2().as_register()?.encode();
let Rm_pre = instr.op3().as_register()?.encode();
let Rd = (Rd_pre & 15);
let Rn = (Rn_pre & 15);
let Rm = (Rm_pre & 15);
let mut instr: u32 = 0b11111011000100001111000000000000;
instr |= (Rd & 15) << 8;
instr |= (Rn & 15) << 16;
instr |= (Rm & 15) << 0;
let instr_1 = (instr & 0xffff) as u16;
let instr_2 = ((instr >> 16) & 0xffff) as u16;
buf.extend(instr_2.to_le_bytes());
buf.extend(instr_1.to_le_bytes());
Ok(4)
}
pub fn encode_block(instr: &mut Instruction, buf: &mut Vec<u8>, labels: &std::collections::HashMap<u64, u64>) -> Result<usize> {
Self::encode(instr, buf)
}
pub fn check_op0(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::MnemonicCondition(r) = op {
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
return Ok(())
}
todo!()
}
pub fn check_op2(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
return Ok(())
}
todo!()
}
pub fn check_op3(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
return Ok(())
}
todo!()
}
pub fn check_op4(instr: &Instruction, op: &Operand) -> Result<()> {
todo!()
}
pub fn check_op5(instr: &Instruction, op: &Operand) -> Result<()> {
todo!()
}
pub fn check_op6(instr: &Instruction, op: &Operand) -> Result<()> {
todo!()
}
pub fn format(instr: &Instruction, fmt: &mut impl Formatter, output: &mut impl FormatterOutput, config: &Config) -> Result<()> {
fmt.format_mnemonic(output, &config.global, &config.instructions.smulbb_t1, &instr)?;
fmt.format_operand(output, &config.global, &config.instructions.smulbb_t1, &instr, 0)?;
fmt.format_qualifier(output, &config.global, &config.instructions.smulbb_t1, &instr, FormatterQualifier::Wide, false, false)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smulbb_t1, &instr, FormatterTextKind::Space)?;
if !instr.op1().is_none() {
fmt.format_operand(output, &config.global, &config.instructions.smulbb_t1, &instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smulbb_t1, &instr, FormatterTextKind::Comma)?;
};
fmt.format_operand(output, &config.global, &config.instructions.smulbb_t1, &instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smulbb_t1, &instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.smulbb_t1, &instr, 3)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum SmulbbT1Aliases {
None,
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum SmulbbT1Encodings {
None
}
pub struct SmulbtT1;
impl SmulbtT1 {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::SMULBT
}
pub fn condition(instr: &Instruction) -> ConditionalInstruction {
ConditionalInstruction::Condition(0, false, false)
}
pub fn size(_instr: &Instruction) -> usize {4}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rn = (data >> 16) & 15;
let Rn_post = Rn;
let Rd = (data >> 8) & 15;
let Rd_post = Rd;
let Rm = (data >> 0) & 15;
let Rm_post = Rm;
let Rd_post = Rd;
let Rn_post = Rn;
let Rm_post = Rm;
let op_0 = MnemonicCondition::Al;
let op_1 = Register::decode(Rd_post)?;
let op_2 = Register::decode(Rn_post)?;
let op_3 = Register::decode(Rm_post)?;
let mut instr = Instruction::builder(Code::SMULBT_T1)
.operand(0, op_0)?
.operand(1, op_1)?
.operand(2, op_2)?
.operand(3, op_3)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let Rd_pre = instr.op1().as_register()?.encode();
let Rn_pre = instr.op2().as_register()?.encode();
let Rm_pre = instr.op3().as_register()?.encode();
let Rd = (Rd_pre & 15);
let Rn = (Rn_pre & 15);
let Rm = (Rm_pre & 15);
let mut instr: u32 = 0b11111011000100001111000000010000;
instr |= (Rd & 15) << 8;
instr |= (Rn & 15) << 16;
instr |= (Rm & 15) << 0;
let instr_1 = (instr & 0xffff) as u16;
let instr_2 = ((instr >> 16) & 0xffff) as u16;
buf.extend(instr_2.to_le_bytes());
buf.extend(instr_1.to_le_bytes());
Ok(4)
}
pub fn encode_block(instr: &mut Instruction, buf: &mut Vec<u8>, labels: &std::collections::HashMap<u64, u64>) -> Result<usize> {
Self::encode(instr, buf)
}
pub fn check_op0(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::MnemonicCondition(r) = op {
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
return Ok(())
}
todo!()
}
pub fn check_op2(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
return Ok(())
}
todo!()
}
pub fn check_op3(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
return Ok(())
}
todo!()
}
pub fn check_op4(instr: &Instruction, op: &Operand) -> Result<()> {
todo!()
}
pub fn check_op5(instr: &Instruction, op: &Operand) -> Result<()> {
todo!()
}
pub fn check_op6(instr: &Instruction, op: &Operand) -> Result<()> {
todo!()
}
pub fn format(instr: &Instruction, fmt: &mut impl Formatter, output: &mut impl FormatterOutput, config: &Config) -> Result<()> {
fmt.format_mnemonic(output, &config.global, &config.instructions.smulbt_t1, &instr)?;
fmt.format_operand(output, &config.global, &config.instructions.smulbt_t1, &instr, 0)?;
fmt.format_qualifier(output, &config.global, &config.instructions.smulbt_t1, &instr, FormatterQualifier::Wide, false, false)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smulbt_t1, &instr, FormatterTextKind::Space)?;
if !instr.op1().is_none() {
fmt.format_operand(output, &config.global, &config.instructions.smulbt_t1, &instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smulbt_t1, &instr, FormatterTextKind::Comma)?;
};
fmt.format_operand(output, &config.global, &config.instructions.smulbt_t1, &instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smulbt_t1, &instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.smulbt_t1, &instr, 3)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum SmulbtT1Aliases {
None,
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum SmulbtT1Encodings {
None
}
pub struct SmultbT1;
impl SmultbT1 {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::SMULTB
}
pub fn condition(instr: &Instruction) -> ConditionalInstruction {
ConditionalInstruction::Condition(0, false, false)
}
pub fn size(_instr: &Instruction) -> usize {4}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rn = (data >> 16) & 15;
let Rn_post = Rn;
let Rd = (data >> 8) & 15;
let Rd_post = Rd;
let Rm = (data >> 0) & 15;
let Rm_post = Rm;
let Rd_post = Rd;
let Rn_post = Rn;
let Rm_post = Rm;
let op_0 = MnemonicCondition::Al;
let op_1 = Register::decode(Rd_post)?;
let op_2 = Register::decode(Rn_post)?;
let op_3 = Register::decode(Rm_post)?;
let mut instr = Instruction::builder(Code::SMULTB_T1)
.operand(0, op_0)?
.operand(1, op_1)?
.operand(2, op_2)?
.operand(3, op_3)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let Rd_pre = instr.op1().as_register()?.encode();
let Rn_pre = instr.op2().as_register()?.encode();
let Rm_pre = instr.op3().as_register()?.encode();
let Rd = (Rd_pre & 15);
let Rn = (Rn_pre & 15);
let Rm = (Rm_pre & 15);
let mut instr: u32 = 0b11111011000100001111000000100000;
instr |= (Rd & 15) << 8;
instr |= (Rn & 15) << 16;
instr |= (Rm & 15) << 0;
let instr_1 = (instr & 0xffff) as u16;
let instr_2 = ((instr >> 16) & 0xffff) as u16;
buf.extend(instr_2.to_le_bytes());
buf.extend(instr_1.to_le_bytes());
Ok(4)
}
pub fn encode_block(instr: &mut Instruction, buf: &mut Vec<u8>, labels: &std::collections::HashMap<u64, u64>) -> Result<usize> {
Self::encode(instr, buf)
}
pub fn check_op0(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::MnemonicCondition(r) = op {
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
return Ok(())
}
todo!()
}
pub fn check_op2(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
return Ok(())
}
todo!()
}
pub fn check_op3(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
return Ok(())
}
todo!()
}
pub fn check_op4(instr: &Instruction, op: &Operand) -> Result<()> {
todo!()
}
pub fn check_op5(instr: &Instruction, op: &Operand) -> Result<()> {
todo!()
}
pub fn check_op6(instr: &Instruction, op: &Operand) -> Result<()> {
todo!()
}
pub fn format(instr: &Instruction, fmt: &mut impl Formatter, output: &mut impl FormatterOutput, config: &Config) -> Result<()> {
fmt.format_mnemonic(output, &config.global, &config.instructions.smultb_t1, &instr)?;
fmt.format_operand(output, &config.global, &config.instructions.smultb_t1, &instr, 0)?;
fmt.format_qualifier(output, &config.global, &config.instructions.smultb_t1, &instr, FormatterQualifier::Wide, false, false)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smultb_t1, &instr, FormatterTextKind::Space)?;
if !instr.op1().is_none() {
fmt.format_operand(output, &config.global, &config.instructions.smultb_t1, &instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smultb_t1, &instr, FormatterTextKind::Comma)?;
};
fmt.format_operand(output, &config.global, &config.instructions.smultb_t1, &instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smultb_t1, &instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.smultb_t1, &instr, 3)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum SmultbT1Aliases {
None,
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum SmultbT1Encodings {
None
}
pub struct SmulttT1;
impl SmulttT1 {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::SMULTT
}
pub fn condition(instr: &Instruction) -> ConditionalInstruction {
ConditionalInstruction::Condition(0, false, false)
}
pub fn size(_instr: &Instruction) -> usize {4}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rn = (data >> 16) & 15;
let Rn_post = Rn;
let Rd = (data >> 8) & 15;
let Rd_post = Rd;
let Rm = (data >> 0) & 15;
let Rm_post = Rm;
let Rd_post = Rd;
let Rn_post = Rn;
let Rm_post = Rm;
let op_0 = MnemonicCondition::Al;
let op_1 = Register::decode(Rd_post)?;
let op_2 = Register::decode(Rn_post)?;
let op_3 = Register::decode(Rm_post)?;
let mut instr = Instruction::builder(Code::SMULTT_T1)
.operand(0, op_0)?
.operand(1, op_1)?
.operand(2, op_2)?
.operand(3, op_3)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let Rd_pre = instr.op1().as_register()?.encode();
let Rn_pre = instr.op2().as_register()?.encode();
let Rm_pre = instr.op3().as_register()?.encode();
let Rd = (Rd_pre & 15);
let Rn = (Rn_pre & 15);
let Rm = (Rm_pre & 15);
let mut instr: u32 = 0b11111011000100001111000000110000;
instr |= (Rd & 15) << 8;
instr |= (Rn & 15) << 16;
instr |= (Rm & 15) << 0;
let instr_1 = (instr & 0xffff) as u16;
let instr_2 = ((instr >> 16) & 0xffff) as u16;
buf.extend(instr_2.to_le_bytes());
buf.extend(instr_1.to_le_bytes());
Ok(4)
}
pub fn encode_block(instr: &mut Instruction, buf: &mut Vec<u8>, labels: &std::collections::HashMap<u64, u64>) -> Result<usize> {
Self::encode(instr, buf)
}
pub fn check_op0(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::MnemonicCondition(r) = op {
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
return Ok(())
}
todo!()
}
pub fn check_op2(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
return Ok(())
}
todo!()
}
pub fn check_op3(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
return Ok(())
}
todo!()
}
pub fn check_op4(instr: &Instruction, op: &Operand) -> Result<()> {
todo!()
}
pub fn check_op5(instr: &Instruction, op: &Operand) -> Result<()> {
todo!()
}
pub fn check_op6(instr: &Instruction, op: &Operand) -> Result<()> {
todo!()
}
pub fn format(instr: &Instruction, fmt: &mut impl Formatter, output: &mut impl FormatterOutput, config: &Config) -> Result<()> {
fmt.format_mnemonic(output, &config.global, &config.instructions.smultt_t1, &instr)?;
fmt.format_operand(output, &config.global, &config.instructions.smultt_t1, &instr, 0)?;
fmt.format_qualifier(output, &config.global, &config.instructions.smultt_t1, &instr, FormatterQualifier::Wide, false, false)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smultt_t1, &instr, FormatterTextKind::Space)?;
if !instr.op1().is_none() {
fmt.format_operand(output, &config.global, &config.instructions.smultt_t1, &instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smultt_t1, &instr, FormatterTextKind::Comma)?;
};
fmt.format_operand(output, &config.global, &config.instructions.smultt_t1, &instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smultt_t1, &instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.smultt_t1, &instr, 3)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum SmulttT1Aliases {
None,
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum SmulttT1Encodings {
None
}