blob: 7c4fb6c3c59cbcf7b132216841ef1b79824cdb1f [file] [log] [blame]
Dan Gohman10e730a2015-06-29 23:51:55 +00001//==- 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
Dan Gohmana11fb232016-01-12 03:09:16 +000018#include "llvm/MC/MCInstrDesc.h"
Dan Gohman10e730a2015-06-29 23:51:55 +000019#include "llvm/Support/DataTypes.h"
Dan Gohman10e730a2015-06-29 23:51:55 +000020
21namespace llvm {
22
Dan Gohman10e730a2015-06-29 23:51:55 +000023class MCAsmBackend;
24class MCCodeEmitter;
25class MCContext;
26class MCInstrInfo;
Dan Gohman10e730a2015-06-29 23:51:55 +000027class MCObjectWriter;
Dan Gohman10e730a2015-06-29 23:51:55 +000028class MCSubtargetInfo;
Dan Gohman10e730a2015-06-29 23:51:55 +000029class Target;
30class Triple;
Dan Gohman53828fd2015-11-23 16:50:18 +000031class raw_pwrite_stream;
Dan Gohman10e730a2015-06-29 23:51:55 +000032
Dan Gohmand82494b2015-07-01 21:42:34 +000033extern Target TheWebAssemblyTarget32;
34extern Target TheWebAssemblyTarget64;
Dan Gohman10e730a2015-06-29 23:51:55 +000035
Dan Gohman53828fd2015-11-23 16:50:18 +000036MCCodeEmitter *createWebAssemblyMCCodeEmitter(const MCInstrInfo &MCII,
Dan Gohman53828fd2015-11-23 16:50:18 +000037 MCContext &Ctx);
38
Dan Gohmancceedf72016-01-08 00:43:54 +000039MCAsmBackend *createWebAssemblyAsmBackend(const Triple &TT);
Dan Gohman10e730a2015-06-29 23:51:55 +000040
Dan Gohman05ac43f2015-12-17 01:39:00 +000041MCObjectWriter *createWebAssemblyELFObjectWriter(raw_pwrite_stream &OS,
42 bool Is64Bit, uint8_t OSABI);
43
Dan Gohmana11fb232016-01-12 03:09:16 +000044namespace WebAssembly {
45enum 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
53namespace WebAssemblyII {
54enum {
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),
Dan Gohman1d68e80f2016-01-12 19:14:46 +000061 // For immediate values in the variable_ops range, this flag indicates
62 // whether the value represents a control-flow label.
63 VariableOpImmediateIsLabel = (1 << 2),
Dan Gohmana11fb232016-01-12 03:09:16 +000064};
65} // end namespace WebAssemblyII
66
Dan Gohman10e730a2015-06-29 23:51:55 +000067} // end namespace llvm
68
69// Defines symbolic names for WebAssembly registers. This defines a mapping from
70// register name to register number.
71//
JF Bastien5ca0bac2015-07-10 18:23:10 +000072#define GET_REGINFO_ENUM
73#include "WebAssemblyGenRegisterInfo.inc"
74
JF Bastienb9073fb2015-07-22 21:28:15 +000075// Defines symbolic names for the WebAssembly instructions.
76//
77#define GET_INSTRINFO_ENUM
78#include "WebAssemblyGenInstrInfo.inc"
79
Dan Gohman10e730a2015-06-29 23:51:55 +000080#define GET_SUBTARGETINFO_ENUM
81#include "WebAssemblyGenSubtargetInfo.inc"
82
Dan Gohman10e730a2015-06-29 23:51:55 +000083#endif