craig.topper added inline comments.

================
Comment at: lib/Basic/Targets/X86.h:472
+    CPUKind Kind = getCPUKind(Opts.CPU);
+    if (Kind >= CK_i586 || Kind == CK_Generic)
+      MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
----------------
craig.topper wrote:
> efriedma wrote:
> > What exactly does "CK_Generic" mean here?  Under what circumstances does it 
> > show up? We should have a specific default for every supported target, if 
> > user doesn't specify a CPU with -march.
> CK_Generic is the default for 32-bit mode with no -march. CK_x86_64 is the 
> default for 64-bit mode with no march.
> 
> I'm not sure we can assume CK_Generic is 586 or better. We don't assume that 
> in the preprocessor defines.
> 
> ```
>   if (CPU >= CK_i486) {
>     Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
>     Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
>     Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
>   }
>   if (CPU >= CK_i586)
>     Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8");
>   if (HasCX16)
>     Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16");
> ```
Maybe we don't default to "generic" anywhere.  Its very platform specific. 
getX86TargetCPU in lib/Driver/ToolChains/Arch/X86.cpp contains the magic I 
think.


Repository:
  rC Clang

https://reviews.llvm.org/D42154



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to