From 3d414652d36aeb27896cc6666ef15db39f245786 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Wed, 6 Jan 2021 14:36:27 -0500 Subject: Prototype prefetch instructions (#3467) As proposed in https://github.com/WebAssembly/simd/pull/352, using the opcodes used in the LLVM and V8 implementations. --- src/wasm/wasm-s-parser.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/wasm/wasm-s-parser.cpp') diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp index 20e99436a..20ab4f3d2 100644 --- a/src/wasm/wasm-s-parser.cpp +++ b/src/wasm/wasm-s-parser.cpp @@ -1662,6 +1662,12 @@ SExpressionWasmBuilder::makeSIMDLoadStoreLane(Element& s, return ret; } +Expression* SExpressionWasmBuilder::makePrefetch(Element& s, PrefetchOp op) { + Address offset, align; + size_t i = parseMemAttributes(s, offset, align, /*defaultAlign*/ 1); + return Builder(wasm).makePrefetch(op, offset, align, parseExpression(s[i])); +} + Expression* SExpressionWasmBuilder::makeMemoryInit(Element& s) { auto ret = allocator.alloc(); ret->segment = atoi(s[1]->str().c_str()); -- cgit v1.2.3