#![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 IclassLdsetp128Memop128;
impl IclassLdsetp128Memop128 {
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 S = (data >> 30) & 1;
let S_post = S;
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 Rt2 = (data >> 16) & 31;
let Rt2_post = Rt2;
let A = (data >> 23) & 1;
let A_post = A;
let field_11 = (data >> 10) & 3;
let field_11_post = field_11;
let o3 = (data >> 15) & 1;
let o3_post = o3;
if ((A_post == 0) && (R_post == 0)) {
return Ldsetp128Memop128::decode(data as u32, decoder);
}
if ((A_post == 1) && (R_post == 0)) {
return Ldsetpa128Memop128::decode(data as u32, decoder);
}
if ((A_post == 1) && (R_post == 1)) {
return Ldsetpal128Memop128::decode(data as u32, decoder);
}
if ((A_post == 0) && (R_post == 1)) {
return Ldsetpl128Memop128::decode(data as u32, decoder);
}
unreachable!()
}
}
pub struct Ldsetp128Memop128;
impl Ldsetp128Memop128 {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDSETP
}
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::LDSETP_128_memop_128)
.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 = 0b00011001001000000011000000000000;
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.ldsetp_128_memop_128, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetp_128_memop_128, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldsetp_128_memop_128, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetp_128_memop_128, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldsetp_128_memop_128, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetp_128_memop_128, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetp_128_memop_128, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldsetp_128_memop_128, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetp_128_memop_128, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldsetp128Memop128Aliases {
None,
}
pub struct Ldsetpa128Memop128;
impl Ldsetpa128Memop128 {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDSETPA
}
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::LDSETPA_128_memop_128)
.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 = 0b00011001101000000011000000000000;
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.ldsetpa_128_memop_128, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetpa_128_memop_128, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldsetpa_128_memop_128, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetpa_128_memop_128, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldsetpa_128_memop_128, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetpa_128_memop_128, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetpa_128_memop_128, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldsetpa_128_memop_128, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetpa_128_memop_128, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldsetpa128Memop128Aliases {
None,
}
pub struct Ldsetpal128Memop128;
impl Ldsetpal128Memop128 {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDSETPAL
}
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::LDSETPAL_128_memop_128)
.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 = 0b00011001111000000011000000000000;
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.ldsetpal_128_memop_128, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetpal_128_memop_128, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldsetpal_128_memop_128, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetpal_128_memop_128, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldsetpal_128_memop_128, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetpal_128_memop_128, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetpal_128_memop_128, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldsetpal_128_memop_128, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetpal_128_memop_128, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldsetpal128Memop128Aliases {
None,
}
pub struct Ldsetpl128Memop128;
impl Ldsetpl128Memop128 {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::LDSETPL
}
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::LDSETPL_128_memop_128)
.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 = 0b00011001011000000011000000000000;
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.ldsetpl_128_memop_128, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetpl_128_memop_128, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.ldsetpl_128_memop_128, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetpl_128_memop_128, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.ldsetpl_128_memop_128, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetpl_128_memop_128, instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetpl_128_memop_128, instr, FormatterTextKind::BracketLeft)?;
fmt.format_operand(output, &config.global, &config.instructions.ldsetpl_128_memop_128, instr, 2)?;
fmt.format_punctuation(output, &config.global, &config.instructions.ldsetpl_128_memop_128, instr, FormatterTextKind::BracketRight)?;;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Ldsetpl128Memop128Aliases {
None,
}