#![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 IclassCpsidT1As;
impl IclassCpsidT1As {
pub(crate) fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let field_3 = (data >> 3) & 1;
let field_3_post = field_3;
let I = (data >> 1) & 1;
let I_post = I;
let op = (data >> 5) & 1;
let op_post = op;
let im = (data >> 4) & 1;
let im_post = im;
let A = (data >> 2) & 1;
let A_post = A;
let F = (data >> 0) & 1;
let F_post = F;
let field_15 = (data >> 6) & 1023;
let field_15_post = field_15;
if (im_post == 1) {
return CpsidT1As::decode(data as u32, decoder);
}
if (im_post == 0) {
return CpsieT1As::decode(data as u32, decoder);
}
unreachable!()
}
}
pub struct CpsidT1As;
impl CpsidT1As {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::CPSID
}
pub fn condition(instr: &Instruction) -> ConditionalInstruction {
ConditionalInstruction::None
}
pub fn size(_instr: &Instruction) -> usize {2}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let A = (data >> 2) & 1;
let A_post = A;
let I = (data >> 1) & 1;
let I_post = I;
let F = (data >> 0) & 1;
let F_post = F;
if !((decoder.it_block.is_none())) {
todo!()
}
let op_0 = Iflags::decode(A, I, F);
let mut instr = Instruction::builder(Code::CPSID_T1_AS)
.operand(0, op_0)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let (A, I, F) = instr.op0().as_iflags()?.encode();
let mut instr: u32 = 0b1011011001110000;
instr |= (A & 1) << 2;
instr |= (I & 1) << 1;
instr |= (F & 1) << 0;
let instr = instr as u16;
buf.extend(instr.to_le_bytes());
Ok(2)
}
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::Iflags(_) = op {
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
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.cpsid_t1_as, &instr)?;
fmt.format_qualifier(output, &config.global, &config.instructions.cpsid_t1_as, &instr, FormatterQualifier::Narrow, true, false)?;
fmt.format_punctuation(output, &config.global, &config.instructions.cpsid_t1_as, &instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.cpsid_t1_as, &instr, 0)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum CpsidT1AsAliases {
None,
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum CpsidT1AsEncodings {
None
}
pub struct CpsieT1As;
impl CpsieT1As {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::CPSIE
}
pub fn condition(instr: &Instruction) -> ConditionalInstruction {
ConditionalInstruction::None
}
pub fn size(_instr: &Instruction) -> usize {2}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let A = (data >> 2) & 1;
let A_post = A;
let I = (data >> 1) & 1;
let I_post = I;
let F = (data >> 0) & 1;
let F_post = F;
if !((decoder.it_block.is_none())) {
todo!()
}
let op_0 = Iflags::decode(A, I, F);
let mut instr = Instruction::builder(Code::CPSIE_T1_AS)
.operand(0, op_0)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let (A, I, F) = instr.op0().as_iflags()?.encode();
let mut instr: u32 = 0b1011011001100000;
instr |= (A & 1) << 2;
instr |= (I & 1) << 1;
instr |= (F & 1) << 0;
let instr = instr as u16;
buf.extend(instr.to_le_bytes());
Ok(2)
}
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::Iflags(_) = op {
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
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.cpsie_t1_as, &instr)?;
fmt.format_qualifier(output, &config.global, &config.instructions.cpsie_t1_as, &instr, FormatterQualifier::Narrow, true, false)?;
fmt.format_punctuation(output, &config.global, &config.instructions.cpsie_t1_as, &instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.cpsie_t1_as, &instr, 0)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum CpsieT1AsAliases {
None,
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum CpsieT1AsEncodings {
None
}
pub(crate) struct IclassCpsT2As;
impl IclassCpsT2As {
pub(crate) fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let F = (data >> 5) & 1;
let F_post = F;
let field_31 = (data >> 11) & 2097151;
let field_31_post = field_31;
let I = (data >> 6) & 1;
let I_post = I;
let imod = (data >> 9) & 3;
let imod_post = imod;
let mode = (data >> 0) & 31;
let mode_post = mode;
let A = (data >> 7) & 1;
let A_post = A;
let M = (data >> 8) & 1;
let M_post = M;
if ((imod_post == 0) && (M_post == 1)) {
return CpsT2As::decode(data as u32, decoder);
}
if ((imod_post == 3) && (M_post == 0)) {
return CpsidT2As::decode(data as u32, decoder);
}
if ((imod_post == 3) && (M_post == 1)) {
return CpsidT2Asm::decode(data as u32, decoder);
}
if ((imod_post == 2) && (M_post == 0)) {
return CpsieT2As::decode(data as u32, decoder);
}
if ((imod_post == 2) && (M_post == 1)) {
return CpsieT2Asm::decode(data as u32, decoder);
}
unreachable!()
}
}
pub struct CpsT2As;
impl CpsT2As {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::CPS
}
pub fn condition(instr: &Instruction) -> ConditionalInstruction {
ConditionalInstruction::None
}
pub fn size(_instr: &Instruction) -> usize {4}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let A = (data >> 7) & 1;
let A_post = A;
let I = (data >> 6) & 1;
let I_post = I;
let F = (data >> 5) & 1;
let F_post = F;
let mode = (data >> 0) & 31;
let mode_post = mode;
if !((decoder.it_block.is_none())) {
todo!()
}
let mode_post = mode;
let op_0 = mode_post as u32;
let mut instr = Instruction::builder(Code::CPS_T2_AS)
.operand(0, op_0)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let mode_pre = instr.op0().as_unsigned_immediate()? as u32;
let mode_pre = mode_pre;
let mode = (mode_pre & 31);
let mut instr: u32 = 0b11110011101011111000000100000000;
instr |= (mode & 31) << 0;
let instr_1 = (instr & 0xffff) as u16;
let instr_2 = ((instr >> 16) & 0xffff) as u16;
buf.extend(instr_2.to_le_bytes());
buf.extend(instr_1.to_le_bytes());
Ok(4)
}
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::SignedImmediate(i) = op {
if *i < 0 || *i > 31 {
todo!()
}
return Ok(())
}
if let Operand::UnsignedImmediate(i) = op {
if !(0..=31).contains(i) {
todo!()
}
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
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.cps_t2_as, &instr)?;
fmt.format_qualifier(output, &config.global, &config.instructions.cps_t2_as, &instr, FormatterQualifier::Wide, false, false)?;
fmt.format_punctuation(output, &config.global, &config.instructions.cps_t2_as, &instr, FormatterTextKind::Space)?;
fmt.format_punctuation(output, &config.global, &config.instructions.cps_t2_as, &instr, FormatterTextKind::NumSign)?;
fmt.format_operand(output, &config.global, &config.instructions.cps_t2_as, &instr, 0)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum CpsT2AsAliases {
None,
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum CpsT2AsEncodings {
None
}
pub struct CpsidT2As;
impl CpsidT2As {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::CPSID
}
pub fn condition(instr: &Instruction) -> ConditionalInstruction {
ConditionalInstruction::None
}
pub fn size(_instr: &Instruction) -> usize {4}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let A = (data >> 7) & 1;
let A_post = A;
let I = (data >> 6) & 1;
let I_post = I;
let F = (data >> 5) & 1;
let F_post = F;
let mode = (data >> 0) & 31;
let mode_post = mode;
if !((decoder.it_block.is_none())) {
todo!()
}
let op_0 = Iflags::decode(A, I, F);
let mut instr = Instruction::builder(Code::CPSID_T2_AS)
.operand(0, op_0)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let (A, I, F) = instr.op0().as_iflags()?.encode();
let mut instr: u32 = 0b11110011101011111000011000000000;
instr |= (A & 1) << 7;
instr |= (I & 1) << 6;
instr |= (F & 1) << 5;
let instr_1 = (instr & 0xffff) as u16;
let instr_2 = ((instr >> 16) & 0xffff) as u16;
buf.extend(instr_2.to_le_bytes());
buf.extend(instr_1.to_le_bytes());
Ok(4)
}
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::Iflags(_) = op {
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
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.cpsid_t2_as, &instr)?;
fmt.format_qualifier(output, &config.global, &config.instructions.cpsid_t2_as, &instr, FormatterQualifier::Wide, true, true)?;
fmt.format_punctuation(output, &config.global, &config.instructions.cpsid_t2_as, &instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.cpsid_t2_as, &instr, 0)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum CpsidT2AsAliases {
None,
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum CpsidT2AsEncodings {
None
}
pub struct CpsidT2Asm;
impl CpsidT2Asm {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::CPSID
}
pub fn condition(instr: &Instruction) -> ConditionalInstruction {
ConditionalInstruction::None
}
pub fn size(_instr: &Instruction) -> usize {4}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let A = (data >> 7) & 1;
let A_post = A;
let I = (data >> 6) & 1;
let I_post = I;
let F = (data >> 5) & 1;
let F_post = F;
let mode = (data >> 0) & 31;
let mode_post = mode;
if !((decoder.it_block.is_none())) {
todo!()
}
let mode_post = mode;
let op_0 = Iflags::decode(A, I, F);
let op_1 = mode_post as u32;
let mut instr = Instruction::builder(Code::CPSID_T2_ASM)
.operand(0, op_0)?
.operand(1, op_1)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let (A, I, F) = instr.op0().as_iflags()?.encode();
let mode_pre = instr.op1().as_unsigned_immediate()? as u32;
let mode_pre = mode_pre;
let mode = (mode_pre & 31);
let mut instr: u32 = 0b11110011101011111000011100000000;
instr |= (A & 1) << 7;
instr |= (I & 1) << 6;
instr |= (F & 1) << 5;
instr |= (mode & 31) << 0;
let instr_1 = (instr & 0xffff) as u16;
let instr_2 = ((instr >> 16) & 0xffff) as u16;
buf.extend(instr_2.to_le_bytes());
buf.extend(instr_1.to_le_bytes());
Ok(4)
}
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::Iflags(_) = op {
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::SignedImmediate(i) = op {
if *i < 0 || *i > 31 {
todo!()
}
return Ok(())
}
if let Operand::UnsignedImmediate(i) = op {
if !(0..=31).contains(i) {
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.cpsid_t2_asm, &instr)?;
fmt.format_qualifier(output, &config.global, &config.instructions.cpsid_t2_asm, &instr, FormatterQualifier::Wide, true, false)?;
fmt.format_punctuation(output, &config.global, &config.instructions.cpsid_t2_asm, &instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.cpsid_t2_asm, &instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.cpsid_t2_asm, &instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.cpsid_t2_asm, &instr, FormatterTextKind::NumSign)?;
fmt.format_operand(output, &config.global, &config.instructions.cpsid_t2_asm, &instr, 1)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum CpsidT2AsmAliases {
None,
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum CpsidT2AsmEncodings {
None
}
pub struct CpsieT2As;
impl CpsieT2As {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::CPSIE
}
pub fn condition(instr: &Instruction) -> ConditionalInstruction {
ConditionalInstruction::None
}
pub fn size(_instr: &Instruction) -> usize {4}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let A = (data >> 7) & 1;
let A_post = A;
let I = (data >> 6) & 1;
let I_post = I;
let F = (data >> 5) & 1;
let F_post = F;
let mode = (data >> 0) & 31;
let mode_post = mode;
if !((decoder.it_block.is_none())) {
todo!()
}
let op_0 = Iflags::decode(A, I, F);
let mut instr = Instruction::builder(Code::CPSIE_T2_AS)
.operand(0, op_0)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let (A, I, F) = instr.op0().as_iflags()?.encode();
let mut instr: u32 = 0b11110011101011111000010000000000;
instr |= (A & 1) << 7;
instr |= (I & 1) << 6;
instr |= (F & 1) << 5;
let instr_1 = (instr & 0xffff) as u16;
let instr_2 = ((instr >> 16) & 0xffff) as u16;
buf.extend(instr_2.to_le_bytes());
buf.extend(instr_1.to_le_bytes());
Ok(4)
}
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::Iflags(_) = op {
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
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.cpsie_t2_as, &instr)?;
fmt.format_qualifier(output, &config.global, &config.instructions.cpsie_t2_as, &instr, FormatterQualifier::Wide, true, true)?;
fmt.format_punctuation(output, &config.global, &config.instructions.cpsie_t2_as, &instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.cpsie_t2_as, &instr, 0)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum CpsieT2AsAliases {
None,
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum CpsieT2AsEncodings {
None
}
pub struct CpsieT2Asm;
impl CpsieT2Asm {
pub fn mnemonic(_instr: &Instruction) -> Mnemonic {
Mnemonic::CPSIE
}
pub fn condition(instr: &Instruction) -> ConditionalInstruction {
ConditionalInstruction::None
}
pub fn size(_instr: &Instruction) -> usize {4}
pub fn decode(data: u32, decoder: &mut Decoder) -> Result<Instruction> {
let A = (data >> 7) & 1;
let A_post = A;
let I = (data >> 6) & 1;
let I_post = I;
let F = (data >> 5) & 1;
let F_post = F;
let mode = (data >> 0) & 31;
let mode_post = mode;
if !((decoder.it_block.is_none())) {
todo!()
}
let mode_post = mode;
let op_0 = Iflags::decode(A, I, F);
let op_1 = mode_post as u32;
let mut instr = Instruction::builder(Code::CPSIE_T2_ASM)
.operand(0, op_0)?
.operand(1, op_1)?
.build();
Ok(instr)
}
pub fn encode(instr: &Instruction, buf: &mut Vec<u8>) -> Result<usize> {
let (A, I, F) = instr.op0().as_iflags()?.encode();
let mode_pre = instr.op1().as_unsigned_immediate()? as u32;
let mode_pre = mode_pre;
let mode = (mode_pre & 31);
let mut instr: u32 = 0b11110011101011111000010100000000;
instr |= (A & 1) << 7;
instr |= (I & 1) << 6;
instr |= (F & 1) << 5;
instr |= (mode & 31) << 0;
let instr_1 = (instr & 0xffff) as u16;
let instr_2 = ((instr >> 16) & 0xffff) as u16;
buf.extend(instr_2.to_le_bytes());
buf.extend(instr_1.to_le_bytes());
Ok(4)
}
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::Iflags(_) = op {
return Ok(())
}
todo!()
}
pub fn check_op1(instr: &Instruction, op: &Operand) -> Result<()> {
if let Operand::SignedImmediate(i) = op {
if *i < 0 || *i > 31 {
todo!()
}
return Ok(())
}
if let Operand::UnsignedImmediate(i) = op {
if !(0..=31).contains(i) {
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.cpsie_t2_asm, &instr)?;
fmt.format_qualifier(output, &config.global, &config.instructions.cpsie_t2_asm, &instr, FormatterQualifier::Wide, true, false)?;
fmt.format_punctuation(output, &config.global, &config.instructions.cpsie_t2_asm, &instr, FormatterTextKind::Space)?;
fmt.format_operand(output, &config.global, &config.instructions.cpsie_t2_asm, &instr, 0)?;
fmt.format_punctuation(output, &config.global, &config.instructions.cpsie_t2_asm, &instr, FormatterTextKind::Comma)?;
fmt.format_punctuation(output, &config.global, &config.instructions.cpsie_t2_asm, &instr, FormatterTextKind::NumSign)?;
fmt.format_operand(output, &config.global, &config.instructions.cpsie_t2_asm, &instr, 1)?;
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum CpsieT2AsmAliases {
None,
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum CpsieT2AsmEncodings {
None
}