This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Support for binary atomic RMW instructions
ClosedPublic

Authored by aheejin on Jul 9 2018, 10:00 AM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

aheejin created this revision.Jul 9 2018, 10:00 AM
aheejin edited the summary of this revision. (Show Details)Jul 9 2018, 2:26 PM
aheejin updated this revision to Diff 154699.Jul 9 2018, 2:45 PM
  • Fix a typo
dschuff accepted this revision.Jul 9 2018, 2:55 PM

There should also be a few tests that orderings other than seq_cst get selected.

lib/Target/WebAssembly/WebAssemblyInstrAtomics.td
525 ↗(On Diff #154633)

Should this say "sign-extending"?

This revision is now accepted and ready to land.Jul 9 2018, 2:55 PM
aheejin marked an inline comment as done.Jul 9 2018, 3:05 PM

Will add non-seq_cst tests in another CL, because I guess we need them in not only here but in atomic loads/stores too.

This revision was automatically updated to reflect the committed changes.

Tests for weaker memory orderings have been added in D49194.