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

Function DecodeT2LDRDPreInstruction

arch/ARM/ARMDisassembler.c:5333–5371  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5331}
5332
5333static DecodeStatus DecodeT2LDRDPreInstruction(MCInst *Inst, unsigned Insn,
5334 uint64_t Address, const void *Decoder)
5335{
5336 DecodeStatus S = MCDisassembler_Success;
5337 unsigned Rt = fieldFromInstruction_4(Insn, 12, 4);
5338 unsigned Rt2 = fieldFromInstruction_4(Insn, 8, 4);
5339 unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
5340 unsigned addr = fieldFromInstruction_4(Insn, 0, 8);
5341 unsigned W = fieldFromInstruction_4(Insn, 21, 1);
5342 unsigned U = fieldFromInstruction_4(Insn, 23, 1);
5343 unsigned P = fieldFromInstruction_4(Insn, 24, 1);
5344 bool writeback = (W == 1) | (P == 0);
5345
5346 addr |= (U << 8) | (Rn << 9);
5347
5348 if (writeback && (Rn == Rt || Rn == Rt2))
5349 Check(&S, MCDisassembler_SoftFail);
5350
5351 if (Rt == Rt2)
5352 Check(&S, MCDisassembler_SoftFail);
5353
5354 // Rt
5355 if (!Check(&S, DecoderGPRRegisterClass(Inst, Rt, Address, Decoder)))
5356 return MCDisassembler_Fail;
5357
5358 // Rt2
5359 if (!Check(&S, DecoderGPRRegisterClass(Inst, Rt2, Address, Decoder)))
5360 return MCDisassembler_Fail;
5361
5362 // Writeback operand
5363 if (!Check(&S, DecoderGPRRegisterClass(Inst, Rn, Address, Decoder)))
5364 return MCDisassembler_Fail;
5365
5366 // addr
5367 if (!Check(&S, DecodeT2AddrModeImm8s4(Inst, addr, Address, Decoder)))
5368 return MCDisassembler_Fail;
5369
5370 return S;
5371}
5372
5373static DecodeStatus DecodeT2STRDPreInstruction(MCInst *Inst, unsigned Insn,
5374 uint64_t Address, const void *Decoder)

Callers

nothing calls this directly

Calls 3

DecoderGPRRegisterClassFunction · 0.85
DecodeT2AddrModeImm8s4Function · 0.85
CheckFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…