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 475e012 commit ab66639
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/ggml-cpu/cpu-feats-x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,16 +266,16 @@ static int ggml_backend_cpu_x86_score() {
int score = 0;
cpuid_x86 is;

#ifdef GGML_SSE42
if (!is.SSE42()) { return 0; }
score += 1;
#endif
#ifdef GGML_FMA
if (!is.FMA()) { return 0; }
score += 1;
score += 1<<1;
#endif
#ifdef GGML_F16C
if (!is.F16C()) { return 0; }
score += 1<<1;
#endif
#ifdef GGML_SSE42
if (!is.SSE42()) { return 0; }
score += 1<<2;
#endif
#ifdef GGML_AVX
Expand Down

0 comments on commit ab66639

Please sign in to comment.