Skip to content

Commit c82858d

Browse files
committed
[AArch64] Correctly disassemble TSB instruction
TSB instruction has one operand, but the generated disassembler didn't decode this operand. AArch64InstPrinter had a workaround for this. This instruction can now be disassembled correctly.
1 parent b1cd999 commit c82858d

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

llvm/lib/Target/AArch64/AArch64SystemOperands.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def lookupTSBByName : SearchIndex {
362362
let Key = ["Name"];
363363
}
364364

365-
def : TSB<"csync", 0>;
365+
def : TSB<"csync", 2>;
366366

367367
//===----------------------------------------------------------------------===//
368368
// PRFM (prefetch) instruction options.

llvm/lib/Target/AArch64/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ tablegen(LLVM AArch64GenAsmWriter1.inc -gen-asm-writer -asmwriternum=1)
88
tablegen(LLVM AArch64GenCallingConv.inc -gen-callingconv)
99
tablegen(LLVM AArch64GenDAGISel.inc -gen-dag-isel)
1010
tablegen(LLVM AArch64GenDisassemblerTables.inc -gen-disassembler
11-
-ignore-non-decodable-operands
12-
-ignore-fully-defined-operands)
11+
-ignore-non-decodable-operands)
1312
tablegen(LLVM AArch64GenFastISel.inc -gen-fast-isel)
1413
tablegen(LLVM AArch64GenGlobalISel.inc -gen-global-isel)
1514
tablegen(LLVM AArch64GenO0PreLegalizeGICombiner.inc -gen-global-isel-combiner

llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,6 @@ void AArch64InstPrinter::printInst(const MCInst *MI, uint64_t Address,
365365
return;
366366
}
367367

368-
// Instruction TSB is specified as a one operand instruction, but 'csync' is
369-
// not encoded, so for printing it is treated as a special case here:
370-
if (Opcode == AArch64::TSB) {
371-
O << "\ttsb\tcsync";
372-
return;
373-
}
374-
375368
if (!PrintAliases || !printAliasInstr(MI, Address, STI, O))
376369
printInstruction(MI, Address, STI, O);
377370

0 commit comments

Comments
 (0)