[WebAssembly] Support for binary atomic RMW instructions
authorHeejin Ahn <aheejin@gmail.com>
Mon, 9 Jul 2018 22:30:51 +0000 (22:30 +0000)
committerHeejin Ahn <aheejin@gmail.com>
Mon, 9 Jul 2018 22:30:51 +0000 (22:30 +0000)
commitfed7382ef695ae81769620dbeee74a058615e148
tree8c1b3bb8fa0d5434b65991f307f92ccca1b2aa32
parent703c872a4a64160cee299fae0144c9bf08949cc8
[WebAssembly] Support for binary atomic RMW instructions

Summary:
This adds support for binary atomic read-modify-write instructions:
add, sub, and, or, xor, and xchg.

This does not yet support translations of some of LLVM IR atomicrmw
instructions (nand, max, min, umax, and umin) that do not have a direct
counterpart in wasm instructions.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

Differential Revision: https://reviews.llvm.org/D49088

llvm-svn: 336615
llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td
llvm/lib/Target/WebAssembly/WebAssemblySetP2AlignOperands.cpp
llvm/test/CodeGen/WebAssembly/atomic-rmw.ll [new file with mode: 0644]
llvm/test/CodeGen/WebAssembly/offset-atomics.ll