lucet icon indicating copy to clipboard operation
lucet copied to clipboard

[WIP] Lucet i686 (32-bit x86) support... ish

Open iximeow opened this issue 4 years ago • 2 comments

First, why i686? i386 has, at best, the x87 FPU for floating point operations. I'm pretty sure i686 implies processors recent enough to have MMX/SSE, so our floating point stuff needs fewer changes.

The ABI details of lining things up for guest execution are certainly incorrect. The primary issue at this point is our dependencies though, object believes it can't target I686 and Cranelift is missing some legalizations such as 64-bit divides.

For object, my suspicion is that just adding a few I686 matches to patterns where it matches for I386 should be fine. I've yet to test that though :)

With object not being able to emit i686 objects this hasn't gotten to a point where anything, yknow, runs. :grin:

While this is a relatively unserious PR, this is about the same shape I suspect other architectures for POSIX-y OSes would look, so replace i686 with arm32 or aarch64 in your imagination!

iximeow avatar Apr 27 '20 15:04 iximeow

Just as a heads up, x87 floating point does not produce the same results as other platforms including SSE in various cases, and the spec testsuite has tests which care about these differences: https://github.com/WebAssembly/spec/issues/124

sunfishcode avatar Apr 27 '20 15:04 sunfishcode

This PR was closed as a byproduct of deleting the branch named master. If this is still an active PR, re-open as a new PR against main.

pchickey avatar Jun 26 '20 00:06 pchickey