[WebAssembly] Implement ref.null
authorAndy Wingo <wingo@igalia.com>
Tue, 3 Nov 2020 18:46:23 +0000 (10:46 -0800)
committerThomas Lively <tlively@google.com>
Tue, 3 Nov 2020 18:46:23 +0000 (10:46 -0800)
commit107c3a12d627f12a23f138a00d6aabe9de7402f7
tree956497feb7d3fde2dd7af347b539891e618f2f93
parentca5b31502c828f8e7160a77f54a5a131dc298005
[WebAssembly] Implement ref.null

This patch adds a new "heap type" operand kind to the WebAssembly MC
layer, used by ref.null. Currently the possible values are "extern" and
"func"; when typed function references come, though, this operand may be
a type index.

Note that the "heap type" production is still known as "refedtype" in
the draft proposal; changing its name in the spec is
ongoing (https://github.com/WebAssembly/reference-types/issues/123).

The register form of ref.null is still untested.

Differential Revision: https://reviews.llvm.org/D90608
llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
llvm/lib/Target/WebAssembly/Disassembler/WebAssemblyDisassembler.cpp
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.cpp
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.h
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCCodeEmitter.cpp
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td
llvm/lib/Target/WebAssembly/WebAssemblyInstrRef.td
llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
llvm/test/MC/WebAssembly/reference-types.s [new file with mode: 0644]