]> granicus.if.org Git - clang/commit
Adjust MaxAtomicInlineWidth for i386/i486 targets.
authorWei Mi <wmi@google.com>
Tue, 23 Jan 2018 23:27:57 +0000 (23:27 +0000)
committerWei Mi <wmi@google.com>
Tue, 23 Jan 2018 23:27:57 +0000 (23:27 +0000)
commitbbb5d09c94b6a8b2cf9f69b14025c08da4c12586
treea9a1597fb7e3bff49cb9b32bdc6b70f0554703f8
parente7469bc992bca368b62364b683ddc3e20df8db27
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@323281 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Basic/Targets/X86.h
test/CodeGenCXX/atomic-inline.cpp