3 #ifndef ROSE_DISASSEMBLER_POWERPC_H
4 #define ROSE_DISASSEMBLER_POWERPC_H
27 : Exception(mesg, d->
ip) {
30 bytes.push_back((d->
insn>>24) & 0xff);
31 bytes.push_back((d->
insn>>16) & 0xff);
32 bytes.push_back((d->
insn>>8) & 0xff);
33 bytes.push_back(d->
insn & 0xff);
35 this->bit = 8*(4-(bit/8)) + bit%8;
40 makeRegister(PowerpcRegisterClass reg_class,
int reg_number,
41 PowerpcConditionRegisterAccessGranularity reg_grainularity = powerpc_condreggranularity_whole)
const;
44 PowerpcInstructionKind kind, uint32_t
insn);
47 template <
size_t First,
size_t Last> uint32_t
fld()
const;
54 return makeRegister(powerpc_regclass_cr, fld<11, 15>(), powerpc_condreggranularity_bit);
57 return makeRegister(powerpc_regclass_cr, fld<16, 20>(), powerpc_condreggranularity_bit);
60 return IntegerOps::signExtend<16, 64>((uint64_t)
insn & 0xfffc);
63 return makeRegister(powerpc_regclass_cr, fld<6, 8>(), powerpc_condreggranularity_field);
66 return makeRegister(powerpc_regclass_fpscr, fld<6, 8>(), powerpc_condreggranularity_field);
69 return makeRegister(powerpc_regclass_cr, fld<11, 13>(), powerpc_condreggranularity_field);
72 return makeRegister(powerpc_regclass_fpscr, fld<11, 13>(), powerpc_condreggranularity_field);
84 return makeRegister(powerpc_regclass_cr, fld<6, 10>(), powerpc_condreggranularity_bit);
96 return makeRegister(powerpc_regclass_fpr, fld<11, 15>());
99 return makeRegister(powerpc_regclass_fpr, fld<16, 20>());
102 return makeRegister(powerpc_regclass_fpr, fld<21, 25>());
105 return makeRegister(powerpc_regclass_fpr, fld<6, 10>());
126 uint64_t
LI()
const {
127 return IntegerOps::signExtend<26, 64>(uint64_t(fld<6, 29>() * 4));
130 return fld<31, 31>();
148 return fld<21, 21>();
151 return makeRegister(powerpc_regclass_gpr, fld<11, 15>());
157 return makeRegister(powerpc_regclass_gpr, fld<16, 20>());
160 return fld<31, 31>();
163 return makeRegister(powerpc_regclass_gpr, fld<6, 10>());
178 return makeRegister(powerpc_regclass_spr, fld<16, 20>() * 32 + fld<11, 15>());
181 return makeRegister(powerpc_regclass_sr, fld<12, 15>());
184 return makeRegister(powerpc_regclass_tbr, fld<16, 20>() * 32 + fld<11, 15>());
206 if (fld<11, 15>() == 0)
211 if (fld<11, 15>() == 0)