[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:16:20 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:
> 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+.
OK, thanks. In that case, we don't need the test.


https://reviews.llvm.org/D29542





More information about the cfe-commits mailing list