summaryrefslogtreecommitdiff
path: root/src/passes/Print.cpp
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2017-06-28 12:05:27 -0700
committerGitHub <noreply@github.com>2017-06-28 12:05:27 -0700
commite2c08d42ab0ffc05d980ae2d34fee0e77b201134 (patch)
tree4b70d7469df7fdd4ee70abf42534a2f685da4704 /src/passes/Print.cpp
parent14bcc443282146cb85ef2798c36fcb2fe6fa74fa (diff)
downloadbinaryen-e2c08d42ab0ffc05d980ae2d34fee0e77b201134.tar.gz
binaryen-e2c08d42ab0ffc05d980ae2d34fee0e77b201134.tar.bz2
binaryen-e2c08d42ab0ffc05d980ae2d34fee0e77b201134.zip
Add atomic loads and stores (#1077)
Add IR, wast and binary support for atomic loads and stores. Currently all IR generated by means other than parsing wast and binary files always generates non-atomic accesses, and optimizations have not yet been made aware of atomics, so they are certainly not ready to be used yet.
Diffstat (limited to 'src/passes/Print.cpp')
-rw-r--r--src/passes/Print.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index 0494e7d78..7ec3e98a3 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -296,7 +296,9 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
}
void visitLoad(Load *curr) {
o << '(';
- prepareColor(o) << printWasmType(curr->type) << ".load";
+ prepareColor(o) << printWasmType(curr->type);
+ if (curr->isAtomic) o << ".atomic";
+ o << ".load";
if (curr->bytes < 4 || (curr->type == i64 && curr->bytes < 8)) {
if (curr->bytes == 1) {
o << '8';
@@ -322,7 +324,9 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
}
void visitStore(Store *curr) {
o << '(';
- prepareColor(o) << printWasmType(curr->valueType) << ".store";
+ prepareColor(o) << printWasmType(curr->valueType);
+ if (curr->isAtomic) o << ".atomic";
+ o << ".store";
if (curr->bytes < 4 || (curr->valueType == i64 && curr->bytes < 8)) {
if (curr->bytes == 1) {
o << '8';