#![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 IclassStlrSl32Ldstord;
impl IclassStlrSl32Ldstord {
pub(crate) fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let size = (data >> 30) & 3;
let size_post = size;
let Rt2 = (data >> 10) & 31;
let Rt2_post = Rt2;
let field_29 = (data >> 23) & 127;
let field_29_post = field_29;
let Rt = (data >> 0) & 31;
let Rt_post = Rt;
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let field_21 = (data >> 21) & 1;
let field_21_post = field_21;
let Rs = (data >> 16) & 31;
let Rs_post = Rs;
let L = (data >> 22) & 1;
let L_post = L;
let o0 = (data >> 15) & 1;
let o0_post = o0;
if (size_post == 2) {
return StlrSl32Ldstord::decode(data as u32, decoder);
}
if (size_post == 3) {
return StlrSl64Ldstord::decode(data as u32, decoder);
}
unreachable!()
}
}
pub struct StlrSl32Ldstord;
impl StlrSl32Ldstord {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::STLR
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let Rt = (data >> 0) & 31;
let Rt_post = Rt;
let Rt_post = Rt;
let op_0 = Register::aarch32(Rt_post, false)?;
let Rn_post = Rn;
let op_1 = Register::aarch64(Rn_post, true)?;
let mut instr = Instruction::builder(Code::STLR_SL32_ldstord)
.operand(0, op_0)?
.operand(1, op_1)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let Rt_pre = instr.op0().as_register()?.encode();
let Rn_pre = instr.op1().as_register()?.encode();
let Rt = (Rt_pre & 31);
let Rn = (Rn_pre & 31);
let mut instr: u32 = 0b10001000100111111111110000000000;
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_aarch64() {
todo!()
}
if *r == Register::XZR {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op2(instr: &Instruction, op: &Operand) -> Result<()> {
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.stlr_sl32_ldstord, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_sl32_ldstord, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.stlr_sl32_ldstord, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_sl32_ldstord, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_sl32_ldstord, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.stlr_sl32_ldstord, instr, 1)?;
if !config.global.syntax.omit_deref_null_const {
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_sl32_ldstord, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_sl32_ldstord, instr, FormatterTextKind::NumSign)?;
fmt.format_text(output, &config.global, &config.instructions.stlr_sl32_ldstord, instr, "0")?;
};
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_sl32_ldstord, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum StlrSl32LdstordAliases {
None,
}
pub struct StlrSl64Ldstord;
impl StlrSl64Ldstord {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::STLR
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let Rt = (data >> 0) & 31;
let Rt_post = Rt;
let Rt_post = Rt;
let op_0 = Register::aarch64(Rt_post, false)?;
let Rn_post = Rn;
let op_1 = Register::aarch64(Rn_post, true)?;
let mut instr = Instruction::builder(Code::STLR_SL64_ldstord)
.operand(0, op_0)?
.operand(1, op_1)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let Rt_pre = instr.op0().as_register()?.encode();
let Rn_pre = instr.op1().as_register()?.encode();
let Rt = (Rt_pre & 31);
let Rn = (Rn_pre & 31);
let mut instr: u32 = 0b11001000100111111111110000000000;
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::XZR {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op2(instr: &Instruction, op: &Operand) -> Result<()> {
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.stlr_sl64_ldstord, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_sl64_ldstord, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.stlr_sl64_ldstord, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_sl64_ldstord, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_sl64_ldstord, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.stlr_sl64_ldstord, instr, 1)?;
if !config.global.syntax.omit_deref_null_const {
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_sl64_ldstord, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_sl64_ldstord, instr, FormatterTextKind::NumSign)?;
fmt.format_text(output, &config.global, &config.instructions.stlr_sl64_ldstord, instr, "0")?;
};
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_sl64_ldstord, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum StlrSl64LdstordAliases {
None,
}
pub(crate) struct IclassStlr32sLdapstlWriteback;
impl IclassStlr32sLdapstlWriteback {
pub(crate) fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let field_21 = (data >> 10) & 4095;
let field_21_post = field_21;
let size = (data >> 30) & 3;
let size_post = size;
let field_29 = (data >> 23) & 127;
let field_29_post = field_29;
let Rt = (data >> 0) & 31;
let Rt_post = Rt;
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let L = (data >> 22) & 1;
let L_post = L;
if (size_post == 2) {
return Stlr32sLdapstlWriteback::decode(data as u32, decoder);
}
if (size_post == 3) {
return Stlr64sLdapstlWriteback::decode(data as u32, decoder);
}
unreachable!()
}
}
pub struct Stlr32sLdapstlWriteback;
impl Stlr32sLdapstlWriteback {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::STLR
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let Rt = (data >> 0) & 31;
let Rt_post = Rt;
let Rt_post = Rt;
let op_0 = Register::aarch32(Rt_post, false)?;
let Rn_post = Rn;
let op_1 = Register::aarch64(Rn_post, true)?;
let mut instr = Instruction::builder(Code::STLR_32S_ldapstl_writeback)
.operand(0, op_0)?
.operand(1, op_1)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let Rt_pre = instr.op0().as_register()?.encode();
let Rn_pre = instr.op1().as_register()?.encode();
let Rt = (Rt_pre & 31);
let Rn = (Rn_pre & 31);
let mut instr: u32 = 0b10011001100000000000100000000000;
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_aarch64() {
todo!()
}
if *r == Register::XZR {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op2(instr: &Instruction, op: &Operand) -> Result<()> {
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.stlr_32s_ldapstl_writeback, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_32s_ldapstl_writeback, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.stlr_32s_ldapstl_writeback, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_32s_ldapstl_writeback, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_32s_ldapstl_writeback, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.stlr_32s_ldapstl_writeback, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_32s_ldapstl_writeback, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_32s_ldapstl_writeback, instr, FormatterTextKind::NumSign)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_32s_ldapstl_writeback, instr, FormatterTextKind::Minus)?;
fmt.format_text(output, &config.global, &config.instructions.stlr_32s_ldapstl_writeback, instr, "4")?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_32s_ldapstl_writeback, instr, FormatterTextKind::BracketRight)?;;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_32s_ldapstl_writeback, instr, FormatterTextKind::ExclamationMark)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Stlr32sLdapstlWritebackAliases {
None,
}
pub struct Stlr64sLdapstlWriteback;
impl Stlr64sLdapstlWriteback {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::STLR
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let Rt = (data >> 0) & 31;
let Rt_post = Rt;
let Rt_post = Rt;
let op_0 = Register::aarch64(Rt_post, false)?;
let Rn_post = Rn;
let op_1 = Register::aarch64(Rn_post, true)?;
let mut instr = Instruction::builder(Code::STLR_64S_ldapstl_writeback)
.operand(0, op_0)?
.operand(1, op_1)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let Rt_pre = instr.op0().as_register()?.encode();
let Rn_pre = instr.op1().as_register()?.encode();
let Rt = (Rt_pre & 31);
let Rn = (Rn_pre & 31);
let mut instr: u32 = 0b11011001100000000000100000000000;
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::XZR {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op2(instr: &Instruction, op: &Operand) -> Result<()> {
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.stlr_64s_ldapstl_writeback, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_64s_ldapstl_writeback, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.stlr_64s_ldapstl_writeback, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_64s_ldapstl_writeback, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_64s_ldapstl_writeback, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.stlr_64s_ldapstl_writeback, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_64s_ldapstl_writeback, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_64s_ldapstl_writeback, instr, FormatterTextKind::NumSign)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_64s_ldapstl_writeback, instr, FormatterTextKind::Minus)?;
fmt.format_text(output, &config.global, &config.instructions.stlr_64s_ldapstl_writeback, instr, "8")?;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_64s_ldapstl_writeback, instr, FormatterTextKind::BracketRight)?;;
fmt.format_punctuation(output, &config.global, &config.instructions.stlr_64s_ldapstl_writeback, instr, FormatterTextKind::ExclamationMark)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Stlr64sLdapstlWritebackAliases {
None,
}