@@ -83,11 +83,18 @@ static DecodeStatus DecodeGPR8RegisterClass(MCInst &Inst, unsigned RegNo,
8383static DecodeStatus DecodeLD8RegisterClass (MCInst &Inst, unsigned RegNo,
8484 uint64_t Address,
8585 const MCDisassembler *Decoder) {
86- if (RegNo > 15 )
87- return MCDisassembler::Fail;
86+ assert (isUInt<4 >(RegNo));
87+ // Only r16...r31 are legal.
88+ Inst.addOperand (MCOperand::createReg (GPRDecoderTable[16 + RegNo]));
89+ return MCDisassembler::Success;
90+ }
8891
89- unsigned Register = GPRDecoderTable[RegNo + 16 ];
90- Inst.addOperand (MCOperand::createReg (Register));
92+ static DecodeStatus DecodeLD8loRegisterClass (MCInst &Inst, unsigned RegNo,
93+ uint64_t Address,
94+ const MCDisassembler *Decoder) {
95+ assert (isUInt<3 >(RegNo));
96+ // Only r16...r23 are legal.
97+ Inst.addOperand (MCOperand::createReg (GPRDecoderTable[16 + RegNo]));
9198 return MCDisassembler::Success;
9299}
93100
@@ -122,20 +129,6 @@ static DecodeStatus decodeRelCondBrTarget13(MCInst &Inst, unsigned Field,
122129 return MCDisassembler::Success;
123130}
124131
125- static DecodeStatus decodeFFMULRdRr (MCInst &Inst, unsigned Insn,
126- uint64_t Address,
127- const MCDisassembler *Decoder) {
128- unsigned d = fieldFromInstruction (Insn, 4 , 3 ) + 16 ;
129- unsigned r = fieldFromInstruction (Insn, 0 , 3 ) + 16 ;
130- if (DecodeGPR8RegisterClass (Inst, d, Address, Decoder) ==
131- MCDisassembler::Fail)
132- return MCDisassembler::Fail;
133- if (DecodeGPR8RegisterClass (Inst, r, Address, Decoder) ==
134- MCDisassembler::Fail)
135- return MCDisassembler::Fail;
136- return MCDisassembler::Success;
137- }
138-
139132static DecodeStatus decodeFMOVWRdRr (MCInst &Inst, unsigned Insn,
140133 uint64_t Address,
141134 const MCDisassembler *Decoder) {
@@ -166,20 +159,6 @@ static DecodeStatus decodeFWRdK(MCInst &Inst, unsigned Insn, uint64_t Address,
166159 return MCDisassembler::Success;
167160}
168161
169- static DecodeStatus decodeFMUL2RdRr (MCInst &Inst, unsigned Insn,
170- uint64_t Address,
171- const MCDisassembler *Decoder) {
172- unsigned rd = fieldFromInstruction (Insn, 4 , 4 ) + 16 ;
173- unsigned rr = fieldFromInstruction (Insn, 0 , 4 ) + 16 ;
174- if (DecodeGPR8RegisterClass (Inst, rd, Address, Decoder) ==
175- MCDisassembler::Fail)
176- return MCDisassembler::Fail;
177- if (DecodeGPR8RegisterClass (Inst, rr, Address, Decoder) ==
178- MCDisassembler::Fail)
179- return MCDisassembler::Fail;
180- return MCDisassembler::Success;
181- }
182-
183162static DecodeStatus decodeMemri (MCInst &Inst, unsigned Insn, uint64_t Address,
184163 const MCDisassembler *Decoder) {
185164 // As in the EncoderMethod `AVRMCCodeEmitter::encodeMemri`, the memory
0 commit comments