summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/asm2wasm.h4
-rw-r--r--src/wasm-js.cpp4
-rw-r--r--src/wasm-s-parser.h2
-rw-r--r--src/wasm.h6
4 files changed, 4 insertions, 12 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h
index 4d12a66f1..e9b0ce2c6 100644
--- a/src/asm2wasm.h
+++ b/src/asm2wasm.h
@@ -602,7 +602,6 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
MappedGlobal global = mappedGlobals[name];
auto ret = allocator.alloc<Store>();
ret->bytes = getWasmTypeSize(global.type);
- ret->float_ = isWasmTypeFloat(global.type);
ret->offset = 0;
ret->align = ret->bytes;
auto ptr = allocator.alloc<Const>();
@@ -620,7 +619,6 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
View& view = views[heap];
auto ret = allocator.alloc<Store>();
ret->bytes = view.bytes;
- ret->float_ = !view.integer;
ret->offset = 0;
ret->align = view.bytes;
ret->ptr = processUnshifted(target[2], view.bytes);
@@ -681,7 +679,6 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
auto ret = allocator.alloc<Load>();
ret->bytes = getWasmTypeSize(global.type);
ret->signed_ = true; // but doesn't matter
- ret->float_ = isWasmTypeFloat(global.type);
ret->offset = 0;
ret->align = ret->bytes;
auto ptr = allocator.alloc<Const>();
@@ -699,7 +696,6 @@ Function* Asm2WasmBuilder::processFunction(Ref ast) {
auto ret = allocator.alloc<Load>();
ret->bytes = view.bytes;
ret->signed_ = view.signed_;
- ret->float_ = !view.integer;
ret->offset = 0;
ret->align = view.bytes;
ret->ptr = processUnshifted(ast[2], view.bytes);
diff --git a/src/wasm-js.cpp b/src/wasm-js.cpp
index 4d0914f32..7eda4d10a 100644
--- a/src/wasm-js.cpp
+++ b/src/wasm-js.cpp
@@ -120,7 +120,7 @@ extern "C" void EMSCRIPTEN_KEEPALIVE load_asm(char *input) {
Literal load(Load* load, Literal ptr) override {
size_t addr = ptr.geti32();
assert(load->align == load->bytes);
- if (!load->float_) {
+ if (!isWasmTypeFloat(load->type)) {
if (load->bytes == 1) {
if (load->signed_) {
return Literal(EM_ASM_INT({ return Module['info'].parent['HEAP8'][$0] }, addr));
@@ -154,7 +154,7 @@ extern "C" void EMSCRIPTEN_KEEPALIVE load_asm(char *input) {
void store(Store* store, Literal ptr, Literal value) override {
size_t addr = ptr.geti32();
assert(store->align == store->bytes);
- if (!store->float_) {
+ if (!isWasmTypeFloat(store->type)) {
if (store->bytes == 1) {
EM_ASM_INT({ Module['info'].parent['HEAP8'][$0] = $1 }, addr, value.geti32());
} else if (store->bytes == 2) {
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h
index c53e4dbed..390776a55 100644
--- a/src/wasm-s-parser.h
+++ b/src/wasm-s-parser.h
@@ -445,7 +445,6 @@ private:
const char *extra = strchr(s[0]->c_str(), '.') + 5; // after "type.load"
auto ret = allocator.alloc<Load>();
ret->type = type;
- ret->float_ = isWasmTypeFloat(type);
ret->bytes = getWasmTypeSize(type);
if (extra[0] == '8') {
ret->bytes = 1;
@@ -475,7 +474,6 @@ private:
const char *extra = strchr(s[0]->c_str(), '.') + 6; // after "type.store"
auto ret = allocator.alloc<Store>();
ret->type = type;
- ret->float_ = isWasmTypeFloat(type);
ret->bytes = getWasmTypeSize(type);
if (extra[0] == '8') {
ret->bytes = 1;
diff --git a/src/wasm.h b/src/wasm.h
index 7c9e2a6c0..448e4e71b 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -489,14 +489,13 @@ public:
unsigned bytes;
bool signed_;
- bool float_; // XXX remove?
int offset;
unsigned align;
Expression *ptr;
std::ostream& doPrint(std::ostream &o, unsigned indent) {
o << '(';
- prepareColor(o) << printWasmType(getWasmType(bytes, float_)) << ".load";
+ prepareColor(o) << printWasmType(type) << ".load";
if (bytes < 4) {
if (bytes == 1) {
o << '8';
@@ -521,14 +520,13 @@ public:
Store() : Expression(StoreId) {}
unsigned bytes;
- bool float_;
int offset;
unsigned align;
Expression *ptr, *value;
std::ostream& doPrint(std::ostream &o, unsigned indent) {
o << '(';
- prepareColor(o) << printWasmType(getWasmType(bytes, float_)) << ".store";
+ prepareColor(o) << printWasmType(type) << ".store";
if (bytes < 4) {
if (bytes == 1) {
o << '8';