Skip to content

Commit a5ba606

Browse files
[Clang][NFC] Use Hex Encoding for Intel CPU CPUID family (#153004)
Use Hex Encoding for CPUID family to match number format with Intel ISE rev.58: https://cdrdv2.intel.com/v1/dl/getContent/671368
1 parent ca4ebf9 commit a5ba606

File tree

2 files changed

+8
-8
lines changed
  • compiler-rt/lib/builtins/cpu_model
  • llvm/lib/TargetParser

2 files changed

+8
-8
lines changed

compiler-rt/lib/builtins/cpu_model/x86.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ static const char *getIntelProcessorTypeAndSubtype(unsigned Family,
328328
const char *CPU = 0;
329329

330330
switch (Family) {
331-
case 6:
331+
case 0x6:
332332
switch (Model) {
333333
case 0x0f: // Intel Core 2 Duo processor, Intel Core 2 Duo mobile
334334
// processor, Intel Core 2 Quad processor, Intel Core 2 Quad
@@ -626,7 +626,7 @@ static const char *getIntelProcessorTypeAndSubtype(unsigned Family,
626626
break;
627627
}
628628
break;
629-
case 19:
629+
case 0x13:
630630
switch (Model) {
631631
// Diamond Rapids:
632632
case 0x01:

llvm/lib/TargetParser/Host.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -759,20 +759,20 @@ static StringRef getIntelProcessorTypeAndSubtype(unsigned Family,
759759
StringRef CPU;
760760

761761
switch (Family) {
762-
case 3:
762+
case 0x3:
763763
CPU = "i386";
764764
break;
765-
case 4:
765+
case 0x4:
766766
CPU = "i486";
767767
break;
768-
case 5:
768+
case 0x5:
769769
if (testFeature(X86::FEATURE_MMX)) {
770770
CPU = "pentium-mmx";
771771
break;
772772
}
773773
CPU = "pentium";
774774
break;
775-
case 6:
775+
case 0x6:
776776
switch (Model) {
777777
case 0x0f: // Intel Core 2 Duo processor, Intel Core 2 Duo mobile
778778
// processor, Intel Core 2 Quad processor, Intel Core 2 Quad
@@ -1120,7 +1120,7 @@ static StringRef getIntelProcessorTypeAndSubtype(unsigned Family,
11201120
break;
11211121
}
11221122
break;
1123-
case 15: {
1123+
case 0xf: {
11241124
if (testFeature(X86::FEATURE_64BIT)) {
11251125
CPU = "nocona";
11261126
break;
@@ -1132,7 +1132,7 @@ static StringRef getIntelProcessorTypeAndSubtype(unsigned Family,
11321132
CPU = "pentium4";
11331133
break;
11341134
}
1135-
case 19:
1135+
case 0x13:
11361136
switch (Model) {
11371137
// Diamond Rapids:
11381138
case 0x01:

0 commit comments

Comments
 (0)