Skip to content

Commit 0089d5c

Browse files
authored
Add detection of Intel Skylake and Kaby Lake
1 parent 2cb7cc5 commit 0089d5c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

cmake/cpuid_x86.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ int cpu_detect()
141141
model=BITMASK(eax, 4, 0x0f);
142142

143143
if (vendor == VENDOR_INTEL){
144+
/*fprintf(stderr, "family %x exmodel %d model %d\n",family,extend_model,model);*/
144145
switch (family) {
145146
case 0x6:
146147
switch (extend_model) {
@@ -200,6 +201,13 @@ int cpu_detect()
200201
}else{
201202
return CPUNAME_GENERIC; //OS doesn't support AVX
202203
}
204+
case 14:
205+
//skylake
206+
if(support_avx()) {
207+
return CPUNAME_HASWELL;
208+
}else{
209+
return CPUNAME_GENERIC; //OS doesn't support AVX
210+
}
203211
}
204212
break;
205213
case 5:
@@ -211,8 +219,25 @@ int cpu_detect()
211219
}else{
212220
return CPUNAME_GENERIC; //OS doesn't support AVX
213221
}
222+
case 5:
223+
case 14:
224+
//skylake
225+
if(support_avx()) {
226+
return CPUNAME_HASWELL;
227+
}else{
228+
return CPUNAME_GENERIC; //OS doesn't support AVX
229+
}
214230
}
215231
break;
232+
case 8:
233+
switch (model) {
234+
case 14: // Kaby Lake
235+
if(support_avx())
236+
return CPUNAME_HASWELL;
237+
else
238+
return CPUNAME_GENERIC;
239+
}
240+
break;
216241
}
217242
break;
218243
}

0 commit comments

Comments
 (0)