Use -mfpu=vfpv3 instead of -march=native for cross compilation sdks.#1192
Use -mfpu=vfpv3 instead of -march=native for cross compilation sdks.#1192kripken merged 1 commit intoWebAssembly:masterfrom
Conversation
|
Hm, I actually don't think we should automatically have |
|
(We could replace it with something like |
|
Sure, that works. Done. |
CMakeLists.txt
Outdated
| @@ -143,7 +143,7 @@ ELSE() | |||
| ADD_COMPILE_FLAG("-mfpmath=sse") | |||
| elseif(TARGET_ARCH STREQUAL "ARM") | |||
| # stub for ARM-specific instructions. GCC6 adds NEON with the below flags | |||
There was a problem hiding this comment.
Could we just remove this comment altogether now?
|
Just the one nit, and then LGTM. @kripken do you have any objections or better ideas? |
|
Looks ok to me (but not my area of expertise). |
|
Does -mfpu=neon affect the handling of subnormals in the implementation of floating-point operators? |
|
What I wanted from this particular change was to go from an essentially nondeterministic build (i.e. it depends on whatever the host machine has) to something that's at least reproduceable. If I remember correctly, ARMv7+NEON always uses FTZ for vectors, but I'm not sure about scalars, presumably it's the same. So it may not be compliant with wasm in that respect. I think vfpv4 would probably work. It would rule out Cortex-A9-class hardware which IIRC is very common, but realistically, because of the zoo of configurations, anyone doing an ARM build probably has to have a particular set of configurations in mind, and at least I don't have one. Perhaps @flackr or whoever added this code does? |
|
actually vfpv3 supports denormals too, and it looks like vfpv4 just adds half-precision and FMA. It looks like if you use So yeah in summary, let's make this |
|
May I ask whether this has been merged? FreeBSD/aarch64 hit this issue, and the relevant bug report is https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=225600 . So, this would most probably solve the current issue with the FreeBSD port. |
|
Apologies for the delay - I didn't notice we had arrived at a resolution. I've adopted the suggested flag and dropped the comment. In my case I'm targeting a raspberry pi, building using a cross compilation sdk from a high end x86_64 desktop. |
|
@gczuczy, aarch64 doesn't support any |
|
Done. |
|
Thanks! |
Some compiler environments (e.g. cross compilation sdk) do not support -march=native so we should test for support before adding the flag.