[PATCH] ARM: allow inline atomics on Cortex M

Phoebe Buckheister llvm at quasiparticle.net
Mon Jun 16 14:00:23 PDT 2014


Current code to determine availability of atomics seems a bit
incorrect, or at least weird.

I don't quite understand why clang looks at the OS specified in the
triple, as availability of atomic instructions doesn't depend on the
OS; it only depends on the arch version and the execution mode. Atomics
are there in ARM mode on v6 and later, and in Thumb mode on v7 and later
(but no ldrexd/strexd in the M profile).

This patch is an attempt to rectify the situation: check only the arch
version - correctly, as thumbv7em fails the old check - and allow
atomics up to 32 bits on the ARMv7 M profiles.

If the OS check has a reason I missed, I'll add it back - but bare
metal wants atomics too ...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: atomics-on-m.patch
Type: text/x-patch
Size: 2194 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140616/3754c663/attachment.bin>


More information about the cfe-commits mailing list