compnerd created this revision.
compnerd added reviewers: craig.topper, srhines.
Herald added a subscriber: jfb.
Herald added a project: clang.

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.


Repository:
  rC Clang

https://reviews.llvm.org/D63774

Files:
  lib/Driver/ToolChains/Arch/X86.cpp


Index: lib/Driver/ToolChains/Arch/X86.cpp
===================================================================
--- lib/Driver/ToolChains/Arch/X86.cpp
+++ lib/Driver/ToolChains/Arch/X86.cpp
@@ -135,6 +135,7 @@
     if (ArchType == llvm::Triple::x86_64) {
       Features.push_back("+sse4.2");
       Features.push_back("+popcnt");
+      Features.push_back("+mcx16");
     } else
       Features.push_back("+ssse3");
   }


Index: lib/Driver/ToolChains/Arch/X86.cpp
===================================================================
--- lib/Driver/ToolChains/Arch/X86.cpp
+++ lib/Driver/ToolChains/Arch/X86.cpp
@@ -135,6 +135,7 @@
     if (ArchType == llvm::Triple::x86_64) {
       Features.push_back("+sse4.2");
       Features.push_back("+popcnt");
+      Features.push_back("+mcx16");
     } else
       Features.push_back("+ssse3");
   }
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to