Hi Pierrick, thanks for your review.

> Excellent, thanks for adding this.
>
> Out of curiosity, and out of the scope of this PR, would that be
> possible to make a "universal" build, which can selectively select the
> appropriate wasm64 support at runtime, so a single build works on all
> browsers out of the box?

I haven't found an Emscripten feature for the universal build but a possible
approach would be to compile both variants (-sMEMORY64=1 and 2) and provide
a wrapper JS script that selects one at runtime depending on the engine's
pointer size. If the user can accept the 4GB memory size limit, -sMEMORY64=2
can be used as a universal binary as it runs on wasm32 engines.

> As well, what are the limitations of -sMEMORY64 regarding limited
> address space? Is it just the maximum size of memory a guest can have,
> or does it limit the VA that can be accessed also?

-sMEMORY64=2 limits the maximum memory size a guest can use but still
enables 64bit pointers so TCI is compiled with TCG_TARGET_REG_BITS=64
without restricting the guest's virtual address space.

Regards,
Kohei

Reply via email to