[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
This commit is contained in:
Oliver Stannard 2014-09-29 10:23:20 +00:00
parent 6cbf43167b
commit 609e2e6a6e
10 changed files with 20 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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