#![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 IclassLdclr32Memop;
impl IclassLdclr32Memop {
pub(crate) fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let R = (data >> 22) & 1;
let R_post = R;
let size = (data >> 30) & 3;
let size_post = size;
let field_11 = (data >> 10) & 3;
let field_11_post = field_11;
let opc = (data >> 12) & 7;
let opc_post = opc;
let Rt = (data >> 0) & 31;
let Rt_post = Rt;
let VR = (data >> 26) & 1;
let VR_post = VR;
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 field_25 = (data >> 24) & 3;
let field_25_post = field_25;
let field_29 = (data >> 27) & 7;
let field_29_post = field_29;
let o3 = (data >> 15) & 1;
let o3_post = o3;
if ((size_post == 2) && ((A_post == 0) && (R_post == 0))) {
return Ldclr32Memop::decode(data as u32, decoder);
}
if ((size_post == 2) && ((A_post == 1) && (R_post == 0))) {
return Ldclra32Memop::decode(data as u32, decoder);
}
if ((size_post == 2) && ((A_post == 1) && (R_post == 1))) {
return Ldclral32Memop::decode(data as u32, decoder);
}
if ((size_post == 2) && ((A_post == 0) && (R_post == 1))) {
return Ldclrl32Memop::decode(data as u32, decoder);
}
if ((size_post == 3) && ((A_post == 0) && (R_post == 0))) {
return Ldclr64Memop::decode(data as u32, decoder);
}
if ((size_post == 3) && ((A_post == 1) && (R_post == 0))) {
return Ldclra64Memop::decode(data as u32, decoder);
}
if ((size_post == 3) && ((A_post == 1) && (R_post == 1))) {
return Ldclral64Memop::decode(data as u32, decoder);
}
if ((size_post == 3) && ((A_post == 0) && (R_post == 1))) {
return Ldclrl64Memop::decode(data as u32, decoder);
}
unreachable!()
}
}
pub struct Ldclr32Memop;
impl Ldclr32Memop {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDCLR
}
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.ldclr_32_memop.aliases {
None => match decoder.config.global.aliases {
FormatAliasGlobal::Never => {},
FormatAliasGlobal::Recommended => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::StclrLdclr32Memop::decode(data, decoder);
}
},
FormatAliasGlobal::Always => {
return super::StclrLdclr32Memop::decode(data, decoder);
}
}
Some(pref) => match pref {
FormatAliasInstruction::Never => {},
FormatAliasInstruction::Recommended => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::StclrLdclr32Memop::decode(data, decoder);
}
},
FormatAliasInstruction::Preferred(alias) => {
match alias {
Ldclr32MemopAliases::StclrLdclr32Memop => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::StclrLdclr32Memop::decode(data, decoder);
}
}
};
if ((A_post == 0) && (Rt_post == 31)) {
return super::StclrLdclr32Memop::decode(data, decoder);
}
},
FormatAliasInstruction::Always(alias) => {
match alias {
Ldclr32MemopAliases::StclrLdclr32Memop => return super::StclrLdclr32Memop::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::LDCLR_32_memop)
.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 = 0b10111000001000000001000000000000;
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.ldclr_32_memop, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclr_32_memop, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclr_32_memop, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclr_32_memop, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclr_32_memop, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclr_32_memop, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclr_32_memop, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclr_32_memop, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclr_32_memop, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldclr32MemopAliases {
StclrLdclr32Memop,
}
pub struct Ldclra32Memop;
impl Ldclra32Memop {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDCLRA
}
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::LDCLRA_32_memop)
.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 = 0b10111000101000000001000000000000;
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.ldclra_32_memop, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclra_32_memop, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclra_32_memop, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclra_32_memop, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclra_32_memop, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclra_32_memop, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclra_32_memop, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclra_32_memop, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclra_32_memop, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldclra32MemopAliases {
None,
}
pub struct Ldclral32Memop;
impl Ldclral32Memop {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDCLRAL
}
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::LDCLRAL_32_memop)
.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 = 0b10111000111000000001000000000000;
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.ldclral_32_memop, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclral_32_memop, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclral_32_memop, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclral_32_memop, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclral_32_memop, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclral_32_memop, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclral_32_memop, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclral_32_memop, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclral_32_memop, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldclral32MemopAliases {
None,
}
pub struct Ldclrl32Memop;
impl Ldclrl32Memop {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDCLRL
}
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.ldclrl_32_memop.aliases {
None => match decoder.config.global.aliases {
FormatAliasGlobal::Never => {},
FormatAliasGlobal::Recommended => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::StclrlLdclrl32Memop::decode(data, decoder);
}
},
FormatAliasGlobal::Always => {
return super::StclrlLdclrl32Memop::decode(data, decoder);
}
}
Some(pref) => match pref {
FormatAliasInstruction::Never => {},
FormatAliasInstruction::Recommended => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::StclrlLdclrl32Memop::decode(data, decoder);
}
},
FormatAliasInstruction::Preferred(alias) => {
match alias {
Ldclrl32MemopAliases::StclrlLdclrl32Memop => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::StclrlLdclrl32Memop::decode(data, decoder);
}
}
};
if ((A_post == 0) && (Rt_post == 31)) {
return super::StclrlLdclrl32Memop::decode(data, decoder);
}
},
FormatAliasInstruction::Always(alias) => {
match alias {
Ldclrl32MemopAliases::StclrlLdclrl32Memop => return super::StclrlLdclrl32Memop::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::LDCLRL_32_memop)
.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 = 0b10111000011000000001000000000000;
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.ldclrl_32_memop, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclrl_32_memop, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclrl_32_memop, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclrl_32_memop, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclrl_32_memop, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclrl_32_memop, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclrl_32_memop, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclrl_32_memop, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclrl_32_memop, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldclrl32MemopAliases {
StclrlLdclrl32Memop,
}
pub struct Ldclr64Memop;
impl Ldclr64Memop {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDCLR
}
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.ldclr_64_memop.aliases {
None => match decoder.config.global.aliases {
FormatAliasGlobal::Never => {},
FormatAliasGlobal::Recommended => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::StclrLdclr64Memop::decode(data, decoder);
}
},
FormatAliasGlobal::Always => {
return super::StclrLdclr64Memop::decode(data, decoder);
}
}
Some(pref) => match pref {
FormatAliasInstruction::Never => {},
FormatAliasInstruction::Recommended => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::StclrLdclr64Memop::decode(data, decoder);
}
},
FormatAliasInstruction::Preferred(alias) => {
match alias {
Ldclr64MemopAliases::StclrLdclr64Memop => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::StclrLdclr64Memop::decode(data, decoder);
}
}
};
if ((A_post == 0) && (Rt_post == 31)) {
return super::StclrLdclr64Memop::decode(data, decoder);
}
},
FormatAliasInstruction::Always(alias) => {
match alias {
Ldclr64MemopAliases::StclrLdclr64Memop => return super::StclrLdclr64Memop::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::LDCLR_64_memop)
.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 = 0b11111000001000000001000000000000;
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.ldclr_64_memop, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclr_64_memop, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclr_64_memop, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclr_64_memop, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclr_64_memop, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclr_64_memop, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclr_64_memop, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclr_64_memop, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclr_64_memop, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldclr64MemopAliases {
StclrLdclr64Memop,
}
pub struct Ldclra64Memop;
impl Ldclra64Memop {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDCLRA
}
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::LDCLRA_64_memop)
.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 = 0b11111000101000000001000000000000;
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.ldclra_64_memop, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclra_64_memop, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclra_64_memop, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclra_64_memop, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclra_64_memop, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclra_64_memop, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclra_64_memop, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclra_64_memop, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclra_64_memop, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldclra64MemopAliases {
None,
}
pub struct Ldclral64Memop;
impl Ldclral64Memop {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDCLRAL
}
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::LDCLRAL_64_memop)
.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 = 0b11111000111000000001000000000000;
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.ldclral_64_memop, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclral_64_memop, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclral_64_memop, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclral_64_memop, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclral_64_memop, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclral_64_memop, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclral_64_memop, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclral_64_memop, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclral_64_memop, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldclral64MemopAliases {
None,
}
pub struct Ldclrl64Memop;
impl Ldclrl64Memop {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDCLRL
}
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.ldclrl_64_memop.aliases {
None => match decoder.config.global.aliases {
FormatAliasGlobal::Never => {},
FormatAliasGlobal::Recommended => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::StclrlLdclrl64Memop::decode(data, decoder);
}
},
FormatAliasGlobal::Always => {
return super::StclrlLdclrl64Memop::decode(data, decoder);
}
}
Some(pref) => match pref {
FormatAliasInstruction::Never => {},
FormatAliasInstruction::Recommended => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::StclrlLdclrl64Memop::decode(data, decoder);
}
},
FormatAliasInstruction::Preferred(alias) => {
match alias {
Ldclrl64MemopAliases::StclrlLdclrl64Memop => {
if ((A_post == 0) && (Rt_post == 31)) {
return super::StclrlLdclrl64Memop::decode(data, decoder);
}
}
};
if ((A_post == 0) && (Rt_post == 31)) {
return super::StclrlLdclrl64Memop::decode(data, decoder);
}
},
FormatAliasInstruction::Always(alias) => {
match alias {
Ldclrl64MemopAliases::StclrlLdclrl64Memop => return super::StclrlLdclrl64Memop::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::LDCLRL_64_memop)
.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 = 0b11111000011000000001000000000000;
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.ldclrl_64_memop, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclrl_64_memop, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclrl_64_memop, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclrl_64_memop, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclrl_64_memop, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclrl_64_memop, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclrl_64_memop, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldclrl_64_memop, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldclrl_64_memop, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldclrl64MemopAliases {
StclrlLdclrl64Memop,
}