diff --git a/compiler-rt/lib/builtins/arm/aeabi_cdcmp.S b/compiler-rt/lib/builtins/arm/aeabi_cdcmp.S --- a/compiler-rt/lib/builtins/arm/aeabi_cdcmp.S +++ b/compiler-rt/lib/builtins/arm/aeabi_cdcmp.S @@ -8,10 +8,6 @@ #include "../assembly.h" -#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ -#error big endian support not implemented -#endif - #define APSR_Z (1 << 30) #define APSR_C (1 << 29) diff --git a/compiler-rt/lib/builtins/arm/aeabi_cfcmp.S b/compiler-rt/lib/builtins/arm/aeabi_cfcmp.S --- a/compiler-rt/lib/builtins/arm/aeabi_cfcmp.S +++ b/compiler-rt/lib/builtins/arm/aeabi_cfcmp.S @@ -8,10 +8,6 @@ #include "../assembly.h" -#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ -#error big endian support not implemented -#endif - #define APSR_Z (1 << 30) #define APSR_C (1 << 29) diff --git a/compiler-rt/test/builtins/Unit/arm/call_apsr.h b/compiler-rt/test/builtins/Unit/arm/call_apsr.h --- a/compiler-rt/test/builtins/Unit/arm/call_apsr.h +++ b/compiler-rt/test/builtins/Unit/arm/call_apsr.h @@ -1,21 +1,34 @@ #ifndef CALL_APSR_H #define CALL_APSR_H -#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ -#error big endian support not implemented -#endif +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ union cpsr { - struct { - uint32_t filler: 28; - uint32_t v: 1; - uint32_t c: 1; - uint32_t z: 1; - uint32_t n: 1; - } flags; - uint32_t value; + struct { + uint32_t filler : 28; + uint32_t v : 1; + uint32_t c : 1; + uint32_t z : 1; + uint32_t n : 1; + } flags; + uint32_t value; }; +#else + +union cpsr { + struct { + uint32_t n : 1; + uint32_t z : 1; + uint32_t c : 1; + uint32_t v : 1; + uint32_t filler : 28; + } flags; + uint32_t value; +}; + +#endif + __attribute__((noinline, pcs("aapcs"))) static uint32_t call_apsr_f(float a, float b, __attribute__((pcs("aapcs"))) void (*fn)(float, float)) { uint32_t result;