[compiler-rt] [llvm] [compiler-rt][X86] Unify getAMDProcessorTypeAndSubType (PR #97863)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 7 10:24:44 PDT 2024


================
@@ -707,9 +707,7 @@ static StringRef
 getIntelProcessorTypeAndSubtype(unsigned Family, unsigned Model,
                                 const unsigned *Features,
                                 unsigned *Type, unsigned *Subtype) {
-  auto testFeature = [&](unsigned F) {
-    return (Features[F / 32] & (1U << (F % 32))) != 0;
-  };
+#define testFeature(F) (Features[F / 32] & (1 << (F % 32))) != 0
----------------
RKSimon wrote:

Should we move this define before the getIntel* definition and then undef it after we've finished with it? I'm not sure how clean it is to define this INSIDE the getIntel* function and then keep using it in later functions. I'm assuming we can't keep the lambda if its going to be used in c code in the future?

https://github.com/llvm/llvm-project/pull/97863


More information about the llvm-commits mailing list