@@ -1751,13 +1751,18 @@ static DecodeStatus DecodeCopMemInstruction(MCInst *Inst, unsigned Insn,
17511751{
17521752 DecodeStatus S = MCDisassembler_Success ;
17531753
1754+ unsigned P = fieldFromInstruction_4 (Insn , 24 , 1 );
1755+ unsigned W = fieldFromInstruction_4 (Insn , 21 , 1 );
17541756 unsigned pred = fieldFromInstruction_4 (Insn , 28 , 4 );
17551757 unsigned CRd = fieldFromInstruction_4 (Insn , 12 , 4 );
17561758 unsigned coproc = fieldFromInstruction_4 (Insn , 8 , 4 );
17571759 unsigned imm = fieldFromInstruction_4 (Insn , 0 , 8 );
17581760 unsigned Rn = fieldFromInstruction_4 (Insn , 16 , 4 );
17591761 unsigned U = fieldFromInstruction_4 (Insn , 23 , 1 );
17601762
1763+ // Pre-Indexed implies writeback to Rn
1764+ bool IsPreIndexed = (P == 1 ) && (W == 1 );
1765+
17611766 switch (MCInst_getOpcode (Inst )) {
17621767 case ARM_LDC_OFFSET :
17631768 case ARM_LDC_PRE :
@@ -1830,6 +1835,10 @@ static DecodeStatus DecodeCopMemInstruction(MCInst *Inst, unsigned Insn,
18301835 if (ARM_getFeatureBits (Inst -> csh -> mode , ARM_HasV8Ops ) && (coproc != 14 ))
18311836 return MCDisassembler_Fail ;
18321837
1838+ if (IsPreIndexed )
1839+ // Dummy operand for Rn_wb.
1840+ MCOperand_CreateImm0 (Inst , (0 ));
1841+
18331842 MCOperand_CreateImm0 (Inst , (coproc ));
18341843 MCOperand_CreateImm0 (Inst , (CRd ));
18351844 if (!Check (& S , DecodeGPRRegisterClass (Inst , Rn , Address , Decoder )))
0 commit comments