#![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 IclassCrc32b32cDp2src;
impl IclassCrc32b32cDp2src {
pub(crate) fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rm = (data >> 16) & 31;
let Rm_post = Rm;
let S = (data >> 29) & 1;
let S_post = S;
let field_15 = (data >> 13) & 7;
let field_15_post = field_15;
let sz = (data >> 10) & 3;
let sz_post = sz;
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let sf = (data >> 31) & 1;
let sf_post = sf;
let field_28 = (data >> 21) & 255;
let field_28_post = field_28;
let Rd = (data >> 0) & 31;
let Rd_post = Rd;
let field_30 = (data >> 30) & 1;
let field_30_post = field_30;
let C = (data >> 12) & 1;
let C_post = C;
if ((sf_post == 0) && (sz_post == 0)) {
return Crc32b32cDp2src::decode(data as u32, decoder);
}
if ((sf_post == 0) && (sz_post == 1)) {
return Crc32h32cDp2src::decode(data as u32, decoder);
}
if ((sf_post == 0) && (sz_post == 2)) {
return Crc32w32cDp2src::decode(data as u32, decoder);
}
if ((sf_post == 1) && (sz_post == 3)) {
return Crc32x64cDp2src::decode(data as u32, decoder);
}
unreachable!()
}
}
pub struct Crc32b32cDp2src;
impl Crc32b32cDp2src {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::CRC32B
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rm = (data >> 16) & 31;
let Rm_post = Rm;
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let Rd = (data >> 0) & 31;
let Rd_post = Rd;
let Rd_post = Rd;
let op_0 = Register::aarch32(Rd_post, false)?;
let Rn_post = Rn;
let op_1 = Register::aarch32(Rn_post, false)?;
let Rm_post = Rm;
let op_2 = Register::aarch32(Rm_post, false)?;
let mut instr = Instruction::builder(Code::CRC32B_32C_dp_2src)
.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 Rd_pre = instr.op0().as_register()?.encode();
let Rn_pre = instr.op1().as_register()?.encode();
let Rm_pre = instr.op2().as_register()?.encode();
let Rd = (Rd_pre & 31);
let Rn = (Rn_pre & 31);
let Rm = (Rm_pre & 31);
let mut instr: u32 = 0b00011010110000000100000000000000;
instr |= (Rd & 31) << 0;
instr |= (Rn & 31) << 5;
instr |= (Rm & 31) << 16;
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_aarch32() {
todo!()
}
if *r == Register::WSP {
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.crc32b_32c_dp_2src, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.crc32b_32c_dp_2src, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.crc32b_32c_dp_2src, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.crc32b_32c_dp_2src, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.crc32b_32c_dp_2src, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.crc32b_32c_dp_2src, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.crc32b_32c_dp_2src, instr, 2)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Crc32b32cDp2srcAliases {
None,
}
pub struct Crc32h32cDp2src;
impl Crc32h32cDp2src {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::CRC32H
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rm = (data >> 16) & 31;
let Rm_post = Rm;
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let Rd = (data >> 0) & 31;
let Rd_post = Rd;
let Rd_post = Rd;
let op_0 = Register::aarch32(Rd_post, false)?;
let Rn_post = Rn;
let op_1 = Register::aarch32(Rn_post, false)?;
let Rm_post = Rm;
let op_2 = Register::aarch32(Rm_post, false)?;
let mut instr = Instruction::builder(Code::CRC32H_32C_dp_2src)
.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 Rd_pre = instr.op0().as_register()?.encode();
let Rn_pre = instr.op1().as_register()?.encode();
let Rm_pre = instr.op2().as_register()?.encode();
let Rd = (Rd_pre & 31);
let Rn = (Rn_pre & 31);
let Rm = (Rm_pre & 31);
let mut instr: u32 = 0b00011010110000000100010000000000;
instr |= (Rd & 31) << 0;
instr |= (Rn & 31) << 5;
instr |= (Rm & 31) << 16;
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_aarch32() {
todo!()
}
if *r == Register::WSP {
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.crc32h_32c_dp_2src, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.crc32h_32c_dp_2src, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.crc32h_32c_dp_2src, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.crc32h_32c_dp_2src, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.crc32h_32c_dp_2src, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.crc32h_32c_dp_2src, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.crc32h_32c_dp_2src, instr, 2)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Crc32h32cDp2srcAliases {
None,
}
pub struct Crc32w32cDp2src;
impl Crc32w32cDp2src {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::CRC32W
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rm = (data >> 16) & 31;
let Rm_post = Rm;
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let Rd = (data >> 0) & 31;
let Rd_post = Rd;
let Rd_post = Rd;
let op_0 = Register::aarch32(Rd_post, false)?;
let Rn_post = Rn;
let op_1 = Register::aarch32(Rn_post, false)?;
let Rm_post = Rm;
let op_2 = Register::aarch32(Rm_post, false)?;
let mut instr = Instruction::builder(Code::CRC32W_32C_dp_2src)
.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 Rd_pre = instr.op0().as_register()?.encode();
let Rn_pre = instr.op1().as_register()?.encode();
let Rm_pre = instr.op2().as_register()?.encode();
let Rd = (Rd_pre & 31);
let Rn = (Rn_pre & 31);
let Rm = (Rm_pre & 31);
let mut instr: u32 = 0b00011010110000000100100000000000;
instr |= (Rd & 31) << 0;
instr |= (Rn & 31) << 5;
instr |= (Rm & 31) << 16;
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_aarch32() {
todo!()
}
if *r == Register::WSP {
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.crc32w_32c_dp_2src, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.crc32w_32c_dp_2src, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.crc32w_32c_dp_2src, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.crc32w_32c_dp_2src, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.crc32w_32c_dp_2src, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.crc32w_32c_dp_2src, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.crc32w_32c_dp_2src, instr, 2)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Crc32w32cDp2srcAliases {
None,
}
pub struct Crc32x64cDp2src;
impl Crc32x64cDp2src {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::CRC32X
}
pub fn size(_instr: &Instruction) -> usize {
4
}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let Rm = (data >> 16) & 31;
let Rm_post = Rm;
let Rn = (data >> 5) & 31;
let Rn_post = Rn;
let Rd = (data >> 0) & 31;
let Rd_post = Rd;
let Rd_post = Rd;
let op_0 = Register::aarch32(Rd_post, false)?;
let Rn_post = Rn;
let op_1 = Register::aarch32(Rn_post, false)?;
let Rm_post = Rm;
let op_2 = Register::aarch64(Rm_post, false)?;
let mut instr = Instruction::builder(Code::CRC32X_64C_dp_2src)
.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 Rd_pre = instr.op0().as_register()?.encode();
let Rn_pre = instr.op1().as_register()?.encode();
let Rm_pre = instr.op2().as_register()?.encode();
let Rd = (Rd_pre & 31);
let Rn = (Rn_pre & 31);
let Rm = (Rm_pre & 31);
let mut instr: u32 = 0b10011010110000000100110000000000;
instr |= (Rd & 31) << 0;
instr |= (Rn & 31) << 5;
instr |= (Rm & 31) << 16;
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::SP {
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.crc32x_64c_dp_2src, instr)?;
fmt.format_punctuation(output, &config.global, &config.instructions.crc32x_64c_dp_2src, instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.crc32x_64c_dp_2src, instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.crc32x_64c_dp_2src, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.crc32x_64c_dp_2src, instr, 1)?;
fmt.format_punctuation(output, &config.global, &config.instructions.crc32x_64c_dp_2src, instr, FormatterTextKind::Comma)?;
fmt.format_operand(output, &config.global, &config.instructions.crc32x_64c_dp_2src, instr, 2)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum Crc32x64cDp2srcAliases {
None,
}