Skip to content

Commit 76d993b

Browse files
authored
[Hexagon] Add missing operand when disassembling Y4_crswap10 (llvm#153849)
Auto-generated decoder fails to add the $sgp10 operand because it has no encoding bits. Work around this by adding the missing operand after decoding is complete. Fixes llvm#153829.
1 parent 37729d8 commit 76d993b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

llvm/lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,9 @@ DecodeStatus HexagonDisassembler::getSingleInstruction(MCInst &MI, MCInst &MCB,
526526
MI.insert(MI.begin() + 1,
527527
MCOperand::createExpr(MCConstantExpr::create(-1, getContext())));
528528
break;
529+
case Hexagon::Y4_crswap10:
530+
MI.addOperand(MCOperand::createReg(Hexagon::SGP1_0));
531+
break;
529532
default:
530533
break;
531534
}

llvm/test/MC/Hexagon/system-inst.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ crswap(r12,sgp0)
8989
#CHECK: 652dc000 { crswap(r13,sgp1) }
9090
crswap(r13,sgp1)
9191

92+
#CHECK: 6d8ec000 { crswap(r15:14,s1:0) }
93+
crswap(r15:14,sgp1:0)
94+
9295
#CHECK: 660fc00e { r14 = getimask(r15) }
9396
r14=getimask(r15)
9497

0 commit comments

Comments
 (0)