]> granicus.if.org Git - clang/commit
android: enable double-word CAS on x64
authorSaleem Abdulrasool <compnerd@compnerd.org>
Tue, 25 Jun 2019 21:43:34 +0000 (21:43 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Tue, 25 Jun 2019 21:43:34 +0000 (21:43 +0000)
commitd3f9eac03b57df52b2b096a70e38082c9e989c88
tree2bf70dfbb1f0b3331168f35886ea8f986aa280c5
parent144f1652d48202c4b234205bc353132ff21c36f7
android: enable double-word CAS on x64

The android target assumes that for the x86_64 target, the CPU supports SSE4.2
and popcnt. This implies that the CPU is Nehalem or newer. This should be
sufficiently new to provide the double word compare and exchange instruction.
This allows us to directly lower `__sync_val_compare_and_swap_16` to a `cmpxchg16b`.
It appears that the libatomic in android's NDK does not provide the
implementation for lowering calls to the library function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364352 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Driver/ToolChains/Arch/X86.cpp
test/Driver/clang-translation.c