1 #define MLton_Platform_Arch_host "arm"
3 /* Work around broken rounding mode control on ARM
5 * ARM CPUs can be running with either hardware or software.
6 * Neither support rounding modes with fe{get,set}round.
7 * Rounding direction is part of the instruction format.
9 * Unfortunately, due to vendor stupidity, every OS deals
10 * with this differently:
11 * Some pretend to support it and ignore calls.
12 * Some throw an error even for the supported mode (TO_NEAREST).
13 * All of them define all of the TO_* macros in defiance of the standard.
14 * ... basically, the system libraries are useless.
16 * The solution for MLton: replace fe{get,set}round with our own honest
17 * versions which accept TO_NEAREST and fail for other values.
22 #define fegetround MLton_fegetround
23 #define fesetround MLton_fesetround
25 static inline int fegetround(void) {
29 static inline int fesetround(int rounding_mode
) {
30 return (rounding_mode
==FE_TONEAREST
)?0:1;