Skip to content

Instantly share code, notes, and snippets.

@agustingianni
Created January 20, 2016 21:18
Show Gist options
  • Select an option

  • Save agustingianni/7d397f7759094a516aaf to your computer and use it in GitHub Desktop.

Select an option

Save agustingianni/7d397f7759094a516aaf to your computer and use it in GitHub Desktop.
shared_ptr<ARMInstruction> ARMDecoder::decode_adc_register_t2(uint32_t opcode, Disassembler::ARMInstrSize ins_size, ARMEncoding encoding) {
int S = get_bit(opcode, 20);
int Rn = get_bits(opcode, 19, 16);
int imm3 = get_bits(opcode, 14, 12);
int Rd = get_bits(opcode, 11, 8);
int imm2 = get_bits(opcode, 7, 6);
int type = get_bits(opcode, 5, 4);
int Rm = get_bits(opcode, 3, 0);
int shift_t = 0;
int d = 0;
int m = 0;
int n = 0;
int shift_n = 0;
int setflags = 0;
d = UInt(Rd);
n = UInt(Rn);
m = UInt(Rm);
setflags = (S == 1);
std::tie(shift_t, shift_n) = DecodeImmShift(type, Concatenate(imm3, imm2, 2));
if (unlikely((((d == 13 || d == 15) || (n == 13 || n == 15)) || (m == 13 || m == 15)))) {
return shared_ptr<ARMInstruction>(new UnpredictableInstruction("Reason: (((d == 13 || d == 15) || (n == 13 || n == 15)) || (m == 13 || m == 15))"));
}
shared_ptr<ARMInstruction> ins = ARMInstruction::create();
ins->opcode = opcode;
ins->ins_size = ins_size;
ins->id = adc_register;
ins->m_to_string = decode_adc_register_t2_to_string;
ins->m_decoded_by = "ARMDecoder::decode_adc_register_t2";
ins->encoding = encoding;
ins->shift_t = shift_t;
ins->d = d;
ins->m = m;
ins->n = n;
ins->shift_n = shift_n;
ins->setflags = setflags;
ins->type = type;
return ins;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment