#![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 IclassSmlalbbT1;
impl IclassSmlalbbT1 {
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 Rn = (data >> 16) & 15;
let Rn_post = Rn;
let field_7 = (data >> 6) & 3;
let field_7_post = field_7;
let RdHi = (data >> 8) & 15;
let RdHi_post = RdHi;
let field_31 = (data >> 23) & 511;
let field_31_post = field_31;
let RdLo = (data >> 12) & 15;
let RdLo_post = RdLo;
if ((N_post == 0) && (M_post == 0)) {
return SmlalbbT1::decode(data as u32, decoder);
}
if ((N_post == 0) && (M_post == 1)) {
return SmlalbtT1::decode(data as u32, decoder);
}
if ((N_post == 1) && (M_post == 0)) {
return SmlaltbT1::decode(data as u32, decoder);
}
if ((N_post == 1) && (M_post == 1)) {
return SmlalttT1::decode(data as u32, decoder);
}
unreachable!()
}
}
pub struct SmlalbbT1;
impl SmlalbbT1 {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::SMLALBB
}
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 RdLo = (data >> 12) & 15;
let RdLo_post = RdLo;
let RdHi = (data >> 8) & 15;
let RdHi_post = RdHi;
let Rm = (data >> 0) & 15;
let Rm_post = Rm;
let RdHi_post = RdHi;
let RdLo_post = RdLo;
let Rn_post = Rn;
let Rm_post = Rm;
let op_0 = MnemonicCondition::Al;
let op_1 = Register::decode(RdLo_post)?;
let op_2 = Register::decode(RdHi_post)?;
let op_3 = Register::decode(Rn_post)?;
let op_4 = Register::decode(Rm_post)?;
let mut instr = Instruction::builder(Code::SMLALBB_T1)
.operand(0, op_0)?
.operand(1, op_1)?
.operand(2, op_2)?
.operand(3, op_3)?
.operand(4, op_4)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let RdLo_pre = instr.op1().as_register()?.encode();
let RdHi_pre = instr.op2().as_register()?.encode();
let Rn_pre = instr.op3().as_register()?.encode();
let Rm_pre = instr.op4().as_register()?.encode();
let RdLo = (RdLo_pre & 15);
let RdHi = (RdHi_pre & 15);
let Rn = (Rn_pre & 15);
let Rm = (Rm_pre & 15);
let mut instr: u32 = 0b11111011110000000000000010000000;
instr |= (RdLo & 15) << 12;
instr |= (RdHi & 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<()> {
if let Operand::Register(r) = op {
return Ok(())
}
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.smlalbb_t1, &instr)?;
fmt.format_operand(output, &config.global, &config.instructions.smlalbb_t1, &instr, 0)?;
fmt.format_qualifier(output, &config.global, &config.instructions.smlalbb_t1, &instr, FormatterQualifier::Wide, false, false)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smlalbb_t1, &instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.smlalbb_t1, &instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smlalbb_t1, &instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.smlalbb_t1, &instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smlalbb_t1, &instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.smlalbb_t1, &instr, 3)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smlalbb_t1, &instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.smlalbb_t1, &instr, 4)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum SmlalbbT1Aliases {
None,
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum SmlalbbT1Encodings {
None
}
pub struct SmlalbtT1;
impl SmlalbtT1 {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::SMLALBT
}
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 RdLo = (data >> 12) & 15;
let RdLo_post = RdLo;
let RdHi = (data >> 8) & 15;
let RdHi_post = RdHi;
let Rm = (data >> 0) & 15;
let Rm_post = Rm;
let RdHi_post = RdHi;
let RdLo_post = RdLo;
let Rn_post = Rn;
let Rm_post = Rm;
let op_0 = MnemonicCondition::Al;
let op_1 = Register::decode(RdLo_post)?;
let op_2 = Register::decode(RdHi_post)?;
let op_3 = Register::decode(Rn_post)?;
let op_4 = Register::decode(Rm_post)?;
let mut instr = Instruction::builder(Code::SMLALBT_T1)
.operand(0, op_0)?
.operand(1, op_1)?
.operand(2, op_2)?
.operand(3, op_3)?
.operand(4, op_4)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let RdLo_pre = instr.op1().as_register()?.encode();
let RdHi_pre = instr.op2().as_register()?.encode();
let Rn_pre = instr.op3().as_register()?.encode();
let Rm_pre = instr.op4().as_register()?.encode();
let RdLo = (RdLo_pre & 15);
let RdHi = (RdHi_pre & 15);
let Rn = (Rn_pre & 15);
let Rm = (Rm_pre & 15);
let mut instr: u32 = 0b11111011110000000000000010010000;
instr |= (RdLo & 15) << 12;
instr |= (RdHi & 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<()> {
if let Operand::Register(r) = op {
return Ok(())
}
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.smlalbt_t1, &instr)?;
fmt.format_operand(output, &config.global, &config.instructions.smlalbt_t1, &instr, 0)?;
fmt.format_qualifier(output, &config.global, &config.instructions.smlalbt_t1, &instr, FormatterQualifier::Wide, false, false)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smlalbt_t1, &instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.smlalbt_t1, &instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smlalbt_t1, &instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.smlalbt_t1, &instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smlalbt_t1, &instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.smlalbt_t1, &instr, 3)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smlalbt_t1, &instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.smlalbt_t1, &instr, 4)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum SmlalbtT1Aliases {
None,
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum SmlalbtT1Encodings {
None
}
pub struct SmlaltbT1;
impl SmlaltbT1 {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::SMLALTB
}
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 RdLo = (data >> 12) & 15;
let RdLo_post = RdLo;
let RdHi = (data >> 8) & 15;
let RdHi_post = RdHi;
let Rm = (data >> 0) & 15;
let Rm_post = Rm;
let RdHi_post = RdHi;
let RdLo_post = RdLo;
let Rn_post = Rn;
let Rm_post = Rm;
let op_0 = MnemonicCondition::Al;
let op_1 = Register::decode(RdLo_post)?;
let op_2 = Register::decode(RdHi_post)?;
let op_3 = Register::decode(Rn_post)?;
let op_4 = Register::decode(Rm_post)?;
let mut instr = Instruction::builder(Code::SMLALTB_T1)
.operand(0, op_0)?
.operand(1, op_1)?
.operand(2, op_2)?
.operand(3, op_3)?
.operand(4, op_4)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let RdLo_pre = instr.op1().as_register()?.encode();
let RdHi_pre = instr.op2().as_register()?.encode();
let Rn_pre = instr.op3().as_register()?.encode();
let Rm_pre = instr.op4().as_register()?.encode();
let RdLo = (RdLo_pre & 15);
let RdHi = (RdHi_pre & 15);
let Rn = (Rn_pre & 15);
let Rm = (Rm_pre & 15);
let mut instr: u32 = 0b11111011110000000000000010100000;
instr |= (RdLo & 15) << 12;
instr |= (RdHi & 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<()> {
if let Operand::Register(r) = op {
return Ok(())
}
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.smlaltb_t1, &instr)?;
fmt.format_operand(output, &config.global, &config.instructions.smlaltb_t1, &instr, 0)?;
fmt.format_qualifier(output, &config.global, &config.instructions.smlaltb_t1, &instr, FormatterQualifier::Wide, false, false)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smlaltb_t1, &instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.smlaltb_t1, &instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smlaltb_t1, &instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.smlaltb_t1, &instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smlaltb_t1, &instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.smlaltb_t1, &instr, 3)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smlaltb_t1, &instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.smlaltb_t1, &instr, 4)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum SmlaltbT1Aliases {
None,
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum SmlaltbT1Encodings {
None
}
pub struct SmlalttT1;
impl SmlalttT1 {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::SMLALTT
}
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 RdLo = (data >> 12) & 15;
let RdLo_post = RdLo;
let RdHi = (data >> 8) & 15;
let RdHi_post = RdHi;
let Rm = (data >> 0) & 15;
let Rm_post = Rm;
let RdHi_post = RdHi;
let RdLo_post = RdLo;
let Rn_post = Rn;
let Rm_post = Rm;
let op_0 = MnemonicCondition::Al;
let op_1 = Register::decode(RdLo_post)?;
let op_2 = Register::decode(RdHi_post)?;
let op_3 = Register::decode(Rn_post)?;
let op_4 = Register::decode(Rm_post)?;
let mut instr = Instruction::builder(Code::SMLALTT_T1)
.operand(0, op_0)?
.operand(1, op_1)?
.operand(2, op_2)?
.operand(3, op_3)?
.operand(4, op_4)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let RdLo_pre = instr.op1().as_register()?.encode();
let RdHi_pre = instr.op2().as_register()?.encode();
let Rn_pre = instr.op3().as_register()?.encode();
let Rm_pre = instr.op4().as_register()?.encode();
let RdLo = (RdLo_pre & 15);
let RdHi = (RdHi_pre & 15);
let Rn = (Rn_pre & 15);
let Rm = (Rm_pre & 15);
let mut instr: u32 = 0b11111011110000000000000010110000;
instr |= (RdLo & 15) << 12;
instr |= (RdHi & 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<()> {
if let Operand::Register(r) = op {
return Ok(())
}
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.smlaltt_t1, &instr)?;
fmt.format_operand(output, &config.global, &config.instructions.smlaltt_t1, &instr, 0)?;
fmt.format_qualifier(output, &config.global, &config.instructions.smlaltt_t1, &instr, FormatterQualifier::Wide, false, false)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smlaltt_t1, &instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.smlaltt_t1, &instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smlaltt_t1, &instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.smlaltt_t1, &instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smlaltt_t1, &instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.smlaltt_t1, &instr, 3)?;
fmt.format_punctuation(output, &config.global, &config.instructions.smlaltt_t1, &instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.smlaltt_t1, &instr, 4)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum SmlalttT1Aliases {
None,
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum SmlalttT1Encodings {
None
}