]> granicus.if.org Git - clang/commit
Revert r323281 "Adjust MaxAtomicInlineWidth for i386/i486 targets."
authorHans Wennborg <hans@hanshq.net>
Fri, 24 Aug 2018 22:46:33 +0000 (22:46 +0000)
committerHans Wennborg <hans@hanshq.net>
Fri, 24 Aug 2018 22:46:33 +0000 (22:46 +0000)
commit905c589291a16bf29189507e0ff468e0eb0f97b0
treec4253da106ee03bcc87845af918f4e5c6620fb72
parenta80ce5895a99dde0e1d0d40a2fac628c9fff9375
Revert r323281 "Adjust MaxAtomicInlineWidth for i386/i486 targets."

As reported on http://lists.llvm.org/pipermail/cfe-dev/2018-August/058760.html,
this broke i386-freebsd11 due to its lack of atomic 64 bit primitives.

While that's not really this commit's fault, let's revert back to the old
behaviour until this can be fixed. This means generating cmpxchg8b etc for i386
and i486 which don't technically support those, but that's been the behaviour
for a long time, so a little longer probably doesn't hurt that much.

> Adjust MaxAtomicInlineWidth for i386/i486 targets.
>
> This is to fix the bug reported in https://bugs.llvm.org/show_bug.cgi?id=34347#c6.
> Currently, all  MaxAtomicInlineWidth of x86-32 targets are set to 64. However,
> i386 doesn't support any cmpxchg related instructions. i486 only supports cmpxchg.
> So in this patch MaxAtomicInlineWidth is reset as follows:
> For i386, the MaxAtomicInlineWidth should be 0 because no cmpxchg is supported.
> For i486, the MaxAtomicInlineWidth should be 32 because it supports cmpxchg.
> For others 32 bits x86 cpu, the MaxAtomicInlineWidth should be 64 because of cmpxchg8b.
>
> Differential Revision: https://reviews.llvm.org/D42154

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340666 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Basic/Targets/X86.h
test/CodeGenCXX/atomic-inline.cpp