From 02ec762c0cd32bf00e71296cc0c3cb1bd1e69880 Mon Sep 17 00:00:00 2001 From: LibretroAdmin Date: Sat, 26 Sep 2026 18:57:30 +0000 Subject: [PATCH] menu: show physical CPU cores in System Information The "CPU Cores" row printed cpu_features_get_core_amount(), which is the logical processor count, so a 16-core/32-thread 9950X3D read as "CPU Cores: 32". It now prints the physical count from cpu_features_get_core_amount_physical(), and adds the thread count when SMT makes it larger: "CPU Cores: 16 (32 threads)". Parts without SMT keep the plain "CPU Cores: 4" form. --- intl/__pycache__/json2h.cpython-312.pyc | Bin 30982 -> 30989 bytes intl/msg_hash_us.h | 4 ++++ menu/menu_displaylist.c | 17 +++++++++++++---- msg_hash.h | 1 + msg_hash_lbl_str.h | 1 + 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/intl/__pycache__/json2h.cpython-312.pyc b/intl/__pycache__/json2h.cpython-312.pyc index ce2f65df741158d321a9cb51497d84deedb631b4..9721d0f93fd1c099cd9c3a892a098e460d4455e7 100644 GIT binary patch delta 51 zcmZqs#Mt|Zk^3|+FBbz4^jzA$k^2;vxT=0eer~FMa!z7tN~(TPYDrPPV^MO(=BHeW Fc>u}l5;On+ delta 44 ycmeDE#Mt(Uk^3|+FBbz4Xno(bk^2;vfSi6ter~FMa!z7tN~(TQ;^sG8ig^G`C=WCM diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 9f42772472..718526b6dd 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -1539,6 +1539,10 @@ MSG_HASH( MENU_ENUM_LABEL_VALUE_CPU_CORES, "CPU Cores" ) +MSG_HASH( + MENU_ENUM_LABEL_VALUE_CPU_THREADS, + "threads" + ) MSG_HASH( MENU_ENUM_LABEL_VALUE_JIT_AVAILABLE, "JIT Available" diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index b0d28864f2..4ea07ef0e5 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -2948,12 +2948,21 @@ static unsigned menu_displaylist_parse_system_info(file_list_t *list) /* CPU Cores */ { - unsigned cores = cpu_features_get_core_amount(); - size_t _len = strlcpy(entry, + /* Physical cores, with the thread count alongside where SMT + * doubles it - the raw thread count read as 32 cores on a + * 16-core part. */ + unsigned threads = cpu_features_get_core_amount(); + unsigned cores = cpu_features_get_core_amount_physical(); + size_t _len = strlcpy(entry, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CPU_CORES), sizeof(entry)); - snprintf(entry + _len, sizeof(entry) - _len, - ": %u", cores); + if (threads > cores) + snprintf(entry + _len, sizeof(entry) - _len, + ": %u (%u %s)", cores, threads, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CPU_THREADS)); + else + snprintf(entry + _len, sizeof(entry) - _len, + ": %u", cores); if (menu_entries_append(list, entry, "", MENU_ENUM_LABEL_CPU_CORES, MENU_SETTINGS_CORE_INFO_NONE, 0, 0, NULL)) diff --git a/msg_hash.h b/msg_hash.h index e67724846d..3218865c8c 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -2120,6 +2120,7 @@ enum msg_hash_enums /* System information */ MENU_LABEL(CPU_CORES), + MENU_LABEL(CPU_THREADS), MENU_LABEL(CPU_ARCHITECTURE), MENU_LABEL(JIT_AVAILABLE), MENU_LABEL(BUNDLE_IDENTIFIER), diff --git a/msg_hash_lbl_str.h b/msg_hash_lbl_str.h index 417898ce26..fcfdfef847 100644 --- a/msg_hash_lbl_str.h +++ b/msg_hash_lbl_str.h @@ -149,6 +149,7 @@ #define MENU_ENUM_LABEL_CORE_STEAM_UNINSTALL_STR "core_steam_uninstall" #define MENU_ENUM_LABEL_CPU_ARCHITECTURE_STR "system_information_cpu_architecture" #define MENU_ENUM_LABEL_CPU_CORES_STR "system_information_cpu_cores" +#define MENU_ENUM_LABEL_CPU_THREADS_STR "system_information_cpu_threads" #define MENU_ENUM_LABEL_CUSTOM_BIND_STR "custom_bind" #define MENU_ENUM_LABEL_CUSTOM_BIND_ALL_STR "custom_bind_all" #define MENU_ENUM_LABEL_DATABASE_MANAGER_STR "database_manager"