summaryrefslogtreecommitdiff
path: root/test/wasm2js/float_misc.2asm.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/wasm2js/float_misc.2asm.js')
-rw-r--r--test/wasm2js/float_misc.2asm.js62
1 files changed, 41 insertions, 21 deletions
diff --git a/test/wasm2js/float_misc.2asm.js b/test/wasm2js/float_misc.2asm.js
index ad9c34c39..70336da90 100644
--- a/test/wasm2js/float_misc.2asm.js
+++ b/test/wasm2js/float_misc.2asm.js
@@ -1,5 +1,34 @@
-import { __tempMemory__ } from 'env';
+
+ var scratchBuffer = new ArrayBuffer(8);
+ var i32ScratchView = new Int32Array(scratchBuffer);
+ var f32ScratchView = new Float32Array(scratchBuffer);
+ var f64ScratchView = new Float64Array(scratchBuffer);
+
+ function wasm2js_scratch_load_i32(index) {
+ return i32ScratchView[index];
+ }
+
+ function wasm2js_scratch_store_i32(index, value) {
+ i32ScratchView[index] = value;
+ }
+
+ function wasm2js_scratch_load_f64() {
+ return f64ScratchView[0];
+ }
+
+ function wasm2js_scratch_store_f64(value) {
+ f64ScratchView[0] = value;
+ }
+
+ function wasm2js_scratch_load_f32() {
+ return f32ScratchView[0];
+ }
+
+ function wasm2js_scratch_store_f32(value) {
+ f32ScratchView[0] = value;
+ }
+
function asmFunc(global, env, buffer) {
"almost asm";
var HEAP8 = new global.Int8Array(buffer);
@@ -22,7 +51,6 @@ function asmFunc(global, env, buffer) {
var abort = env.abort;
var nan = global.NaN;
var infinity = global.Infinity;
- var __tempMemory__ = env.__tempMemory__ | 0;
function $0(x, y) {
x = Math_fround(x);
y = Math_fround(y);
@@ -65,7 +93,7 @@ function asmFunc(global, env, buffer) {
function $7(x, y) {
x = Math_fround(x);
y = Math_fround(y);
- return Math_fround((HEAP32[0] = (HEAPF32[0] = x, HEAP32[0] | 0) & 2147483647 | 0 | ((HEAPF32[0] = y, HEAP32[0] | 0) & 2147483648 | 0) | 0, HEAPF32[0]));
+ return Math_fround((wasm2js_scratch_store_i32(0, (wasm2js_scratch_store_f32(x), wasm2js_scratch_load_i32(0)) & 2147483647 | 0 | ((wasm2js_scratch_store_f32(y), wasm2js_scratch_load_i32(0)) & 2147483648 | 0) | 0), wasm2js_scratch_load_f32()));
}
function $8(x) {
@@ -142,22 +170,18 @@ function asmFunc(global, env, buffer) {
function $21(x, y) {
x = +x;
y = +y;
- var i64toi32_i32$0 = 0, i64toi32_i32$2 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $4_1 = 0, $4$hi = 0, $7_1 = 0, $7$hi = 0, wasm2js_i32$0 = 0, wasm2js_f64$0 = 0.0, wasm2js_i32$1 = 0;
- wasm2js_i32$0 = __tempMemory__;
- wasm2js_f64$0 = x;
- HEAPF64[wasm2js_i32$0 >> 3] = wasm2js_f64$0;
- i64toi32_i32$0 = HEAP32[(__tempMemory__ + 4 | 0) >> 2] | 0;
- i64toi32_i32$2 = HEAP32[__tempMemory__ >> 2] | 0;
+ var i64toi32_i32$0 = 0, i64toi32_i32$2 = 0, i64toi32_i32$1 = 0, i64toi32_i32$3 = 0, $4_1 = 0, $4$hi = 0, $7_1 = 0, $7$hi = 0;
+ wasm2js_scratch_store_f64(+x);
+ i64toi32_i32$0 = wasm2js_scratch_load_i32(1 | 0) | 0;
+ i64toi32_i32$2 = wasm2js_scratch_load_i32(0 | 0) | 0;
i64toi32_i32$1 = 2147483647;
i64toi32_i32$3 = 4294967295;
i64toi32_i32$1 = i64toi32_i32$0 & i64toi32_i32$1 | 0;
$4_1 = i64toi32_i32$2 & i64toi32_i32$3 | 0;
$4$hi = i64toi32_i32$1;
- wasm2js_i32$0 = __tempMemory__;
- wasm2js_f64$0 = y;
- HEAPF64[wasm2js_i32$0 >> 3] = wasm2js_f64$0;
- i64toi32_i32$1 = HEAP32[(__tempMemory__ + 4 | 0) >> 2] | 0;
- i64toi32_i32$0 = HEAP32[__tempMemory__ >> 2] | 0;
+ wasm2js_scratch_store_f64(+y);
+ i64toi32_i32$1 = wasm2js_scratch_load_i32(1 | 0) | 0;
+ i64toi32_i32$0 = wasm2js_scratch_load_i32(0 | 0) | 0;
i64toi32_i32$2 = 2147483648;
i64toi32_i32$3 = 0;
i64toi32_i32$2 = i64toi32_i32$1 & i64toi32_i32$2 | 0;
@@ -168,13 +192,9 @@ function asmFunc(global, env, buffer) {
i64toi32_i32$0 = $7$hi;
i64toi32_i32$3 = $7_1;
i64toi32_i32$0 = i64toi32_i32$2 | i64toi32_i32$0 | 0;
- wasm2js_i32$0 = __tempMemory__;
- wasm2js_i32$1 = i64toi32_i32$1 | i64toi32_i32$3 | 0;
- HEAP32[wasm2js_i32$0 >> 2] = wasm2js_i32$1;
- wasm2js_i32$0 = __tempMemory__;
- wasm2js_i32$1 = i64toi32_i32$0;
- HEAP32[(wasm2js_i32$0 + 4 | 0) >> 2] = wasm2js_i32$1;
- return +(+HEAPF64[__tempMemory__ >> 3]);
+ wasm2js_scratch_store_i32(0 | 0, i64toi32_i32$1 | i64toi32_i32$3 | 0 | 0);
+ wasm2js_scratch_store_i32(1 | 0, i64toi32_i32$0 | 0);
+ return +(+wasm2js_scratch_load_f64());
}
function $22(x) {