diff options
author | Simi Pallipurath <simi.pallipurath@arm.com> | 2023-07-13 14:32:05 +0100 |
---|---|---|
committer | Simi Pallipurath <simi.pallipurath@arm.com> | 2023-07-17 12:27:32 +0100 |
commit | 6f4f1023fafec4a470d8b7e8ea884c1953fe5291 (patch) | |
tree | 5fd45324f1b5794dd607353ddb90d9e398516d79 /compiler-rt | |
parent | 83f3920854661e1b52e0ee7e290aea0fe2fbfded (diff) | |
download | llvm-6f4f1023fafec4a470d8b7e8ea884c1953fe5291.zip llvm-6f4f1023fafec4a470d8b7e8ea884c1953fe5291.tar.gz llvm-6f4f1023fafec4a470d8b7e8ea884c1953fe5291.tar.bz2 |
[compiler-rt] [Arm] Make the tests for the runtime functions __aeabi_c{d,f} work on Big-Endian.
We are trying to build the compiler-rt as big-endian. And found that the tests compiler-rt/test/builtins/Unit/arm/aeabi_cdcmpeq_test.c and compiler-rt/test/builtins/Unit/arm/aeabi_cfcmpeq_test.c do not work on big endian at the moment. This patch makes these tests work on big endian as well.
Reviewed By: peter.smith, simon_tatham
Differential Revision: https://reviews.llvm.org/D155208
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/lib/builtins/arm/aeabi_cdcmp.S | 4 | ||||
-rw-r--r-- | compiler-rt/lib/builtins/arm/aeabi_cfcmp.S | 4 | ||||
-rw-r--r-- | compiler-rt/test/builtins/Unit/arm/call_apsr.h | 35 |
3 files changed, 24 insertions, 19 deletions
diff --git a/compiler-rt/lib/builtins/arm/aeabi_cdcmp.S b/compiler-rt/lib/builtins/arm/aeabi_cdcmp.S index bd039a0..c7abdb0 100644 --- 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 index a26cb2a..81c4766 100644 --- 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 index 87a7a74..09de115 100644 --- 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; |