[clang] [compiler-rt] [llvm] [X86][TargetParser] Widen CPU feature mask (PR #248033)

Evgenii Kudriashov via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 6 10:58:24 PST 2026


================
@@ -1288,9 +1288,8 @@ int CONSTRUCTOR_ATTRIBUTE __cpu_indicator_init(void) {
   getAvailableFeatures(ECX, EDX, MaxLeaf, &Features[0]);
 
   __cpu_model.__cpu_features[0] = Features[0];
-  __cpu_features2[0] = Features[1];
-  __cpu_features2[1] = Features[2];
-  __cpu_features2[2] = Features[3];
+  for (unsigned I = 1; I != sizeof(Features) / sizeof(Features[0]); ++I)
+    __cpu_features2[I - 1] = Features[I];
----------------
e-kud wrote:

It is limited to the amount of dwords required to fit available features similarly to GCC. So compiler-rt matches libgcc. But now I'm realizing that PR enlarges `__cpu_features2` to 4 dwords while llvm enlarges its representation to 7. Strictly speaking there is no code that will access extra 3 dwords. But this inconsistency may be confusing. Do you think it is ok to have this inconsistency or it is better to keep everything synced up regardless of more frequent updates?

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


More information about the cfe-commits mailing list