summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h')
-rw-r--r--llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h67
1 files changed, 31 insertions, 36 deletions
diff --git a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
index 5fa277324d6..ae3fb7bfd13 100644
--- a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
+++ b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
@@ -26,6 +26,7 @@ class MCContext;
class MCInstrInfo;
class MCObjectWriter;
class MCSubtargetInfo;
+class MVT;
class Target;
class Triple;
class raw_pwrite_stream;
@@ -59,17 +60,6 @@ enum OperandType {
/// signature immediate for block/loop.
OPERAND_SIGNATURE
};
-
-/// WebAssembly-specific directive identifiers.
-enum Directive {
- // FIXME: This is not the real binary encoding.
- DotParam = UINT64_MAX - 0, ///< .param
- DotResult = UINT64_MAX - 1, ///< .result
- DotLocal = UINT64_MAX - 2, ///< .local
- DotEndFunc = UINT64_MAX - 3, ///< .endfunc
- DotIndIdx = UINT64_MAX - 4, ///< .indidx
-};
-
} // end namespace WebAssembly
namespace WebAssemblyII {
@@ -79,10 +69,7 @@ enum {
VariableOpIsImmediate = (1 << 0),
// For immediate values in the variable_ops range, this flag indicates
// whether the value represents a control-flow label.
- VariableOpImmediateIsLabel = (1 << 1),
- // For immediate values in the variable_ops range, this flag indicates
- // whether the value represents a ValType.
- VariableOpImmediateIsType = (1 << 2),
+ VariableOpImmediateIsLabel = (1 << 1)
};
} // end namespace WebAssemblyII
@@ -150,33 +137,41 @@ static const unsigned StoreP2AlignOperandNo = 2;
/// This is used to indicate block signatures.
enum class ExprType {
- Void = 0,
- I32 = 1,
- I64 = 2,
- F32 = 3,
- F64 = 4,
- I8x16 = 5,
- I16x8 = 6,
- I32x4 = 7,
- I64x2 = 8,
- F32x4 = 9,
- F64x2 = 10
+ Void = 0x40,
+ I32 = 0x7f,
+ I64 = 0x7e,
+ F32 = 0x7d,
+ F64 = 0x7c,
+ I8x16 = 0x7b,
+ I16x8 = 0x7a,
+ I32x4 = 0x79,
+ F32x4 = 0x78,
+ B8x16 = 0x77,
+ B16x8 = 0x76,
+ B32x4 = 0x75
};
/// This is used to indicate local types.
enum class ValType {
- I32 = 1,
- I64 = 2,
- F32 = 3,
- F64 = 4,
- I8x16 = 5,
- I16x8 = 6,
- I32x4 = 7,
- I64x2 = 8,
- F32x4 = 9,
- F64x2 = 10
+ I32 = 0x7f,
+ I64 = 0x7e,
+ F32 = 0x7d,
+ F64 = 0x7c,
+ I8x16 = 0x7b,
+ I16x8 = 0x7a,
+ I32x4 = 0x79,
+ F32x4 = 0x78,
+ B8x16 = 0x77,
+ B16x8 = 0x76,
+ B32x4 = 0x75
};
+/// Instruction opcodes emitted via means other than CodeGen.
+static const unsigned Nop = 0x01;
+static const unsigned End = 0x0b;
+
+ValType toValType(const MVT &Ty);
+
} // end namespace WebAssembly
} // end namespace llvm
OpenPOWER on IntegriCloud