Add documentation about x86 and floating-point operations (#3228)

If JerrScript is compiled for x86 then it is possible that the
floating-point operations are not correct for the JS standard.

To "fix" this the users should be advised to use at least SSE2
during build for this platform.

JerryScript-DCO-1.0-Signed-off-by: Dániel Vince vinced@inf.u-szeged.hu
This commit is contained in:
Daniel Vince 2019-10-21 11:10:09 +02:00 committed by Dániel Bátyai
parent d85988af96
commit 6a2767a09a

View File

@ -302,3 +302,21 @@ $ gcc -Wall -o demo_app demo_app.c gen_src/jerryscript.c gen_src/jerryscript-por
Please note that the headers must be available on the include path.
In addition there is a `-DENABLE_ALL_IN_ONE_SOURCE=ON` CMake option to use this kind of sources during the build.
# Target specific information
## x86 with GCC
When building for Intel 32 bit architecture it is possible that GCC uses conservative options, thus assuming the most
basic floating-point support (that is it does not generate SSE or others instructions).
However this could lead to loss off precision and/or different results than what is required by the JavaScript standard
in regards of floating-point values and arithmetic.
To resolve this precision problem it is advised to use at least SSE2.
To do this with GCC please provide the `-mfpmath=sse -msse2` options during build.
These options can also be specified via the `build.py` script:
```sh
$ ./tools/build.py --compile-flag=-mfpmath=sse --compile-flag=-msse2 --compile-flag=-m32
```