Skip to content

Commit

Permalink
DB: add more AMD Zen 4 CPUs
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTumultuousUnicornOfDarkness committed Sep 23, 2023
1 parent 1df160b commit 41388e3
Show file tree
Hide file tree
Showing 5 changed files with 3,934 additions and 16 deletions.
12 changes: 7 additions & 5 deletions libcpuid/libcpuid_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ enum _common_bits_t {
_5 = LBIT( 4 ),
_7 = LBIT( 5 ),
_9 = LBIT( 6 ),
_H = LBIT( 7 ),
_S = LBIT( 8 ),
_U = LBIT( 9 ),
_X = LBIT( 10 ),
};

// additional detection bits for Intel CPUs:
Expand All @@ -123,11 +127,9 @@ enum _intel_bits_t {
_I_ = LBIT( 13 ),
XEON_ = LBIT( 14 ),
ATOM_ = LBIT( 15 ),
_H = LBIT( 16 ),
_K = LBIT( 17 ),
_X = LBIT( 18 ),
_P = LBIT( 19 ),
_N = LBIT( 20 ),
_K = LBIT( 16 ),
_P = LBIT( 17 ),
_N = LBIT( 18 ),
};
typedef enum _intel_bits_t intel_bits_t;

Expand Down
26 changes: 17 additions & 9 deletions libcpuid/recog_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,20 +347,19 @@ const struct match_entry_t cpudb_amd[] = {
{ 15, -1, -1, 25, 68, -1, -1, -1, NC, RYZEN_|_5 , 0, "Ryzen 5 (Rembrandt)" },
{ 15, -1, -1, 25, 68, -1, -1, -1, NC, RYZEN_|_3 , 0, "Ryzen 3 (Rembrandt)" },
/* Zen 4 (2022) => https://en.wikichip.org/wiki/amd/microarchitectures/zen_4 */
//{ 15, -1, -1, 25, ??, -1, -1, -1, NC, EPYC_ , 0, "EPYC (Genoa)" },
{ 15, -1, -1, 25, 17, -1, -1, -1, NC, EPYC_ , 0, "EPYC (Genoa)" },
//{ 15, -1, -1, 25, ??, -1, -1, -1, NC, RYZEN_TR_ , 0, "Threadripper (Storm Peak)" },
{ 15, -1, 2, 25, 97, -1, -1, -1, NC, RYZEN_|_9 , 0, "Ryzen 9 (Raphael)" },
{ 15, -1, 2, 25, 97, -1, -1, -1, NC, RYZEN_|_7 , 0, "Ryzen 7 (Raphael)" },
{ 15, -1, 2, 25, 97, -1, -1, -1, NC, RYZEN_|_5 , 0, "Ryzen 5 (Raphael)" },
{ 15, -1, 2, 25, 97, -1, -1, -1, NC, RYZEN_|_3 , 0, "Ryzen 3 (Raphael)" },
//{ 15, -1, -1, 25, ??, -1, -1, -1, NC, RYZEN_|_9 , 0, "Ryzen 9 (Dragon Range)" },
//{ 15, -1, -1, 25, ??, -1, -1, -1, NC, RYZEN_|_7 , 0, "Ryzen 7 (Dragon Range)" },
//{ 15, -1, -1, 25, ??, -1, -1, -1, NC, RYZEN_|_5 , 0, "Ryzen 5 (Dragon Range)" },
//{ 15, -1, -1, 25, ??, -1, -1, -1, NC, RYZEN_|_3 , 0, "Ryzen 3 (Dragon Range)" },
//{ 15, -1, -1, 25, ??, -1, -1, -1, NC, RYZEN_|_9 , 0, "Ryzen 9 (Phoenix Point)" },
//{ 15, -1, -1, 25, ??, -1, -1, -1, NC, RYZEN_|_7 , 0, "Ryzen 7 (Phoenix Point)" },
//{ 15, -1, -1, 25, ??, -1, -1, -1, NC, RYZEN_|_5 , 0, "Ryzen 5 (Phoenix Point)" },
//{ 15, -1, -1, 25, ??, -1, -1, -1, NC, RYZEN_|_3 , 0, "Ryzen 3 (Phoenix Point)" },
{ 15, -1, -1, 25, 97, -1, -1, -1, NC, RYZEN_|_9|_H , 0, "Ryzen 9 (Dragon Range)" },
{ 15, -1, -1, 25, 97, -1, -1, -1, NC, RYZEN_|_7|_H , 0, "Ryzen 7 (Dragon Range)" },
{ 15, -1, -1, 25, 97, -1, -1, -1, NC, RYZEN_|_5|_H , 0, "Ryzen 5 (Dragon Range)" },
{ 15, -1, -1, 25, 116, -1, -1, -1, NC, RYZEN_|_9 , 0, "Ryzen 9 (Phoenix)" },
{ 15, -1, -1, 25, 116, -1, -1, -1, NC, RYZEN_|_7 , 0, "Ryzen 7 (Phoenix)" },
{ 15, -1, -1, 25, 116, -1, -1, -1, NC, RYZEN_|_5 , 0, "Ryzen 5 (Phoenix)" },
{ 15, -1, -1, 25, 116, -1, -1, -1, NC, RYZEN_|_3 , 0, "Ryzen 3 (Phoenix)" },
/* F M S EF EM #cores L2$ L3$ BC ModelBits ModelCode Name */
};

Expand Down Expand Up @@ -520,6 +519,7 @@ static struct amd_code_and_bits_t decode_amd_codename_part1(const char *bs)
struct amd_code_and_bits_t result;
uint64_t bits = 0;
int i = 0;
const size_t n = strlen(bs);

const struct { amd_code_t c; const char *search; } code_matchtable[] = {
{ PHENOM2, "Phenom(tm) II" },
Expand Down Expand Up @@ -574,6 +574,14 @@ static struct amd_code_and_bits_t decode_amd_codename_part1(const char *bs)
case '7': bits |= _7; break;
case '9': bits |= _9; break;
}
for(i = i + 7; i < n; i++) {
switch (bs[i]) {
case 'H': bits |= _H; break;
case 'S': bits |= _S; break;
case 'U': bits |= _U; break;
case 'X': bits |= _X; break;
}
}
}

if ((i = match_pattern(bs, "C86 [357]")) != 0) {
Expand Down
6 changes: 4 additions & 2 deletions libcpuid/recog_intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,9 +746,11 @@ static intel_code_and_bits_t get_brand_code_and_bits(struct cpu_id_t* data)
switch (bs[i]) {
case 'H': bits |= _H; break;
case 'K': bits |= _K; break;
case 'X': bits |= _X; break;
case 'P': bits |= _P; break;
case 'N': bits |= _N; break;
case 'P': bits |= _P; break;
case 'S': bits |= _S; break;
case 'U': bits |= _U; break;
case 'X': bits |= _X; break;
}
}
}
Expand Down
Loading

0 comments on commit 41388e3

Please sign in to comment.