summaryrefslogtreecommitdiff
path: root/src/passes/LegalizeJSInterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/LegalizeJSInterface.cpp')
-rw-r--r--src/passes/LegalizeJSInterface.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/passes/LegalizeJSInterface.cpp b/src/passes/LegalizeJSInterface.cpp
index 6002c7ad7..cde4373f8 100644
--- a/src/passes/LegalizeJSInterface.cpp
+++ b/src/passes/LegalizeJSInterface.cpp
@@ -29,9 +29,6 @@
// across modules, we still want to legalize dynCalls so JS can call into the
// table even to a signature that is not legal.
//
-// This pass also legalizes according to asm.js FFI rules, which
-// disallow f32s. TODO: an option to not do that, if it matters?
-//
#include <utility>
#include "wasm.h"
@@ -124,9 +121,9 @@ private:
template<typename T>
bool isIllegal(T* t) {
for (auto param : t->params) {
- if (param == i64 || param == f32) return true;
+ if (param == i64) return true;
}
- return t->result == i64 || t->result == f32;
+ return t->result == i64;
}
// Check if an export should be legalized.
@@ -158,9 +155,6 @@ private:
call->operands.push_back(I64Utilities::recreateI64(builder, legal->params.size(), legal->params.size() + 1));
legal->params.push_back(i32);
legal->params.push_back(i32);
- } else if (param == f32) {
- call->operands.push_back(builder.makeUnary(DemoteFloat64, builder.makeGetLocal(legal->params.size(), f64)));
- legal->params.push_back(f64);
} else {
call->operands.push_back(builder.makeGetLocal(legal->params.size(), param));
legal->params.push_back(param);
@@ -177,9 +171,6 @@ private:
block->list.push_back(I64Utilities::getI64Low(builder, index));
block->finalize();
legal->body = block;
- } else if (func->result == f32) {
- legal->result = f64;
- legal->body = builder.makeUnary(PromoteFloat32, call);
} else {
legal->result = func->result;
legal->body = call;
@@ -216,9 +207,6 @@ private:
call->operands.push_back(I64Utilities::getI64High(builder, func->params.size()));
type->params.push_back(i32);
type->params.push_back(i32);
- } else if (param == f32) {
- call->operands.push_back(builder.makeUnary(PromoteFloat32, builder.makeGetLocal(func->params.size(), f32)));
- type->params.push_back(f64);
} else {
call->operands.push_back(builder.makeGetLocal(func->params.size(), param));
type->params.push_back(param);
@@ -232,10 +220,6 @@ private:
Expression* get = builder.makeCall(f->name, {}, call->type);
func->body = I64Utilities::recreateI64(builder, call, get);
type->result = i32;
- } else if (imFunctionType->result == f32) {
- call->type = f64;
- func->body = builder.makeUnary(DemoteFloat64, call);
- type->result = f64;
} else {
call->type = imFunctionType->result;
func->body = call;