[PATCH] D43394: [X86] Add 'sahf' CPU feature, and emit __LAHFSAHF__ for it

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 16 14:15:12 PST 2018


craig.topper added inline comments.


================
Comment at: lib/Basic/Targets/X86.cpp:295
     setFeatureEnabledImpl(Features, "xsave", true);
     setFeatureEnabledImpl(Features, "movbe", true);
     break;
----------------
KNM and KNL should both have sahf


================
Comment at: lib/Basic/Targets/X86.cpp:308
     setFeatureEnabledImpl(Features, "lzcnt", true);
     setFeatureEnabledImpl(Features, "popcnt", true);
     LLVM_FALLTHROUGH;
----------------
sahf should be available on amdfam10


================
Comment at: lib/Basic/Targets/X86.cpp:1049
 
+  if (HasLAHFSAHF)
+    Builder.defineMacro("__LAHFSAHF__");
----------------
Does gcc define this? It's such a low level instruction I have a hard time believing this define would be useful.


Repository:
  rC Clang

https://reviews.llvm.org/D43394





More information about the cfe-commits mailing list