Skip to content

Commit 6edf480

Browse files
WizardOfArckripken
authored andcommitted
add FAQ regarding int64s in JS (emscripten-core#7224) [ci skip]
1 parent bfcdf5b commit 6edf480

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • site/source/docs/getting_started

site/source/docs/getting_started/FAQ.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,13 @@ To check if this is the issue you are seeing, build with ``-s PRECISE_F32=1``. T
473473

474474
(This is not an issue for wasm, which has native float types.)
475475

476+
477+
How do I pass int64_t and uint64_t values from js into wasm functions?
478+
======================================================================
479+
480+
JS can't represent int64s, so what happens is that in exported functions (that you can call from JS) we "legalize" the types, by turning an i64 argument into two i32s (low and high bits), and an i64 return value becomes an i32, and you can access the high bits by calling a helper function called getTempRet0.
481+
482+
476483
Can I use multiple Emscripten-compiled programs on one Web page?
477484
================================================================
478485

0 commit comments

Comments
 (0)