Closed NicoPy closed 4 years ago
I have understood how the FPU configuration works (for ARM architecture). Here it is for reference.
cortexm.py is used to configure the runtime sources/configuration :
_hasfpu() property must always be set to True else the runtime does not compile.
To use software floating point calculations, _has_single_precisionfpu() and _has_double_precisionfpu() properties must return False. You also have to set -msoft-float switch in _compilerswitches().
To use hardware floating point calculations, _has_single_precisionfpu() or _has_double_precisionfpu() or both must return True. You also have to set -mfpu=xxx switch to the correct value in _compilerswitches().
In _s-bbparaxxxx.ads_ the constant _HasFPU is indirectly related to the runtime configuration. When _HasFPU is True, the floating point context is saved/restored in _Pend_SVHandler() (_s-bcpcstpendsv.adb_).
To be more complete : | _has_double_precisionfpu() | _has_single_precisionfpu() | --> | compiler switch | _HasFPU | |
---|---|---|---|---|---|---|
False | False | --> | soft float | -msoft-float | False | |
False | True | --> | single precision : hard double precision : soft |
-mfpu=xxx | True | |
True | False | --> | single precision : soft double precision : hard |
-mfpu=xxx | True | |
True | True | --> | single precision : hard double precision : hard |
-mfpu=xxx | True |
Hi @NicoPy, I am glad you found the answer :)
Hi,
To do some tests, I need to compile the runtime (ravenscar full) with soft Float instead of hard Float. Here is what I did :
Setting _HasFPU to False makes the runtime compilation fail :
This error is not a surprise since I instructed the compiler to not use hard float instructions (-msoft-float switch).
However, setting _HasFPU to False makes the runtime compilation fail :
When I fix this error by manually disabling Streams, the same error rises again somewhere else.
How can I fix this problem ?