@@ -209,6 +209,8 @@ static DecodeStatus DecodeSIMM13(MCInst &Inst, unsigned insn,
209
209
uint64_t Address, const void *Decoder);
210
210
static DecodeStatus DecodeJMPL (MCInst &Inst, unsigned insn, uint64_t Address,
211
211
const void *Decoder);
212
+ static DecodeStatus DecodeReturn (MCInst &MI, unsigned insn, uint64_t Address,
213
+ const void *Decoder);
212
214
213
215
#include " SparcGenDisassemblerTables.inc"
214
216
@@ -415,3 +417,31 @@ static DecodeStatus DecodeJMPL(MCInst &MI, unsigned insn, uint64_t Address,
415
417
}
416
418
return MCDisassembler::Success;
417
419
}
420
+
421
+ static DecodeStatus DecodeReturn (MCInst &MI, unsigned insn, uint64_t Address,
422
+ const void *Decoder) {
423
+
424
+ unsigned rs1 = fieldFromInstruction (insn, 14 , 5 );
425
+ unsigned isImm = fieldFromInstruction (insn, 13 , 1 );
426
+ unsigned rs2 = 0 ;
427
+ unsigned simm13 = 0 ;
428
+ if (isImm)
429
+ simm13 = SignExtend32<13 >(fieldFromInstruction (insn, 0 , 13 ));
430
+ else
431
+ rs2 = fieldFromInstruction (insn, 0 , 5 );
432
+
433
+ // Decode RS1.
434
+ DecodeStatus status = DecodeIntRegsRegisterClass (MI, rs1, Address, Decoder);
435
+ if (status != MCDisassembler::Success)
436
+ return status;
437
+
438
+ // Decode RS2 | SIMM13.
439
+ if (isImm)
440
+ MI.addOperand (MCOperand::CreateImm (simm13));
441
+ else {
442
+ status = DecodeIntRegsRegisterClass (MI, rs2, Address, Decoder);
443
+ if (status != MCDisassembler::Success)
444
+ return status;
445
+ }
446
+ return MCDisassembler::Success;
447
+ }
0 commit comments