From 609e2e6a6e001bcbe3da469a0c117fa570ca71aa Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Mon, 29 Sep 2014 10:23:20 +0000 Subject: [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 --- compiler-rt/lib/builtins/arm/sync_fetch_and_add_8.S | 2 ++ 1 file changed, 2 insertions(+) (limited to 'compiler-rt/lib/builtins/arm/sync_fetch_and_add_8.S') 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 -- cgit v1.2.3