753b78fde67cab3e81b0ad3d2c3c2ddad2508844
[oota-llvm.git] / lib / Target / WebAssembly / MCTargetDesc / WebAssemblyMCTargetDesc.h
1 //==- WebAssemblyMCTargetDesc.h - WebAssembly Target Descriptions -*- C++ -*-=//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// \brief This file provides WebAssembly-specific target descriptions.
12 ///
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_MCTARGETDESC_WEBASSEMBLYMCTARGETDESC_H
16 #define LLVM_LIB_TARGET_WEBASSEMBLY_MCTARGETDESC_WEBASSEMBLYMCTARGETDESC_H
17
18 #include "llvm/MC/MCInstrDesc.h"
19 #include "llvm/Support/DataTypes.h"
20
21 namespace llvm {
22
23 class MCAsmBackend;
24 class MCCodeEmitter;
25 class MCContext;
26 class MCInstrInfo;
27 class MCObjectWriter;
28 class MCSubtargetInfo;
29 class Target;
30 class Triple;
31 class raw_pwrite_stream;
32
33 extern Target TheWebAssemblyTarget32;
34 extern Target TheWebAssemblyTarget64;
35
36 MCCodeEmitter *createWebAssemblyMCCodeEmitter(const MCInstrInfo &MCII,
37                                               MCContext &Ctx);
38
39 MCAsmBackend *createWebAssemblyAsmBackend(const Triple &TT);
40
41 MCObjectWriter *createWebAssemblyELFObjectWriter(raw_pwrite_stream &OS,
42                                                  bool Is64Bit, uint8_t OSABI);
43
44 namespace WebAssembly {
45 enum OperandType {
46   /// Basic block label in a branch construct.
47   OPERAND_BASIC_BLOCK = MCOI::OPERAND_FIRST_TARGET,
48   /// Floating-point immediate.
49   OPERAND_FPIMM
50 };
51 } // end namespace WebAssembly
52
53 namespace WebAssemblyII {
54 enum {
55   // For variadic instructions, this flag indicates whether an operand
56   // in the variable_ops range is an immediate value.
57   VariableOpIsImmediate       = (1 << 0),
58   // For immediate values in the variable_ops range, this flag indicates
59   // whether the value represents a type.
60   VariableOpImmediateIsType   = (1 << 1),
61 };
62 } // end namespace WebAssemblyII
63
64 } // end namespace llvm
65
66 // Defines symbolic names for WebAssembly registers. This defines a mapping from
67 // register name to register number.
68 //
69 #define GET_REGINFO_ENUM
70 #include "WebAssemblyGenRegisterInfo.inc"
71
72 // Defines symbolic names for the WebAssembly instructions.
73 //
74 #define GET_INSTRINFO_ENUM
75 #include "WebAssemblyGenInstrInfo.inc"
76
77 #define GET_SUBTARGETINFO_ENUM
78 #include "WebAssemblyGenSubtargetInfo.inc"
79
80 #endif