[PATCH] D17933: Set MaxAtomicInlineWidth properly for i386, i486, and x86-64 cpus without cmpxchg16b.

James Y Knight via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 7 08:01:34 PST 2016


jyknight created this revision.
jyknight added a reviewer: t.p.northover.
jyknight added a subscriber: cfe-commits.
Herald added subscribers: dschuff, jfb, aemerson.

Also, remove all the manual definition of
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_* macros. Instead, define it based on
MaxAtomicInlineWidth, just like the __GCC_ATOMIC_*_LOCK_FREE macros.

Previously, the __GCC_HAVE_SYNC_COMPARE_AND_SWAP_* defines had been
computed separately, and *were* being set appropriately for older x86
targets, while MaxAtomicInlineWidth was not.

(Note the one FIXME comment: __GCC_ATOMIC_LLONG_LOCK_FREE is (still) set
improperly for i586, due to checking alignment where it ought not to.)

Test changes of note:

A few test invocations of clang -cc1 needed to have a "-target-cpu i686"
argument added -- the Driver would do so automatically based on the
"i686" in the triple, but in the tests cases cc1 invocations, it was
missing.

Some of the OpenMP tests needed a "-target-cpu core2" added: they were
assuming that cmpxchg16b was available, even though it's not in the base
x86_64 architecture.

An ARM test was asserting that V8M doesn't have
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1. This was wrong: V8M *does* support
atomic operations.

http://reviews.llvm.org/D17933

Files:
  lib/Basic/Targets.cpp
  lib/Frontend/InitPreprocessor.cpp
  test/CodeGen/atomic-ops.c
  test/CodeGen/ms-volatile.c
  test/CodeGenCXX/atomicinit.cpp
  test/OpenMP/atomic_capture_codegen.cpp
  test/OpenMP/atomic_read_codegen.c
  test/OpenMP/atomic_update_codegen.cpp
  test/OpenMP/atomic_write_codegen.c
  test/Preprocessor/arm-target-features.c
  test/Preprocessor/init.c
  test/Preprocessor/predefined-arch-macros.c
  test/Preprocessor/predefined-macros.c
  test/Preprocessor/x86_target_features.c
  test/Sema/atomic-ops.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17933.49965.patch
Type: text/x-patch
Size: 33948 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160307/1ea85d43/attachment-0001.bin>


More information about the cfe-commits mailing list