#![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 IclassStilp32seLdiappstilp;
impl IclassStilp32seLdiappstilp {
pub(crate) fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
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 opc2 = (data >> 12) & 15;
let opc2_post = opc2;
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let field_21 = (data >> 21) & 1;
let field_21_post = field_21;
let Rt2 = (data >> 16) & 31;
let Rt2_post = Rt2;
let L = (data >> 22) & 1;
let L_post = L;
let field_11 = (data >> 10) & 3;
let field_11_post = field_11;
if ((size_post == 2) && (opc2_post == 0)) {
return Stilp32seLdiappstilp::decode(data as u32, decoder);
}
if ((size_post == 2) && (opc2_post == 1)) {
return Stilp32sLdiappstilp::decode(data as u32, decoder);
}
if ((size_post == 3) && (opc2_post == 0)) {
return Stilp64ssLdiappstilp::decode(data as u32, decoder);
}
if ((size_post == 3) && (opc2_post == 1)) {
return Stilp64sLdiappstilp::decode(data as u32, decoder);
}
unreachable!()
}
}
pub struct Stilp32seLdiappstilp;
impl Stilp32seLdiappstilp {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::STILP
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rt2 = (data >> 16) & 31;
let Rt2_post = Rt2;
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 Rt2_post = Rt2;
let op_1 = Register::aarch32(Rt2_post, false)?;
let Rn_post = Rn;
let op_2 = Register::aarch64(Rn_post, true)?;
let mut instr = Instruction::builder(Code::STILP_32SE_ldiappstilp)
.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 Rt_pre = instr.op0().as_register()?.encode();
let Rt2_pre = instr.op1().as_register()?.encode();
let Rn_pre = instr.op2().as_register()?.encode();
let Rt = (Rt_pre & 31);
let Rt2 = (Rt2_pre & 31);
let Rn = (Rn_pre & 31);
let mut instr: u32 = 0b10011001000000000000100000000000;
instr |= (Rt & 31) << 0;
instr |= (Rt2 & 31) << 16;
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.stilp_32se_ldiappstilp, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_32se_ldiappstilp, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.stilp_32se_ldiappstilp, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_32se_ldiappstilp, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.stilp_32se_ldiappstilp, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_32se_ldiappstilp, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_32se_ldiappstilp, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.stilp_32se_ldiappstilp, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_32se_ldiappstilp, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_32se_ldiappstilp, instr, FormatterTextKind::NumSign)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_32se_ldiappstilp, instr, FormatterTextKind::Minus)?;
fmt.format_text(output, &config.global, &config.instructions.stilp_32se_ldiappstilp, instr, "8")?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_32se_ldiappstilp, instr, FormatterTextKind::BracketRight)?;;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_32se_ldiappstilp, instr, FormatterTextKind::ExclamationMark)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Stilp32seLdiappstilpAliases {
None,
}
pub struct Stilp32sLdiappstilp;
impl Stilp32sLdiappstilp {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::STILP
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rt2 = (data >> 16) & 31;
let Rt2_post = Rt2;
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 Rt2_post = Rt2;
let op_1 = Register::aarch32(Rt2_post, false)?;
let Rn_post = Rn;
let op_2 = Register::aarch64(Rn_post, true)?;
let mut instr = Instruction::builder(Code::STILP_32S_ldiappstilp)
.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 Rt_pre = instr.op0().as_register()?.encode();
let Rt2_pre = instr.op1().as_register()?.encode();
let Rn_pre = instr.op2().as_register()?.encode();
let Rt = (Rt_pre & 31);
let Rt2 = (Rt2_pre & 31);
let Rn = (Rn_pre & 31);
let mut instr: u32 = 0b10011001000000000001100000000000;
instr |= (Rt & 31) << 0;
instr |= (Rt2 & 31) << 16;
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.stilp_32s_ldiappstilp, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_32s_ldiappstilp, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.stilp_32s_ldiappstilp, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_32s_ldiappstilp, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.stilp_32s_ldiappstilp, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_32s_ldiappstilp, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_32s_ldiappstilp, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.stilp_32s_ldiappstilp, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_32s_ldiappstilp, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Stilp32sLdiappstilpAliases {
None,
}
pub struct Stilp64ssLdiappstilp;
impl Stilp64ssLdiappstilp {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::STILP
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rt2 = (data >> 16) & 31;
let Rt2_post = Rt2;
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 Rt2_post = Rt2;
let op_1 = Register::aarch64(Rt2_post, false)?;
let Rn_post = Rn;
let op_2 = Register::aarch64(Rn_post, true)?;
let mut instr = Instruction::builder(Code::STILP_64SS_ldiappstilp)
.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 Rt_pre = instr.op0().as_register()?.encode();
let Rt2_pre = instr.op1().as_register()?.encode();
let Rn_pre = instr.op2().as_register()?.encode();
let Rt = (Rt_pre & 31);
let Rt2 = (Rt2_pre & 31);
let Rn = (Rn_pre & 31);
let mut instr: u32 = 0b11011001000000000000100000000000;
instr |= (Rt & 31) << 0;
instr |= (Rt2 & 31) << 16;
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.stilp_64ss_ldiappstilp, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_64ss_ldiappstilp, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.stilp_64ss_ldiappstilp, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_64ss_ldiappstilp, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.stilp_64ss_ldiappstilp, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_64ss_ldiappstilp, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_64ss_ldiappstilp, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.stilp_64ss_ldiappstilp, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_64ss_ldiappstilp, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_64ss_ldiappstilp, instr, FormatterTextKind::NumSign)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_64ss_ldiappstilp, instr, FormatterTextKind::Minus)?;
fmt.format_text(output, &config.global, &config.instructions.stilp_64ss_ldiappstilp, instr, "16")?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_64ss_ldiappstilp, instr, FormatterTextKind::BracketRight)?;;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_64ss_ldiappstilp, instr, FormatterTextKind::ExclamationMark)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Stilp64ssLdiappstilpAliases {
None,
}
pub struct Stilp64sLdiappstilp;
impl Stilp64sLdiappstilp {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::STILP
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rt2 = (data >> 16) & 31;
let Rt2_post = Rt2;
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 Rt2_post = Rt2;
let op_1 = Register::aarch64(Rt2_post, false)?;
let Rn_post = Rn;
let op_2 = Register::aarch64(Rn_post, true)?;
let mut instr = Instruction::builder(Code::STILP_64S_ldiappstilp)
.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 Rt_pre = instr.op0().as_register()?.encode();
let Rt2_pre = instr.op1().as_register()?.encode();
let Rn_pre = instr.op2().as_register()?.encode();
let Rt = (Rt_pre & 31);
let Rt2 = (Rt2_pre & 31);
let Rn = (Rn_pre & 31);
let mut instr: u32 = 0b11011001000000000001100000000000;
instr |= (Rt & 31) << 0;
instr |= (Rt2 & 31) << 16;
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.stilp_64s_ldiappstilp, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_64s_ldiappstilp, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.stilp_64s_ldiappstilp, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_64s_ldiappstilp, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.stilp_64s_ldiappstilp, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_64s_ldiappstilp, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_64s_ldiappstilp, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.stilp_64s_ldiappstilp, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.stilp_64s_ldiappstilp, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Stilp64sLdiappstilpAliases {
None,
}