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

Function DecodeT2STRDPreInstruction

arch/ARM/ARMDisassembler.c:5373–5408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5371}
5372
5373static DecodeStatus DecodeT2STRDPreInstruction(MCInst *Inst, unsigned Insn,
5374 uint64_t Address, const void *Decoder)
5375{
5376 DecodeStatus S = MCDisassembler_Success;
5377 unsigned Rt = fieldFromInstruction_4(Insn, 12, 4);
5378 unsigned Rt2 = fieldFromInstruction_4(Insn, 8, 4);
5379 unsigned Rn = fieldFromInstruction_4(Insn, 16, 4);
5380 unsigned addr = fieldFromInstruction_4(Insn, 0, 8);
5381 unsigned W = fieldFromInstruction_4(Insn, 21, 1);
5382 unsigned U = fieldFromInstruction_4(Insn, 23, 1);
5383 unsigned P = fieldFromInstruction_4(Insn, 24, 1);
5384 bool writeback = (W == 1) | (P == 0);
5385
5386 addr |= (U << 8) | (Rn << 9);
5387
5388 if (writeback && (Rn == Rt || Rn == Rt2))
5389 Check(&S, MCDisassembler_SoftFail);
5390
5391 // Writeback operand
5392 if (!Check(&S, DecoderGPRRegisterClass(Inst, Rn, Address, Decoder)))
5393 return MCDisassembler_Fail;
5394
5395 // Rt
5396 if (!Check(&S, DecoderGPRRegisterClass(Inst, Rt, Address, Decoder)))
5397 return MCDisassembler_Fail;
5398
5399 // Rt2
5400 if (!Check(&S, DecoderGPRRegisterClass(Inst, Rt2, Address, Decoder)))
5401 return MCDisassembler_Fail;
5402
5403 // addr
5404 if (!Check(&S, DecodeT2AddrModeImm8s4(Inst, addr, Address, Decoder)))
5405 return MCDisassembler_Fail;
5406
5407 return S;
5408}
5409
5410static DecodeStatus DecodeT2Adr(MCInst *Inst, uint32_t Insn,
5411 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…