diff --git a/llvm/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp b/llvm/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp --- a/llvm/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp +++ b/llvm/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp @@ -115,8 +115,6 @@ static DecodeStatus DecodeFpRCRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder) { - assert(RegNo <= 30 && "Expecting a register number no more than 30."); - assert((RegNo & 1) == 0 && "Expecting an even register number."); return decodeRegisterClass(Inst, RegNo >> 1, FpRegs); } diff --git a/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-dfp.txt b/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-dfp.txt --- a/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-dfp.txt +++ b/llvm/test/MC/Disassembler/PowerPC/ppc64-encoding-dfp.txt @@ -23,3 +23,12 @@ # CHECK: dsubq. 2, 6, 4 0xfc 0x46 0x24 0x05 + +# This is actually the encoding for an invalid instruction. +# However, we check it here because the disassembler shouldn't check if an +# instruction is valid when decoding it because llvm-objdump uses the decoder +# for data sections as well as text sections and we do not want to assert in +# cases where we are decoding a data section that happens to match an invalid +# instruction. +# CHECK: dsubq 0, 6, 30 +0xfc 0x06 0xfc 0x04