[PATCH] D29542: [TargetInfo] Adjust x86-32 atomic support to the CPU used

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 6 10:11:07 PST 2017


mgorny added inline comments.


================
Comment at: lib/Basic/Targets.cpp:4244
+    } else // allow locked atomics up to 4 bytes
+      MaxAtomicPromoteWidth = 32;
+  }
----------------
ahatanak wrote:
> mgorny wrote:
> > dim wrote:
> > > Are you purposefully not setting `MaxAtomicInlineWidth` here?  (It seems from `TargetInfo` that the default value is zero.)
> > > 
> > Yes. I've based this on what's done for ARM. Unless I misunderstood something, this means that on 'plain' i386 there is no inline atomics support but we still want to do atomics-via-locking up to 32-bit types. I'm not sure about 32/64 here to match i486.
> If there isn't a test case for plain i386, is it possible to add one (perhaps in test/Sema/atomic-ops.c)?
I could do that. However, @joerg suggested dropping i386 branch entirely, and assuming i486+.


https://reviews.llvm.org/D29542





More information about the cfe-commits mailing list