I recently ran into a problem with a third-party library that used the following code to test mixed floating point format on ARM platforms:
#if defined(__arm__) && !(__ARM_EABI__)
This check incorrectly detected mixed text format on Android platforms, but worked correctly on iOS platforms. After some research, I found that contains the following in the GCC preprocessor macros for the floating point section that says (highlighted by me):
When porting code to "armel", the following preprocessor macros are interesting:
__ VFP_FP__ means that the floating point format used is the ARM VFP block format, which is IEEE-754 based on native-end.
__ MAVERICK__ means that the floating point format is the Cirrus Logic MaverickCrunch format, which is also IEEE-754 and always low-endian.
__ SOFTFP__ means that instead of floating point instructions, library calls for mathematical operations with floating point are generated so that the code runs on a processor without FPU.
__ VFP_FP__ and __MAVERICK__ are mutually exclusive. If none of them are installed, this means that the floating point format used is the old mixed content of the FPA block format 45670123.
In our particular case, the verification update is performed as follows:
#if defined(__arm__) && !(__VFP_FP__)
and works on Android and iOS platforms. Although from the document a more correct check would be:
#if defined(__arm__) && !(__VFP_FP__) && !(__MAVERICK__)
We would like to send the patch to a third-party, but, given that the old check really worked for the person who presented it, and how difficult it is to find the documentation, I donβt feel that I have enough information to get this correct one.
Are there any cases of the last miss check? The debian document specifically describes gcc , how portable are these macros?
Refresh
Based on helpful comments from artless noise, the question boils down to the following:
Checking the macro __ARM_EABI__ was introduced as a patch by another user to check the mixed-point floating point format. Thus, it is obvious that there are systems for which this macro works, what systems exist? Will the __VFP_FP__ macro span these systems, or do I need to consider this macro to prevent existing users from breaking when sending the patch.