diff --git a/compiler-rt/lib/builtins/aarch64/fp_mode.c b/compiler-rt/lib/builtins/aarch64/fp_mode.c --- a/compiler-rt/lib/builtins/aarch64/fp_mode.c +++ b/compiler-rt/lib/builtins/aarch64/fp_mode.c @@ -23,24 +23,24 @@ #ifndef __ARM_FP // For soft float targets, allow changing rounding mode by overriding the weak // __aarch64_fe_default_rmode symbol. -FE_ROUND_MODE __attribute__((weak)) __aarch64_fe_default_rmode = FE_TONEAREST; +FE_ROUND_MODE __attribute__((weak)) __aarch64_fe_default_rmode = CRT_FE_TONEAREST; #endif -FE_ROUND_MODE __fe_getround() { +CRT_FE_ROUND_MODE __fe_getround() { #ifdef __ARM_FP uint64_t fpcr; __asm__ __volatile__("mrs %0, fpcr" : "=r" (fpcr)); fpcr = fpcr >> AARCH64_RMODE_SHIFT & AARCH64_RMODE_MASK; switch (fpcr) { case AARCH64_UPWARD: - return FE_UPWARD; + return CRT_FE_UPWARD; case AARCH64_DOWNWARD: - return FE_DOWNWARD; + return CRT_FE_DOWNWARD; case AARCH64_TOWARDZERO: - return FE_TOWARDZERO; + return CRT_FE_TOWARDZERO; case AARCH64_TONEAREST: default: - return FE_TONEAREST; + return CRT_FE_TONEAREST; } #else return __aarch64_fe_default_rmode; diff --git a/compiler-rt/lib/builtins/arm/fp_mode.c b/compiler-rt/lib/builtins/arm/fp_mode.c --- a/compiler-rt/lib/builtins/arm/fp_mode.c +++ b/compiler-rt/lib/builtins/arm/fp_mode.c @@ -23,24 +23,24 @@ #ifndef __ARM_FP // For soft float targets, allow changing rounding mode by overriding the weak // __arm_fe_default_rmode symbol. -FE_ROUND_MODE __attribute__((weak)) __arm_fe_default_rmode = FE_TONEAREST; +CRT_FE_ROUND_MODE __attribute__((weak)) __arm_fe_default_rmode = CRT_FE_TONEAREST; #endif -FE_ROUND_MODE __fe_getround() { +CRT_FE_ROUND_MODE __fe_getround() { #ifdef __ARM_FP uint32_t fpscr; __asm__ __volatile__("vmrs %0, fpscr" : "=r" (fpscr)); fpscr = fpscr >> ARM_RMODE_SHIFT & ARM_RMODE_MASK; switch (fpscr) { case ARM_UPWARD: - return FE_UPWARD; + return CRT_FE_UPWARD; case ARM_DOWNWARD: - return FE_DOWNWARD; + return CRT_FE_DOWNWARD; case ARM_TOWARDZERO: - return FE_TOWARDZERO; + return CRT_FE_TOWARDZERO; case ARM_TONEAREST: default: - return FE_TONEAREST; + return CRT_FE_TONEAREST; } #else return __arm_fe_default_rmode; diff --git a/compiler-rt/lib/builtins/fp_add_impl.inc b/compiler-rt/lib/builtins/fp_add_impl.inc --- a/compiler-rt/lib/builtins/fp_add_impl.inc +++ b/compiler-rt/lib/builtins/fp_add_impl.inc @@ -151,19 +151,19 @@ // Perform the final rounding. The result may overflow to infinity, but // that is the correct result in that case. switch (__fe_getround()) { - case FE_TONEAREST: + case CRT_FE_TONEAREST: if (roundGuardSticky > 0x4) result++; if (roundGuardSticky == 0x4) result += result & 1; break; - case FE_DOWNWARD: + case CRT_FE_DOWNWARD: if (resultSign && roundGuardSticky) result++; break; - case FE_UPWARD: + case CRT_FE_UPWARD: if (!resultSign && roundGuardSticky) result++; break; - case FE_TOWARDZERO: + case CRT_FE_TOWARDZERO: break; } if (roundGuardSticky) diff --git a/compiler-rt/lib/builtins/fp_mode.h b/compiler-rt/lib/builtins/fp_mode.h --- a/compiler-rt/lib/builtins/fp_mode.h +++ b/compiler-rt/lib/builtins/fp_mode.h @@ -17,13 +17,13 @@ #define FP_MODE typedef enum { - FE_TONEAREST, - FE_DOWNWARD, - FE_UPWARD, - FE_TOWARDZERO -} FE_ROUND_MODE; + CRT_FE_TONEAREST, + CRT_FE_DOWNWARD, + CRT_FE_UPWARD, + CRT_FE_TOWARDZERO +} CRT_FE_ROUND_MODE; -FE_ROUND_MODE __fe_getround(void); +CRT_FE_ROUND_MODE __fe_getround(void); int __fe_raise_inexact(void); #endif // FP_MODE_H diff --git a/compiler-rt/lib/builtins/fp_mode.c b/compiler-rt/lib/builtins/fp_mode.c --- a/compiler-rt/lib/builtins/fp_mode.c +++ b/compiler-rt/lib/builtins/fp_mode.c @@ -15,8 +15,8 @@ #include "fp_mode.h" // IEEE-754 default rounding (to nearest, ties to even). -FE_ROUND_MODE __fe_getround() { - return FE_TONEAREST; +CRT_FE_ROUND_MODE __fe_getround() { + return CRT_FE_TONEAREST; } int __fe_raise_inexact() { diff --git a/compiler-rt/lib/builtins/i386/fp_mode.c b/compiler-rt/lib/builtins/i386/fp_mode.c --- a/compiler-rt/lib/builtins/i386/fp_mode.c +++ b/compiler-rt/lib/builtins/i386/fp_mode.c @@ -14,22 +14,22 @@ #define X87_TOWARDZERO 0x0c00 #define X87_RMODE_MASK (X87_TONEAREST | X87_UPWARD | X87_DOWNWARD | X87_TOWARDZERO) -FE_ROUND_MODE __fe_getround() { +CRT_FE_ROUND_MODE __fe_getround() { // Assume that the rounding mode state for the fpu agrees with the SSE unit. unsigned short cw; __asm__ __volatile__ ("fnstcw %0" : "=m" (cw)); switch (cw & X87_RMODE_MASK) { case X87_TONEAREST: - return FE_TONEAREST; + return CRT_FE_TONEAREST; case X87_DOWNWARD: - return FE_DOWNWARD; + return CRT_FE_DOWNWARD; case X87_UPWARD: - return FE_UPWARD; + return CRT_FE_UPWARD; case X87_TOWARDZERO: - return FE_TOWARDZERO; + return CRT_FE_TOWARDZERO; } - return FE_TONEAREST; + return CRT_FE_TONEAREST; } int __fe_raise_inexact() {