diff options
| author | Oliver Stannard <oliver.stannard@arm.com> | 2014-09-29 10:23:20 +0000 |
|---|---|---|
| committer | Oliver Stannard <oliver.stannard@arm.com> | 2014-09-29 10:23:20 +0000 |
| commit | 609e2e6a6e001bcbe3da469a0c117fa570ca71aa (patch) | |
| tree | 5b7cee154cc654f932f325f7b46845e4326f301d /compiler-rt/lib/builtins | |
| parent | 6cbf43167bf33689e8b02920cde6758f8dba8d8d (diff) | |
| download | bcm5719-llvm-609e2e6a6e001bcbe3da469a0c117fa570ca71aa.tar.gz bcm5719-llvm-609e2e6a6e001bcbe3da469a0c117fa570ca71aa.zip | |
[compiler-rt] Do not use ldrexd or strexd on v7M
The ldrexd and strexd instructions are undefined for the ARMv7M
architecture, so we cannot use them to implement the
__sync_fetch_and_*_8 builtins. There is no other way to implement
these without OS support, so this patch #ifdef's these functions out
for M-class architectures.
There are no tests as I cannot find any existing tests for these
builtins.
I used the __ARM_ARCH_PROFILE predefine because __ARM_FEATURE_LDREX is
deprecated and not set by clang.
llvm-svn: 218601
Diffstat (limited to 'compiler-rt/lib/builtins')
10 files changed, 20 insertions, 0 deletions
diff --git a/compiler-rt/lib/builtins/arm/sync_fetch_and_add_8.S b/compiler-rt/lib/builtins/arm/sync_fetch_and_add_8.S index db59e055e7e..5724bb148ba 100644 --- a/compiler-rt/lib/builtins/arm/sync_fetch_and_add_8.S +++ b/compiler-rt/lib/builtins/arm/sync_fetch_and_add_8.S @@ -14,9 +14,11 @@ #include "sync-ops.h" +#if __ARM_ARCH_PROFILE != 'M' #define add_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) \ adds rD_LO, rN_LO, rM_LO ; \ adc rD_HI, rN_HI, rM_HI SYNC_OP_8(add_8) +#endif diff --git a/compiler-rt/lib/builtins/arm/sync_fetch_and_and_8.S b/compiler-rt/lib/builtins/arm/sync_fetch_and_and_8.S index 845c74f35f7..a74163a8600 100644 --- a/compiler-rt/lib/builtins/arm/sync_fetch_and_and_8.S +++ b/compiler-rt/lib/builtins/arm/sync_fetch_and_and_8.S @@ -14,8 +14,10 @@ #include "sync-ops.h" +#if __ARM_ARCH_PROFILE != 'M' #define and_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) \ and rD_LO, rN_LO, rM_LO ; \ and rD_HI, rN_HI, rM_HI SYNC_OP_8(and_8) +#endif diff --git a/compiler-rt/lib/builtins/arm/sync_fetch_and_max_8.S b/compiler-rt/lib/builtins/arm/sync_fetch_and_max_8.S index 12dd46cc9bc..1eef2b22366 100644 --- a/compiler-rt/lib/builtins/arm/sync_fetch_and_max_8.S +++ b/compiler-rt/lib/builtins/arm/sync_fetch_and_max_8.S @@ -14,6 +14,8 @@ #include "sync-ops.h" +#if __ARM_ARCH_PROFILE != 'M' #define max_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) MINMAX_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI, gt) SYNC_OP_8(max_8) +#endif diff --git a/compiler-rt/lib/builtins/arm/sync_fetch_and_min_8.S b/compiler-rt/lib/builtins/arm/sync_fetch_and_min_8.S index 97af2aa6f1e..ad5cce07544 100644 --- a/compiler-rt/lib/builtins/arm/sync_fetch_and_min_8.S +++ b/compiler-rt/lib/builtins/arm/sync_fetch_and_min_8.S @@ -14,6 +14,8 @@ #include "sync-ops.h" +#if __ARM_ARCH_PROFILE != 'M' #define min_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) MINMAX_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI, lt) SYNC_OP_8(min_8) +#endif diff --git a/compiler-rt/lib/builtins/arm/sync_fetch_and_nand_8.S b/compiler-rt/lib/builtins/arm/sync_fetch_and_nand_8.S index 80e8c00f814..a2c17c09c08 100644 --- a/compiler-rt/lib/builtins/arm/sync_fetch_and_nand_8.S +++ b/compiler-rt/lib/builtins/arm/sync_fetch_and_nand_8.S @@ -14,9 +14,11 @@ #include "sync-ops.h" +#if __ARM_ARCH_PROFILE != 'M' #define nand_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) \ bic rD_LO, rN_LO, rM_LO ; \ bic rD_HI, rN_HI, rM_HI SYNC_OP_8(nand_8) +#endif diff --git a/compiler-rt/lib/builtins/arm/sync_fetch_and_or_8.S b/compiler-rt/lib/builtins/arm/sync_fetch_and_or_8.S index 0f77f02c72e..87b940bf620 100644 --- a/compiler-rt/lib/builtins/arm/sync_fetch_and_or_8.S +++ b/compiler-rt/lib/builtins/arm/sync_fetch_and_or_8.S @@ -14,9 +14,11 @@ #include "sync-ops.h" +#if __ARM_ARCH_PROFILE != 'M' #define or_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) \ orr rD_LO, rN_LO, rM_LO ; \ orr rD_HI, rN_HI, rM_HI SYNC_OP_8(or_8) +#endif diff --git a/compiler-rt/lib/builtins/arm/sync_fetch_and_sub_8.S b/compiler-rt/lib/builtins/arm/sync_fetch_and_sub_8.S index f4e1c4a60a2..a8035a27685 100644 --- a/compiler-rt/lib/builtins/arm/sync_fetch_and_sub_8.S +++ b/compiler-rt/lib/builtins/arm/sync_fetch_and_sub_8.S @@ -14,9 +14,11 @@ #include "sync-ops.h" +#if __ARM_ARCH_PROFILE != 'M' #define sub_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) \ subs rD_LO, rN_LO, rM_LO ; \ sbc rD_HI, rN_HI, rM_HI SYNC_OP_8(sub_8) +#endif diff --git a/compiler-rt/lib/builtins/arm/sync_fetch_and_umax_8.S b/compiler-rt/lib/builtins/arm/sync_fetch_and_umax_8.S index 7716cfe8290..d9b7965e52b 100644 --- a/compiler-rt/lib/builtins/arm/sync_fetch_and_umax_8.S +++ b/compiler-rt/lib/builtins/arm/sync_fetch_and_umax_8.S @@ -14,6 +14,8 @@ #include "sync-ops.h" +#if __ARM_ARCH_PROFILE != 'M' #define umax_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) MINMAX_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI, hi) SYNC_OP_8(umax_8) +#endif diff --git a/compiler-rt/lib/builtins/arm/sync_fetch_and_umin_8.S b/compiler-rt/lib/builtins/arm/sync_fetch_and_umin_8.S index b099726bc50..7bf5e235653 100644 --- a/compiler-rt/lib/builtins/arm/sync_fetch_and_umin_8.S +++ b/compiler-rt/lib/builtins/arm/sync_fetch_and_umin_8.S @@ -14,6 +14,8 @@ #include "sync-ops.h" +#if __ARM_ARCH_PROFILE != 'M' #define umin_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) MINMAX_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI, lo) SYNC_OP_8(umin_8) +#endif diff --git a/compiler-rt/lib/builtins/arm/sync_fetch_and_xor_8.S b/compiler-rt/lib/builtins/arm/sync_fetch_and_xor_8.S index 91b6a4c0887..ea9aa6d4b0e 100644 --- a/compiler-rt/lib/builtins/arm/sync_fetch_and_xor_8.S +++ b/compiler-rt/lib/builtins/arm/sync_fetch_and_xor_8.S @@ -14,9 +14,11 @@ #include "sync-ops.h" +#if __ARM_ARCH_PROFILE != 'M' #define xor_8(rD_LO, rD_HI, rN_LO, rN_HI, rM_LO, rM_HI) \ eor rD_LO, rN_LO, rM_LO ; \ eor rD_HI, rN_HI, rM_HI SYNC_OP_8(xor_8) +#endif |

