@@ -173,6 +173,19 @@ static DecodeStatus s32_0ImmDecoder(MCInst &MI, unsigned tmp,
173
173
const MCDisassembler *Decoder);
174
174
static DecodeStatus brtargetDecoder (MCInst &MI, unsigned tmp, uint64_t Address,
175
175
const MCDisassembler *Decoder);
176
+
177
+ static DecodeStatus n1ConstDecoder (MCInst &MI, const MCDisassembler *Decoder) {
178
+ MCContext &Ctx = Decoder->getContext ();
179
+ MI.addOperand (MCOperand::createExpr (MCConstantExpr::create (-1 , Ctx)));
180
+ return DecodeStatus::Success;
181
+ }
182
+
183
+ static DecodeStatus sgp10ConstDecoder (MCInst &MI,
184
+ const MCDisassembler *Decoder) {
185
+ MI.addOperand (MCOperand::createReg (Hexagon::SGP1_0));
186
+ return DecodeStatus::Success;
187
+ }
188
+
176
189
#include " HexagonDepDecoders.inc"
177
190
#include " HexagonGenDisassemblerTables.inc"
178
191
@@ -349,21 +362,6 @@ void HexagonDisassembler::remapInstruction(MCInst &Instr) const {
349
362
}
350
363
}
351
364
352
- static void adjustDuplex (MCInst &MI, MCContext &Context) {
353
- switch (MI.getOpcode ()) {
354
- case Hexagon::SA1_setin1:
355
- MI.insert (MI.begin () + 1 ,
356
- MCOperand::createExpr (MCConstantExpr::create (-1 , Context)));
357
- break ;
358
- case Hexagon::SA1_dec:
359
- MI.insert (MI.begin () + 2 ,
360
- MCOperand::createExpr (MCConstantExpr::create (-1 , Context)));
361
- break ;
362
- default :
363
- break ;
364
- }
365
- }
366
-
367
365
DecodeStatus HexagonDisassembler::getSingleInstruction (MCInst &MI, MCInst &MCB,
368
366
ArrayRef<uint8_t > Bytes,
369
367
uint64_t Address,
@@ -468,12 +466,10 @@ DecodeStatus HexagonDisassembler::getSingleInstruction(MCInst &MI, MCInst &MCB,
468
466
CurrentExtender = TmpExtender;
469
467
if (Result != DecodeStatus::Success)
470
468
return DecodeStatus::Fail;
471
- adjustDuplex (*MILow, getContext ());
472
469
Result = decodeInstruction (
473
470
DecodeHigh, *MIHigh, (Instruction >> 16 ) & 0x1fff , Address, this , STI);
474
471
if (Result != DecodeStatus::Success)
475
472
return DecodeStatus::Fail;
476
- adjustDuplex (*MIHigh, getContext ());
477
473
MCOperand OPLow = MCOperand::createInst (MILow);
478
474
MCOperand OPHigh = MCOperand::createInst (MIHigh);
479
475
MI.addOperand (OPLow);
@@ -499,41 +495,6 @@ DecodeStatus HexagonDisassembler::getSingleInstruction(MCInst &MI, MCInst &MCB,
499
495
500
496
}
501
497
502
- switch (MI.getOpcode ()) {
503
- case Hexagon::J4_cmpeqn1_f_jumpnv_nt:
504
- case Hexagon::J4_cmpeqn1_f_jumpnv_t:
505
- case Hexagon::J4_cmpeqn1_fp0_jump_nt:
506
- case Hexagon::J4_cmpeqn1_fp0_jump_t:
507
- case Hexagon::J4_cmpeqn1_fp1_jump_nt:
508
- case Hexagon::J4_cmpeqn1_fp1_jump_t:
509
- case Hexagon::J4_cmpeqn1_t_jumpnv_nt:
510
- case Hexagon::J4_cmpeqn1_t_jumpnv_t:
511
- case Hexagon::J4_cmpeqn1_tp0_jump_nt:
512
- case Hexagon::J4_cmpeqn1_tp0_jump_t:
513
- case Hexagon::J4_cmpeqn1_tp1_jump_nt:
514
- case Hexagon::J4_cmpeqn1_tp1_jump_t:
515
- case Hexagon::J4_cmpgtn1_f_jumpnv_nt:
516
- case Hexagon::J4_cmpgtn1_f_jumpnv_t:
517
- case Hexagon::J4_cmpgtn1_fp0_jump_nt:
518
- case Hexagon::J4_cmpgtn1_fp0_jump_t:
519
- case Hexagon::J4_cmpgtn1_fp1_jump_nt:
520
- case Hexagon::J4_cmpgtn1_fp1_jump_t:
521
- case Hexagon::J4_cmpgtn1_t_jumpnv_nt:
522
- case Hexagon::J4_cmpgtn1_t_jumpnv_t:
523
- case Hexagon::J4_cmpgtn1_tp0_jump_nt:
524
- case Hexagon::J4_cmpgtn1_tp0_jump_t:
525
- case Hexagon::J4_cmpgtn1_tp1_jump_nt:
526
- case Hexagon::J4_cmpgtn1_tp1_jump_t:
527
- MI.insert (MI.begin () + 1 ,
528
- MCOperand::createExpr (MCConstantExpr::create (-1 , getContext ())));
529
- break ;
530
- case Hexagon::Y4_crswap10:
531
- MI.addOperand (MCOperand::createReg (Hexagon::SGP1_0));
532
- break ;
533
- default :
534
- break ;
535
- }
536
-
537
498
if (HexagonMCInstrInfo::isNewValue (*MCII, MI)) {
538
499
unsigned OpIndex = HexagonMCInstrInfo::getNewValueOp (*MCII, MI);
539
500
MCOperand &MCO = MI.getOperand (OpIndex);
0 commit comments