xref: /freebsd/contrib/llvm-project/llvm/include/llvm/MC/MCDecoderOps.h (revision 700637cbb5e582861067a11aaca4d053546871d2)
1 //===------------ llvm/MC/MCDecoderOps.h - Decoder driver -------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 // Disassembler decoder state machine driver.
9 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_MC_MCDECODEROPS_H
11 #define LLVM_MC_MCDECODEROPS_H
12 
13 namespace llvm::MCD {
14 
15 // Disassembler state machine opcodes.
16 // nts_t is either uint16_t or uint24_t based on whether large decoder table is
17 // enabled.
18 enum DecoderOps {
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_CheckFieldOrFail(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()
34 };
35 
36 } // namespace llvm::MCD
37 
38 #endif
39