Skip to content

Commit

Permalink
[WebAssembly] Define more wasm binary encoding constants.
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288411 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Dan Gohman committed Dec 1, 2016
1 parent 6f328c7 commit 1162e1b
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions include/llvm/Support/Wasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,35 @@ enum : unsigned {
WASM_SEC_DATA = 11 // Data segments
};

// Type immediate encodings used in various contexts.
enum : unsigned {
WASM_TYPE_I32 = 0x7f,
WASM_TYPE_I64 = 0x7e,
WASM_TYPE_F32 = 0x7d,
WASM_TYPE_F64 = 0x7c,
WASM_TYPE_ANYFUNC = 0x70,
WASM_TYPE_FUNC = 0x60,
WASM_TYPE_NORESULT = 0x40, // for blocks with no result values
};

// Kinds of externals (for imports and exports).
enum : unsigned {
WASM_EXTERNAL_FUNCTION = 0x0,
WASM_EXTERNAL_TABLE = 0x1,
WASM_EXTERNAL_MEMORY = 0x2,
WASM_EXTERNAL_GLOBAL = 0x3,
};

// Opcodes used in initializer expressions.
enum : unsigned {
WASM_OPCODE_END = 0x0b,
WASM_OPCODE_GET_GLOBAL = 0x23,
WASM_OPCODE_I32_CONST = 0x41,
WASM_OPCODE_I64_CONST = 0x42,
WASM_OPCODE_F32_CONST = 0x43,
WASM_OPCODE_F64_CONST = 0x44,
};

} // end namespace wasm
} // end namespace llvm

Expand Down

0 comments on commit 1162e1b

Please sign in to comment.