Skip to content

Commit

Permalink
cpu: Shift score for SSE4.2
Browse files Browse the repository at this point in the history
It seems that SSE4.2 first appeared in Nehalem, and FMA/F16C in Ivy
Bridge. This precedence would also match that given by the
microarchitectural levels agreed to by Intel and AMD:

   https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels
  • Loading branch information
ckastner committed Feb 17, 2025
1 parent 9a4acb3 commit b917ee3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ggml-cpu/cpu-feats-x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ static int ggml_backend_cpu_x86_score() {
int score = 0;
cpuid_x86 is;

#ifdef GGML_SSE42
if (!is.SSE42()) { return 0; }
score += 1<<2;
#endif
#ifdef GGML_FMA
if (!is.FMA()) { return 0; }
score += 1;
Expand All @@ -274,10 +278,6 @@ static int ggml_backend_cpu_x86_score() {
if (!is.F16C()) { return 0; }
score += 1<<1;
#endif
#ifdef GGML_SSE42
if (!is.SSE42()) { return 0; }
score += 1<<2;
#endif
#ifdef GGML_AVX
if (!is.AVX()) { return 0; }
score += 1<<4;
Expand Down

0 comments on commit b917ee3

Please sign in to comment.