[PATCH] forbid 8-byte atomic on Cortex M
Tim Northover
t.p.northover at gmail.com
Mon Jun 16 10:29:45 PDT 2014
H Phoebe
On 16 June 2014 18:18, Phoebe Buckheister <llvm at quasiparticle.net> wrote:
> Cortex M profiles don't support atomic operations on double words at
> all, but LLVM will happily codegen them anyway. Smaller atomics are
> available just fine on M profiles, so just disable atomics on anything
> larger than a machine word.
Don't think the behaviour for loads and stores is quite right. The
only reason we expand 64-bit ones on the usual ARM architectures is
that ldrd and strd aren't guaranteed to be atomic. On Cortex-M it
seems there simply are no 64-bit atomic operations, but that doesn't
mean a 32-bit load suddenly becomes non-atomic.
So I'd suggest leaving the first two conditions as they are (64-bit
operations won't work either way, but you'll get better code for
32-bit ones).
Cheers.
Tim.
More information about the llvm-commits
mailing list