Skip to content

Commit

Permalink
DB: add more AMD Phoenix (8000 series)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTumultuousUnicornOfDarkness committed Jun 1, 2024
1 parent 838cfa6 commit ddb8000
Show file tree
Hide file tree
Showing 4 changed files with 1,322 additions and 6 deletions.
10 changes: 6 additions & 4 deletions libcpuid/libcpuid_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,12 @@ enum _common_bits_t {
_5 = LBIT( 4 ),
_7 = LBIT( 5 ),
_9 = LBIT( 6 ),
_H = LBIT( 7 ),
_H = LBIT( 7 ), // powerful mobile processors for laptop
_S = LBIT( 8 ),
_U = LBIT( 9 ),
_X = LBIT( 10 ),
_U = LBIT( 9 ), // ultra-low power
_X = LBIT( 10 ), // CPU with great amount of power
_F = LBIT( 11 ), // CPU that doesn’t have integrated graphics
_G = LBIT( 12 ), // CPU with additional built-in integrated graphics
};

// additional detection bits for Intel CPUs:
Expand All @@ -146,7 +148,7 @@ enum _intel_bits_t {
_I_ = LBIT( 13 ),
XEON_ = LBIT( 14 ),
ATOM_ = LBIT( 15 ),
_K = LBIT( 16 ),
_K = LBIT( 16 ), // an unlocked desktop processor that allows for overclocking
_P = LBIT( 17 ),
_N = LBIT( 18 ),
_W_ = LBIT( 19 ),
Expand Down
21 changes: 19 additions & 2 deletions libcpuid/recog_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,21 +350,32 @@ const struct match_entry_t cpudb_amd[] = {
/* Zen 4 (2022) => https://en.wikichip.org/wiki/amd/microarchitectures/zen_4 */
{ 15, -1, -1, 25, 17, -1, -1, -1, NC, EPYC_ , 0, "EPYC (Genoa)" },
{ 15, -1, -1, 25, 24, -1, -1, -1, NC, RYZEN_TR_ , 0, "Threadripper (Storm Peak)" },
/* => Raphael (7000 series, Zen 4/RDNA2 based) */
{ 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)" },
/* => Dragon Range (7045 series, Zen 4/RDNA2 based) */
{ 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)" },
/* => Phoenix (7040 series, Zen 4/RDNA3/XDNA based) */
{ 15, -1, -1, 25, 116, -1, -1, -1, NC, RYZEN_|_9|_H , 0, "Ryzen 9 (Phoenix)" },
{ 15, -1, -1, 25, 116, -1, -1, -1, NC, RYZEN_|_7|_H , 0, "Ryzen 7 (Phoenix)" },
{ 15, -1, -1, 25, 116, -1, -1, -1, NC, RYZEN_|_7|_U , 0, "Ryzen 7 (Phoenix)" },
{ 15, -1, -1, 25, 116, -1, -1, -1, NC, RYZEN_|_5|_H , 0, "Ryzen 5 (Phoenix)" },
{ 15, -1, -1, 25, 116, -1, -1, -1, NC, RYZEN_|_5|_U , 0, "Ryzen 5 (Phoenix)" },
{ 15, -1, -1, 25, 116, -1, -1, -1, NC, RYZEN_|_3|_U , 0, "Ryzen 3 (Phoenix)" },
{ 15, -1, -1, 25, 116, -1, -1, -1, NC, RYZEN_|_Z , 0, "Ryzen Z1 (Phoenix)" },
/* => 8040 series, Zen 4/RDNA3/XDNA based */
/* => Phoenix (8000 series, Zen 4 based) */
{ 15, -1, -1, 25, 117, -1, -1, -1, NC, RYZEN_|_7|_F , 0, "Ryzen 7 (Phoenix)" },
{ 15, -1, -1, 25, 117, -1, -1, -1, NC, RYZEN_|_5|_F , 0, "Ryzen 5 (Phoenix)" },
/* => Phoenix (8000 series with Radeon Graphics, Zen 4/RDNA3/XDNA based) */
{ 15, -1, -1, 25, 117, -1, -1, -1, NC, RYZEN_|_9|_G , 0, "Ryzen 9 (Phoenix)" },
{ 15, -1, -1, 25, 117, -1, -1, -1, NC, RYZEN_|_7|_G , 0, "Ryzen 7 (Phoenix)" },
{ 15, -1, -1, 25, 117, -1, -1, -1, NC, RYZEN_|_5|_G , 0, "Ryzen 5 (Phoenix)" },
{ 15, -1, -1, 25, 117, -1, -1, -1, NC, RYZEN_|_3|_G , 0, "Ryzen 3 (Phoenix)" },
/* => Hawk Point (8040 series, Zen 4/RDNA3/XDNA based) */
{ 15, -1, -1, 25, 117, -1, -1, -1, NC, RYZEN_|_9|_H , 0, "Ryzen 9 (Hawk Point)" },
{ 15, -1, -1, 25, 117, -1, -1, -1, NC, RYZEN_|_7|_H , 0, "Ryzen 7 (Hawk Point)" },
{ 15, -1, -1, 25, 117, -1, -1, -1, NC, RYZEN_|_7|_U , 0, "Ryzen 7 (Hawk Point)" },
Expand Down Expand Up @@ -586,8 +597,14 @@ static struct amd_code_and_bits_t decode_amd_codename_part1(const char *bs)
case '9': bits |= _9; break;
case 'Z': bits |= _Z; break;
}
for(i = i + 7; i < n; i++) {
/* Stop the loop after a whitespace to avoid to read some words like "Graphics".
Example: bs="AMD Ryzen 7 8845HS w/ Radeon 780M Graphics"
=> loop i from 12 to 17, i.e. "8845HS" in such example
*/
for(i = i + 8; (i < n) && (bs[i] != ' '); i++) {
switch (bs[i]) {
case 'F': bits |= _F; break;
case 'G': bits |= _G; break;
case 'H': bits |= _H; break;
case 'S': bits |= _S; break;
case 'U': bits |= _U; break;
Expand Down
Loading

0 comments on commit ddb8000

Please sign in to comment.