Skip to content

Commit 848d288

Browse files
committed
[LLVM][MC] Introduce OrFail variants of MCD ops
1 parent 492ad84 commit 848d288

File tree

3 files changed

+191
-96
lines changed

3 files changed

+191
-96
lines changed

llvm/include/llvm/MC/MCDecoderOps.h

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,29 @@
1010
#ifndef LLVM_MC_MCDECODEROPS_H
1111
#define LLVM_MC_MCDECODEROPS_H
1212

13-
namespace llvm {
13+
namespace llvm::MCD {
1414

15-
namespace MCD {
1615
// Disassembler state machine opcodes.
16+
// nts_t is either uint16_t or uint24_t based on whether large decoder table is
17+
// enabled.
1718
enum DecoderOps {
18-
OPC_ExtractField = 1, // OPC_ExtractField(uleb128 Start, uint8_t Len)
19-
OPC_FilterValue, // OPC_FilterValue(uleb128 Val, uint16_t NumToSkip)
20-
OPC_CheckField, // OPC_CheckField(uleb128 Start, uint8_t Len,
21-
// uleb128 Val, uint16_t NumToSkip)
22-
OPC_CheckPredicate, // OPC_CheckPredicate(uleb128 PIdx, uint16_t NumToSkip)
23-
OPC_Decode, // OPC_Decode(uleb128 Opcode, uleb128 DIdx)
24-
OPC_TryDecode, // OPC_TryDecode(uleb128 Opcode, uleb128 DIdx,
25-
// uint16_t NumToSkip)
26-
OPC_SoftFail, // OPC_SoftFail(uleb128 PMask, uleb128 NMask)
27-
OPC_Fail // OPC_Fail()
19+
OPC_ExtractField = 1, // OPC_ExtractField(uleb128 Start, uint8_t Len)
20+
OPC_FilterValue, // OPC_FilterValue(uleb128 Val, nts_t NumToSkip)
21+
OPC_FilterValueOrFail, // OPC_FilterValueOrFail(uleb128 Val)
22+
OPC_CheckField, // OPC_CheckField(uleb128 Start, uint8_t Len,
23+
// uleb128 Val, nts_t NumToSkip)
24+
OPC_CheckFieldOrFail, // OPC_ChecFieldOrFail(uleb128 Start, uint8_t Len,
25+
// uleb128 Val)
26+
OPC_CheckPredicate, // OPC_CheckPredicate(uleb128 PIdx, nts_t NumToSkip)
27+
OPC_CheckPredicateOrFail, // OPC_CheckPredicateOrFail(uleb128 PIdx)
28+
OPC_Decode, // OPC_Decode(uleb128 Opcode, uleb128 DIdx)
29+
OPC_TryDecode, // OPC_TryDecode(uleb128 Opcode, uleb128 DIdx,
30+
// nts_t NumToSkip)
31+
OPC_TryDecodeOrFail, // OPC_TryDecodeOrFail(uleb128 Opcode, uleb128 DIdx)
32+
OPC_SoftFail, // OPC_SoftFail(uleb128 PMask, uleb128 NMask)
33+
OPC_Fail // OPC_Fail()
2834
};
2935

30-
} // namespace MCD
31-
} // namespace llvm
36+
} // namespace llvm::MCD
3237

3338
#endif

llvm/lib/Target/AArch64/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +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-
--large-decoder-table)
11+
)
1212
tablegen(LLVM AArch64GenFastISel.inc -gen-fast-isel)
1313
tablegen(LLVM AArch64GenGlobalISel.inc -gen-global-isel)
1414
tablegen(LLVM AArch64GenO0PreLegalizeGICombiner.inc -gen-global-isel-combiner

0 commit comments

Comments
 (0)