[cfe-commits] Some improvements to atomics
csdavec at swan.ac.uk
Thu Jan 5 11:53:48 CST 2012
The attached patch makes some improvements to the handling of C11 atomic types:
- Add atomic-to/from-nonatomic cast types
- Emit atomic operations for arithmetic on atomic types
- Emit non-atomic stores for initialisation of atomic types, but atomic stores and loads for every other store / load
- Add a __atomic_init() intrinsic which does a non-atomic store to an _Atomic() type. This is needed for the corresponding C11 stdatomic.h function.
- Enables the relevant __has_feature() checks. The feature isn't 100% complete yet, but it's done enough that we want people testing it.
Does anyone want to review it before I commit?
 Currently, these are all using a cmpxchg loop. Addition and subtraction should be emitting the relevant atomicrmw instruction - this is the make it work patch, the make it fast patch will happen later...
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 29538 bytes
Desc: not available
Url : http://lists.cs.uiuc.edu/pipermail/cfe-commits/attachments/20120105/8be507ec/attachment-0001.obj
More information about the cfe-commits