#![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 IclassLdtadd32MemopUnpriv;
impl IclassLdtadd32MemopUnpriv {
pub(crate) fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let R = (data >> 22) & 1;
let R_post = R;
let field_29 = (data >> 24) & 63;
let field_29_post = field_29;
let opc = (data >> 12) & 7;
let opc_post = opc;
let Rt = (data >> 0) & 31;
let Rt_post = Rt;
let field_31 = (data >> 31) & 1;
let field_31_post = field_31;
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let field_21 = (data >> 21) & 1;
let field_21_post = field_21;
let A = (data >> 23) & 1;
let A_post = A;
let Rs = (data >> 16) & 31;
let Rs_post = Rs;
let sz = (data >> 30) & 1;
let sz_post = sz;
let field_11 = (data >> 10) & 3;
let field_11_post = field_11;
let o3 = (data >> 15) & 1;
let o3_post = o3;
if ((sz_post == 0) && ((A_post == 0) && (R_post == 0))) {
return Ldtadd32MemopUnpriv::decode(data as u32, decoder);
}
if ((sz_post == 0) && ((A_post == 1) && (R_post == 0))) {
return Ldtadda32MemopUnpriv::decode(data as u32, decoder);
}
if ((sz_post == 0) && ((A_post == 1) && (R_post == 1))) {
return Ldtaddal32MemopUnpriv::decode(data as u32, decoder);
}
if ((sz_post == 0) && ((A_post == 0) && (R_post == 1))) {
return Ldtaddl32MemopUnpriv::decode(data as u32, decoder);
}
if ((sz_post == 1) && ((A_post == 0) && (R_post == 0))) {
return Ldtadd64MemopUnpriv::decode(data as u32, decoder);
}
if ((sz_post == 1) && ((A_post == 1) && (R_post == 0))) {
return Ldtadda64MemopUnpriv::decode(data as u32, decoder);
}
if ((sz_post == 1) && ((A_post == 1) && (R_post == 1))) {
return Ldtaddal64MemopUnpriv::decode(data as u32, decoder);
}
if ((sz_post == 1) && ((A_post == 0) && (R_post == 1))) {
return Ldtaddl64MemopUnpriv::decode(data as u32, decoder);
}
unreachable!()
}
}
pub struct Ldtadd32MemopUnpriv;
impl Ldtadd32MemopUnpriv {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDTADD
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let A = (data >> 23) & 1;
let A_post = A;
let Rs = (data >> 16) & 31;
let Rs_post = Rs;
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let Rt = (data >> 0) & 31;
let Rt_post = Rt;
match decoder.config.instructions.ldtadd_32_memop_unpriv.aliases {
None => match decoder.config.global.aliases {
FormatAliasGlobal::Never => {},
FormatAliasGlobal::Recommended => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::SttaddLdtadd32MemopUnpriv::decode(data, decoder);
}
},
FormatAliasGlobal::Always => {
return super::SttaddLdtadd32MemopUnpriv::decode(data, decoder);
}
}
Some(pref) => match pref {
FormatAliasInstruction::Never => {},
FormatAliasInstruction::Recommended => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::SttaddLdtadd32MemopUnpriv::decode(data, decoder);
}
},
FormatAliasInstruction::Preferred(alias) => {
match alias {
Ldtadd32MemopUnprivAliases::SttaddLdtadd32MemopUnpriv => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::SttaddLdtadd32MemopUnpriv::decode(data, decoder);
}
}
};
if ((A_post == 0) && (Rt_post == 31)) {
return super::SttaddLdtadd32MemopUnpriv::decode(data, decoder);
}
},
FormatAliasInstruction::Always(alias) => {
match alias {
Ldtadd32MemopUnprivAliases::SttaddLdtadd32MemopUnpriv => return super::SttaddLdtadd32MemopUnpriv::decode(data, decoder),
}
},
}
}
let Rs_post = Rs;
let op_0 = Register::aarch32(Rs_post, false)?;
let Rt_post = Rt;
let op_1 = Register::aarch32(Rt_post, false)?;
let Rn_post = Rn;
let op_2 = Register::aarch64(Rn_post, true)?;
let mut instr = Instruction::builder(Code::LDTADD_32_memop_unpriv)
.operand(0, op_0)?
.operand(1, op_1)?
.operand(2, op_2)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let Rs_pre = instr.op0().as_register()?.encode();
let Rt_pre = instr.op1().as_register()?.encode();
let Rn_pre = instr.op2().as_register()?.encode();
let Rs = (Rs_pre & 31);
let Rt = (Rt_pre & 31);
let Rn = (Rn_pre & 31);
let mut instr: u32 = 0b00011001001000000000010000000000;
instr |= (Rs & 31) << 16;
instr |= (Rt & 31) << 0;
instr |= (Rn & 31) << 5;
let bytes = instr.to_le_bytes();
let len = bytes.len();
buf.extend(bytes);
Ok(len)
}
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::Register(r) = op {
if !r.is_aarch32() {
todo!()
}
if *r == Register::WSP {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
if !r.is_aarch32() {
todo!()
}
if *r == Register::WSP {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op2(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
if !r.is_aarch64() {
todo!()
}
if *r == Register::XZR {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op3(instr: &Instruction, op: &Operand) -> Result<()> {
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.ldtadd_32_memop_unpriv, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadd_32_memop_unpriv, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtadd_32_memop_unpriv, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadd_32_memop_unpriv, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtadd_32_memop_unpriv, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadd_32_memop_unpriv, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadd_32_memop_unpriv, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtadd_32_memop_unpriv, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadd_32_memop_unpriv, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldtadd32MemopUnprivAliases {
SttaddLdtadd32MemopUnpriv,
}
pub struct Ldtadda32MemopUnpriv;
impl Ldtadda32MemopUnpriv {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDTADDA
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rs = (data >> 16) & 31;
let Rs_post = Rs;
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let Rt = (data >> 0) & 31;
let Rt_post = Rt;
let Rs_post = Rs;
let op_0 = Register::aarch32(Rs_post, false)?;
let Rt_post = Rt;
let op_1 = Register::aarch32(Rt_post, false)?;
let Rn_post = Rn;
let op_2 = Register::aarch64(Rn_post, true)?;
let mut instr = Instruction::builder(Code::LDTADDA_32_memop_unpriv)
.operand(0, op_0)?
.operand(1, op_1)?
.operand(2, op_2)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let Rs_pre = instr.op0().as_register()?.encode();
let Rt_pre = instr.op1().as_register()?.encode();
let Rn_pre = instr.op2().as_register()?.encode();
let Rs = (Rs_pre & 31);
let Rt = (Rt_pre & 31);
let Rn = (Rn_pre & 31);
let mut instr: u32 = 0b00011001101000000000010000000000;
instr |= (Rs & 31) << 16;
instr |= (Rt & 31) << 0;
instr |= (Rn & 31) << 5;
let bytes = instr.to_le_bytes();
let len = bytes.len();
buf.extend(bytes);
Ok(len)
}
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::Register(r) = op {
if !r.is_aarch32() {
todo!()
}
if *r == Register::WSP {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
if !r.is_aarch32() {
todo!()
}
if *r == Register::WSP {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op2(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
if !r.is_aarch64() {
todo!()
}
if *r == Register::XZR {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op3(instr: &Instruction, op: &Operand) -> Result<()> {
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.ldtadda_32_memop_unpriv, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadda_32_memop_unpriv, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtadda_32_memop_unpriv, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadda_32_memop_unpriv, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtadda_32_memop_unpriv, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadda_32_memop_unpriv, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadda_32_memop_unpriv, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtadda_32_memop_unpriv, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadda_32_memop_unpriv, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldtadda32MemopUnprivAliases {
None,
}
pub struct Ldtaddal32MemopUnpriv;
impl Ldtaddal32MemopUnpriv {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDTADDAL
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rs = (data >> 16) & 31;
let Rs_post = Rs;
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let Rt = (data >> 0) & 31;
let Rt_post = Rt;
let Rs_post = Rs;
let op_0 = Register::aarch32(Rs_post, false)?;
let Rt_post = Rt;
let op_1 = Register::aarch32(Rt_post, false)?;
let Rn_post = Rn;
let op_2 = Register::aarch64(Rn_post, true)?;
let mut instr = Instruction::builder(Code::LDTADDAL_32_memop_unpriv)
.operand(0, op_0)?
.operand(1, op_1)?
.operand(2, op_2)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let Rs_pre = instr.op0().as_register()?.encode();
let Rt_pre = instr.op1().as_register()?.encode();
let Rn_pre = instr.op2().as_register()?.encode();
let Rs = (Rs_pre & 31);
let Rt = (Rt_pre & 31);
let Rn = (Rn_pre & 31);
let mut instr: u32 = 0b00011001111000000000010000000000;
instr |= (Rs & 31) << 16;
instr |= (Rt & 31) << 0;
instr |= (Rn & 31) << 5;
let bytes = instr.to_le_bytes();
let len = bytes.len();
buf.extend(bytes);
Ok(len)
}
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::Register(r) = op {
if !r.is_aarch32() {
todo!()
}
if *r == Register::WSP {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
if !r.is_aarch32() {
todo!()
}
if *r == Register::WSP {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op2(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
if !r.is_aarch64() {
todo!()
}
if *r == Register::XZR {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op3(instr: &Instruction, op: &Operand) -> Result<()> {
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.ldtaddal_32_memop_unpriv, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddal_32_memop_unpriv, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtaddal_32_memop_unpriv, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddal_32_memop_unpriv, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtaddal_32_memop_unpriv, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddal_32_memop_unpriv, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddal_32_memop_unpriv, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtaddal_32_memop_unpriv, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddal_32_memop_unpriv, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldtaddal32MemopUnprivAliases {
None,
}
pub struct Ldtaddl32MemopUnpriv;
impl Ldtaddl32MemopUnpriv {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDTADDL
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let A = (data >> 23) & 1;
let A_post = A;
let Rs = (data >> 16) & 31;
let Rs_post = Rs;
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let Rt = (data >> 0) & 31;
let Rt_post = Rt;
match decoder.config.instructions.ldtaddl_32_memop_unpriv.aliases {
None => match decoder.config.global.aliases {
FormatAliasGlobal::Never => {},
FormatAliasGlobal::Recommended => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::SttaddlLdtaddl32MemopUnpriv::decode(data, decoder);
}
},
FormatAliasGlobal::Always => {
return super::SttaddlLdtaddl32MemopUnpriv::decode(data, decoder);
}
}
Some(pref) => match pref {
FormatAliasInstruction::Never => {},
FormatAliasInstruction::Recommended => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::SttaddlLdtaddl32MemopUnpriv::decode(data, decoder);
}
},
FormatAliasInstruction::Preferred(alias) => {
match alias {
Ldtaddl32MemopUnprivAliases::SttaddlLdtaddl32MemopUnpriv => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::SttaddlLdtaddl32MemopUnpriv::decode(data, decoder);
}
}
};
if ((A_post == 0) && (Rt_post == 31)) {
return super::SttaddlLdtaddl32MemopUnpriv::decode(data, decoder);
}
},
FormatAliasInstruction::Always(alias) => {
match alias {
Ldtaddl32MemopUnprivAliases::SttaddlLdtaddl32MemopUnpriv => return super::SttaddlLdtaddl32MemopUnpriv::decode(data, decoder),
}
},
}
}
let Rs_post = Rs;
let op_0 = Register::aarch32(Rs_post, false)?;
let Rt_post = Rt;
let op_1 = Register::aarch32(Rt_post, false)?;
let Rn_post = Rn;
let op_2 = Register::aarch64(Rn_post, true)?;
let mut instr = Instruction::builder(Code::LDTADDL_32_memop_unpriv)
.operand(0, op_0)?
.operand(1, op_1)?
.operand(2, op_2)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let Rs_pre = instr.op0().as_register()?.encode();
let Rt_pre = instr.op1().as_register()?.encode();
let Rn_pre = instr.op2().as_register()?.encode();
let Rs = (Rs_pre & 31);
let Rt = (Rt_pre & 31);
let Rn = (Rn_pre & 31);
let mut instr: u32 = 0b00011001011000000000010000000000;
instr |= (Rs & 31) << 16;
instr |= (Rt & 31) << 0;
instr |= (Rn & 31) << 5;
let bytes = instr.to_le_bytes();
let len = bytes.len();
buf.extend(bytes);
Ok(len)
}
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::Register(r) = op {
if !r.is_aarch32() {
todo!()
}
if *r == Register::WSP {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
if !r.is_aarch32() {
todo!()
}
if *r == Register::WSP {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op2(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
if !r.is_aarch64() {
todo!()
}
if *r == Register::XZR {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op3(instr: &Instruction, op: &Operand) -> Result<()> {
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.ldtaddl_32_memop_unpriv, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddl_32_memop_unpriv, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtaddl_32_memop_unpriv, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddl_32_memop_unpriv, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtaddl_32_memop_unpriv, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddl_32_memop_unpriv, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddl_32_memop_unpriv, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtaddl_32_memop_unpriv, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddl_32_memop_unpriv, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldtaddl32MemopUnprivAliases {
SttaddlLdtaddl32MemopUnpriv,
}
pub struct Ldtadd64MemopUnpriv;
impl Ldtadd64MemopUnpriv {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDTADD
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let A = (data >> 23) & 1;
let A_post = A;
let Rs = (data >> 16) & 31;
let Rs_post = Rs;
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let Rt = (data >> 0) & 31;
let Rt_post = Rt;
match decoder.config.instructions.ldtadd_64_memop_unpriv.aliases {
None => match decoder.config.global.aliases {
FormatAliasGlobal::Never => {},
FormatAliasGlobal::Recommended => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::SttaddLdtadd64MemopUnpriv::decode(data, decoder);
}
},
FormatAliasGlobal::Always => {
return super::SttaddLdtadd64MemopUnpriv::decode(data, decoder);
}
}
Some(pref) => match pref {
FormatAliasInstruction::Never => {},
FormatAliasInstruction::Recommended => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::SttaddLdtadd64MemopUnpriv::decode(data, decoder);
}
},
FormatAliasInstruction::Preferred(alias) => {
match alias {
Ldtadd64MemopUnprivAliases::SttaddLdtadd64MemopUnpriv => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::SttaddLdtadd64MemopUnpriv::decode(data, decoder);
}
}
};
if ((A_post == 0) && (Rt_post == 31)) {
return super::SttaddLdtadd64MemopUnpriv::decode(data, decoder);
}
},
FormatAliasInstruction::Always(alias) => {
match alias {
Ldtadd64MemopUnprivAliases::SttaddLdtadd64MemopUnpriv => return super::SttaddLdtadd64MemopUnpriv::decode(data, decoder),
}
},
}
}
let Rs_post = Rs;
let op_0 = Register::aarch64(Rs_post, false)?;
let Rt_post = Rt;
let op_1 = Register::aarch64(Rt_post, false)?;
let Rn_post = Rn;
let op_2 = Register::aarch64(Rn_post, true)?;
let mut instr = Instruction::builder(Code::LDTADD_64_memop_unpriv)
.operand(0, op_0)?
.operand(1, op_1)?
.operand(2, op_2)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let Rs_pre = instr.op0().as_register()?.encode();
let Rt_pre = instr.op1().as_register()?.encode();
let Rn_pre = instr.op2().as_register()?.encode();
let Rs = (Rs_pre & 31);
let Rt = (Rt_pre & 31);
let Rn = (Rn_pre & 31);
let mut instr: u32 = 0b01011001001000000000010000000000;
instr |= (Rs & 31) << 16;
instr |= (Rt & 31) << 0;
instr |= (Rn & 31) << 5;
let bytes = instr.to_le_bytes();
let len = bytes.len();
buf.extend(bytes);
Ok(len)
}
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::Register(r) = op {
if !r.is_aarch64() {
todo!()
}
if *r == Register::SP {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
if !r.is_aarch64() {
todo!()
}
if *r == Register::SP {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op2(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
if !r.is_aarch64() {
todo!()
}
if *r == Register::XZR {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op3(instr: &Instruction, op: &Operand) -> Result<()> {
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.ldtadd_64_memop_unpriv, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadd_64_memop_unpriv, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtadd_64_memop_unpriv, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadd_64_memop_unpriv, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtadd_64_memop_unpriv, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadd_64_memop_unpriv, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadd_64_memop_unpriv, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtadd_64_memop_unpriv, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadd_64_memop_unpriv, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldtadd64MemopUnprivAliases {
SttaddLdtadd64MemopUnpriv,
}
pub struct Ldtadda64MemopUnpriv;
impl Ldtadda64MemopUnpriv {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDTADDA
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rs = (data >> 16) & 31;
let Rs_post = Rs;
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let Rt = (data >> 0) & 31;
let Rt_post = Rt;
let Rs_post = Rs;
let op_0 = Register::aarch64(Rs_post, false)?;
let Rt_post = Rt;
let op_1 = Register::aarch64(Rt_post, false)?;
let Rn_post = Rn;
let op_2 = Register::aarch64(Rn_post, true)?;
let mut instr = Instruction::builder(Code::LDTADDA_64_memop_unpriv)
.operand(0, op_0)?
.operand(1, op_1)?
.operand(2, op_2)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let Rs_pre = instr.op0().as_register()?.encode();
let Rt_pre = instr.op1().as_register()?.encode();
let Rn_pre = instr.op2().as_register()?.encode();
let Rs = (Rs_pre & 31);
let Rt = (Rt_pre & 31);
let Rn = (Rn_pre & 31);
let mut instr: u32 = 0b01011001101000000000010000000000;
instr |= (Rs & 31) << 16;
instr |= (Rt & 31) << 0;
instr |= (Rn & 31) << 5;
let bytes = instr.to_le_bytes();
let len = bytes.len();
buf.extend(bytes);
Ok(len)
}
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::Register(r) = op {
if !r.is_aarch64() {
todo!()
}
if *r == Register::SP {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
if !r.is_aarch64() {
todo!()
}
if *r == Register::SP {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op2(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
if !r.is_aarch64() {
todo!()
}
if *r == Register::XZR {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op3(instr: &Instruction, op: &Operand) -> Result<()> {
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.ldtadda_64_memop_unpriv, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadda_64_memop_unpriv, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtadda_64_memop_unpriv, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadda_64_memop_unpriv, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtadda_64_memop_unpriv, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadda_64_memop_unpriv, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadda_64_memop_unpriv, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtadda_64_memop_unpriv, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtadda_64_memop_unpriv, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldtadda64MemopUnprivAliases {
None,
}
pub struct Ldtaddal64MemopUnpriv;
impl Ldtaddal64MemopUnpriv {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDTADDAL
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rs = (data >> 16) & 31;
let Rs_post = Rs;
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let Rt = (data >> 0) & 31;
let Rt_post = Rt;
let Rs_post = Rs;
let op_0 = Register::aarch64(Rs_post, false)?;
let Rt_post = Rt;
let op_1 = Register::aarch64(Rt_post, false)?;
let Rn_post = Rn;
let op_2 = Register::aarch64(Rn_post, true)?;
let mut instr = Instruction::builder(Code::LDTADDAL_64_memop_unpriv)
.operand(0, op_0)?
.operand(1, op_1)?
.operand(2, op_2)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let Rs_pre = instr.op0().as_register()?.encode();
let Rt_pre = instr.op1().as_register()?.encode();
let Rn_pre = instr.op2().as_register()?.encode();
let Rs = (Rs_pre & 31);
let Rt = (Rt_pre & 31);
let Rn = (Rn_pre & 31);
let mut instr: u32 = 0b01011001111000000000010000000000;
instr |= (Rs & 31) << 16;
instr |= (Rt & 31) << 0;
instr |= (Rn & 31) << 5;
let bytes = instr.to_le_bytes();
let len = bytes.len();
buf.extend(bytes);
Ok(len)
}
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::Register(r) = op {
if !r.is_aarch64() {
todo!()
}
if *r == Register::SP {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
if !r.is_aarch64() {
todo!()
}
if *r == Register::SP {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op2(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
if !r.is_aarch64() {
todo!()
}
if *r == Register::XZR {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op3(instr: &Instruction, op: &Operand) -> Result<()> {
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.ldtaddal_64_memop_unpriv, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddal_64_memop_unpriv, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtaddal_64_memop_unpriv, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddal_64_memop_unpriv, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtaddal_64_memop_unpriv, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddal_64_memop_unpriv, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddal_64_memop_unpriv, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtaddal_64_memop_unpriv, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddal_64_memop_unpriv, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldtaddal64MemopUnprivAliases {
None,
}
pub struct Ldtaddl64MemopUnpriv;
impl Ldtaddl64MemopUnpriv {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDTADDL
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let A = (data >> 23) & 1;
let A_post = A;
let Rs = (data >> 16) & 31;
let Rs_post = Rs;
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let Rt = (data >> 0) & 31;
let Rt_post = Rt;
match decoder.config.instructions.ldtaddl_64_memop_unpriv.aliases {
None => match decoder.config.global.aliases {
FormatAliasGlobal::Never => {},
FormatAliasGlobal::Recommended => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::SttaddlLdtaddl64MemopUnpriv::decode(data, decoder);
}
},
FormatAliasGlobal::Always => {
return super::SttaddlLdtaddl64MemopUnpriv::decode(data, decoder);
}
}
Some(pref) => match pref {
FormatAliasInstruction::Never => {},
FormatAliasInstruction::Recommended => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::SttaddlLdtaddl64MemopUnpriv::decode(data, decoder);
}
},
FormatAliasInstruction::Preferred(alias) => {
match alias {
Ldtaddl64MemopUnprivAliases::SttaddlLdtaddl64MemopUnpriv => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::SttaddlLdtaddl64MemopUnpriv::decode(data, decoder);
}
}
};
if ((A_post == 0) && (Rt_post == 31)) {
return super::SttaddlLdtaddl64MemopUnpriv::decode(data, decoder);
}
},
FormatAliasInstruction::Always(alias) => {
match alias {
Ldtaddl64MemopUnprivAliases::SttaddlLdtaddl64MemopUnpriv => return super::SttaddlLdtaddl64MemopUnpriv::decode(data, decoder),
}
},
}
}
let Rs_post = Rs;
let op_0 = Register::aarch64(Rs_post, false)?;
let Rt_post = Rt;
let op_1 = Register::aarch64(Rt_post, false)?;
let Rn_post = Rn;
let op_2 = Register::aarch64(Rn_post, true)?;
let mut instr = Instruction::builder(Code::LDTADDL_64_memop_unpriv)
.operand(0, op_0)?
.operand(1, op_1)?
.operand(2, op_2)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let Rs_pre = instr.op0().as_register()?.encode();
let Rt_pre = instr.op1().as_register()?.encode();
let Rn_pre = instr.op2().as_register()?.encode();
let Rs = (Rs_pre & 31);
let Rt = (Rt_pre & 31);
let Rn = (Rn_pre & 31);
let mut instr: u32 = 0b01011001011000000000010000000000;
instr |= (Rs & 31) << 16;
instr |= (Rt & 31) << 0;
instr |= (Rn & 31) << 5;
let bytes = instr.to_le_bytes();
let len = bytes.len();
buf.extend(bytes);
Ok(len)
}
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::Register(r) = op {
if !r.is_aarch64() {
todo!()
}
if *r == Register::SP {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
if !r.is_aarch64() {
todo!()
}
if *r == Register::SP {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op2(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::Register(r) = op {
if !r.is_aarch64() {
todo!()
}
if *r == Register::XZR {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op3(instr: &Instruction, op: &Operand) -> Result<()> {
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.ldtaddl_64_memop_unpriv, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddl_64_memop_unpriv, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtaddl_64_memop_unpriv, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddl_64_memop_unpriv, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtaddl_64_memop_unpriv, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddl_64_memop_unpriv, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddl_64_memop_unpriv, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldtaddl_64_memop_unpriv, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldtaddl_64_memop_unpriv, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldtaddl64MemopUnprivAliases {
SttaddlLdtaddl64MemopUnpriv,
}