MCPcopy Create free account
hub / github.com/capstone-engine/capstone / DecodeSORegImmOperand

Function DecodeSORegImmOperand

arch/ARM/ARMDisassembler.c:1250–1287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1248}
1249
1250static DecodeStatus DecodeSORegImmOperand(MCInst *Inst, unsigned Val,
1251 uint64_t Address, const void *Decoder)
1252{
1253 DecodeStatus S = MCDisassembler_Success;
1254 ARM_AM_ShiftOpc Shift;
1255 unsigned Op;
1256 unsigned Rm = fieldFromInstruction_4(Val, 0, 4);
1257 unsigned type = fieldFromInstruction_4(Val, 5, 2);
1258 unsigned imm = fieldFromInstruction_4(Val, 7, 5);
1259
1260 // Register-immediate
1261 if (!Check(&S, DecoderGPRRegisterClass(Inst, Rm, Address, Decoder)))
1262 return MCDisassembler_Fail;
1263
1264 Shift = ARM_AM_lsl;
1265 switch (type) {
1266 case 0:
1267 Shift = ARM_AM_lsl;
1268 break;
1269 case 1:
1270 Shift = ARM_AM_lsr;
1271 break;
1272 case 2:
1273 Shift = ARM_AM_asr;
1274 break;
1275 case 3:
1276 Shift = ARM_AM_ror;
1277 break;
1278 }
1279
1280 if (Shift == ARM_AM_ror && imm == 0)
1281 Shift = ARM_AM_rrx;
1282
1283 Op = Shift | (imm << 3);
1284 MCOperand_CreateImm0(Inst, Op);
1285
1286 return S;
1287}
1288
1289static DecodeStatus DecodeSORegRegOperand(MCInst *Inst, unsigned Val,
1290 uint64_t Address, const void *Decoder)

Callers

nothing calls this directly

Calls 3

DecoderGPRRegisterClassFunction · 0.85
MCOperand_CreateImm0Function · 0.85
CheckFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…