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

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 6 10:03:12 PST 2017


ahatanak added inline comments.


================
Comment at: lib/Basic/Targets.cpp:4244
+    } else // allow locked atomics up to 4 bytes
+      MaxAtomicPromoteWidth = 32;
+  }
----------------
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)?


https://reviews.llvm.org/D29542





More information about the cfe-commits mailing list