diff options
| author | Thomas Lively <tlively@google.com> | 2019-02-05 00:49:55 +0000 | 
|---|---|---|
| committer | Thomas Lively <tlively@google.com> | 2019-02-05 00:49:55 +0000 | 
| commit | d99af23765a99ef2461d06b74448d6e54dd7e573 (patch) | |
| tree | 26fb976effaad88da2b766088d6b32ee0bb10686 /llvm/lib/Target/WebAssembly/WebAssemblyInstrBulkMemory.td | |
| parent | 1a17032b788016299ea4e3c4b53670c6dcd94b4f (diff) | |
| download | bcm5719-llvm-d99af23765a99ef2461d06b74448d6e54dd7e573.tar.gz bcm5719-llvm-d99af23765a99ef2461d06b74448d6e54dd7e573.zip | |
[WebAssembly] memory.copy
Summary: Depends on D57495.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, hiraditya, sunfish
Differential Revision: https://reviews.llvm.org/D57498
llvm-svn: 353127
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyInstrBulkMemory.td')
| -rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyInstrBulkMemory.td | 39 | 
1 files changed, 39 insertions, 0 deletions
| diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrBulkMemory.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrBulkMemory.td new file mode 100644 index 00000000000..4642236366e --- /dev/null +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrBulkMemory.td @@ -0,0 +1,39 @@ +// WebAssemblyInstrBulkMemory.td - bulk memory codegen support --*- tablegen -*- +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +/// +/// \file +/// WebAssembly bulk memory codegen constructs. +/// +//===----------------------------------------------------------------------===// + +// Instruction requiring HasBulkMemory and the bulk memory prefix byte +multiclass BULK_I<dag oops_r, dag iops_r, dag oops_s, dag iops_s, +                  list<dag> pattern_r, string asmstr_r = "", +                  string asmstr_s = "", bits<32> simdop = -1> { +  defm "" : I<oops_r, iops_r, oops_s, iops_s, pattern_r, asmstr_r, asmstr_s, +              !or(0xfc00, !and(0xff, simdop))>, +            Requires<[HasBulkMemory]>; +} + +// Bespoke types and nodes for bulk memory ops +def wasm_memcpy_t : SDTypeProfile<0, 3, +  [SDTCisPtrTy<0>, SDTCisPtrTy<1>, SDTCisInt<2>] +>; +def wasm_memcpy : SDNode<"WebAssemblyISD::MEMORY_COPY", wasm_memcpy_t, +                         [SDNPHasChain, SDNPMayLoad, SDNPMayStore]>; + +//===----------------------------------------------------------------------===// +// memory.copy +//===----------------------------------------------------------------------===// + +let mayLoad = 1, mayStore = 1 in +defm MEMORY_COPY : BULK_I<(outs), (ins I32:$dst, I32:$src, I32:$len), +                          (outs), (ins), +                          [(wasm_memcpy I32:$dst, I32:$src, I32:$len)], +                          "memory.copy\t$dst, $src, $len", +                          "memory.copy", 0x0a>; | 

