-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support 32-bit targets #43
Comments
I'm working on this. There's an issue with how sNaN is interpreted and I haven't found the cause yet |
Right, so I found the cause of the failures: when compiled for i686 (which is the 32-bit system I was using) the tests fail because the bit-level representation of floats is wrong. The IEEE754 spec allows NaNs to be quieted at basically any time but the WASM spec specifies that they may not be quietened when converting to and from i32, only when doing operations like multiplication. Unfortunely, on x87 LLVM will sometimes use the x87 float register stack to pass floats in and out of functions, using The only solution I can see for this is to internally use integers to store floats, converting them to/from floats when doing |
Another possible approach is to build i686 builds with Beyond sNaNs, x87 also rounds some arithmetic results differently, due to double rounding, and WebAssembly's testsuite is designed to detect such differences. There are techniques for adjusting the rounding, though it's simpler if you can avoid having to. |
|
If you're planning to support x87 floating-point, also be aware that x87's |
If that is the case, then there are no tests for it so far. |
|
Other implementations fail on those tests when using with x87 arithmetic. I don't know what wasmi is doing differently that allows it to pass. |
With With SSE2 disabled, via
(this is just the first difference; other tests in float_misc.wast will also round differently too). |
Guess we need to reopen then. |
I think enforcing SSE2 arithmetic is reasonable for now, but we'd probably want to emulate it down the line. Fixing floats on x87+SSE2 is a fix for the vast majority of 32-bit x86-family CPUs out there. There hasn't been an x86 CPU without SSE2 since 2001 as far as I can tell (apart from a 2013 microcontroller but I can't imagine that x86 microcontrollers are flying off the shelves) |
So, is there a way to sort this for a 32bit x86 CPU? Trying to set up on an old Acer Aspire one as only spare I can run 24/7 with Linux (Debian) on.
|
It should now work on post-2003 x86 CPUs (i.e. those with SSE2, if your CPU can build and run Rust programs with no custom configuration then this includes you). Maybe you need to run |
Can you tell me where I need to run that update command from please. I have to CD to a directory with a Cargo.toml file or it won't run - I've tried a few places (lots of Cargo.toml files) but when compiling it still says wasmi V 0.1.3 and not the latest (0.2.0). It's an intel Atom N270 cpu - supports SSE2. |
|
You've got the Cargo.lock file in /Polkadot Master that refers to wasmi v0.1.3 several times then the Cargo.toml in /Polkadot Master/Polkadot/Parachain that mentions wasmi v0.1 under dependancies... (The Cargo.toml in /Polkadot Master doesn't mention wasmi.) So edit what and run the update from where? |
I got it downloading v.0.2.0 but can't stop the thing downloading v0.1.3 as well. :/ |
OK, so I've edited all .toml and .lock files - and it looks like only wasmi v0.2.0 is going to compile - but now get this:
|
If you're playing with Polkadot, then you can easily replace this code with Eventually, we need to migrate Polkadot to wasmi 0.2.0 though. |
Meh - looks like I'll have to install a VM on my Windows 64bit desktop... |
To properly support them we need to setup CI for these targets
The text was updated successfully, but these errors were encountered: