summaryrefslogtreecommitdiff
path: root/test/wasm2js/f32.2asm.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/wasm2js/f32.2asm.js')
-rw-r--r--test/wasm2js/f32.2asm.js24
1 files changed, 23 insertions, 1 deletions
diff --git a/test/wasm2js/f32.2asm.js b/test/wasm2js/f32.2asm.js
index 96d10e660..cd53439c3 100644
--- a/test/wasm2js/f32.2asm.js
+++ b/test/wasm2js/f32.2asm.js
@@ -1,4 +1,26 @@
+
+ var scratchBuffer = new ArrayBuffer(8);
+ var i32ScratchView = new Int32Array(scratchBuffer);
+ var f32ScratchView = new Float32Array(scratchBuffer);
+ var f64ScratchView = new Float64Array(scratchBuffer);
+
+ function wasm2js_scratch_store_i32(index, value) {
+ i32ScratchView[index] = value;
+ }
+
+ function wasm2js_scratch_load_f32() {
+ return f32ScratchView[0];
+ }
+
+ function wasm2js_scratch_store_f32(value) {
+ f32ScratchView[0] = value;
+ }
+
+ function wasm2js_scratch_load_i32(index) {
+ return i32ScratchView[index];
+ }
+
function asmFunc(global, env, buffer) {
"almost asm";
var HEAP8 = new global.Int8Array(buffer);
@@ -95,7 +117,7 @@ function asmFunc(global, env, buffer) {
function $13(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 legalstub$0($0_1, $1_1) {