[PATCH] D59576: [X86] Add CMPXCHG8B feature flag. Set it for all CPUs except i386/i486 including 'generic'. Disable use of CMPXCHG8B when this flag isn't set.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 12:33:28 PDT 2019


efriedma added inline comments.


================
Comment at: lib/Support/Host.cpp:1267
 
+  Features["cx8"]    = (EDX >>  8) & 1;
   Features["cmov"]   = (EDX >> 15) & 1;
----------------
If someone were to actually try running LLVM on certain 486 models, it would crash because it doesn't actually support CPUID, but I guess that's orthogonal. :)


================
Comment at: lib/Target/X86/X86.td:1118
 def : Proc<"winchip2",        [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>;
 def : Proc<"c3",              [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>;
+def : Proc<"c3-2",            [FeatureX87, FeatureSlowUAMem16, FeatureCMPXCHG8B,
----------------
This looks a little weird; c3-2 but not c3?  Are you sure that's right?


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:480
+    //if (VT == MVT::i64 && !Subtarget.hasCmpxchg8b())
+    //  continue;
+
----------------
?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59576/new/

https://reviews.llvm.org/D59576





More information about the llvm-commits mailing list