From bd8759853bf8496abb113a5b17d0c972fce0250b Mon Sep 17 00:00:00 2001 From: Pierce Andjelkovic Date: Sat, 31 Jul 2021 01:50:48 +1000 Subject: [PATCH] Fix ABI --- Common/RiscVCPUDetect.cpp | 4 ++-- UI/DevScreens.cpp | 12 +++++++++++- ppsspp_config.h | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Common/RiscVCPUDetect.cpp b/Common/RiscVCPUDetect.cpp index c433136c84..4e3c10d7aa 100644 --- a/Common/RiscVCPUDetect.cpp +++ b/Common/RiscVCPUDetect.cpp @@ -33,8 +33,8 @@ const char procfile[] = "/proc/cpuinfo"; const char syscpupresentfile[] = "/sys/devices/system/cpu/present"; std::string GetCPUString() { - std::string cpu_string = "Unknown"; - + std::string cpu_string; + cpu_string = "Unknown"; return cpu_string; } diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp index 89fceb30bd..e5e9878d6f 100644 --- a/UI/DevScreens.cpp +++ b/UI/DevScreens.cpp @@ -424,7 +424,17 @@ const char *GetCompilerABI() { #elif PPSSPP_ARCH(AMD64) return "x86-64"; #elif PPSSPP_ARCH(RISCV64) - return "rv64"; + //https://github.com/riscv/riscv-toolchain-conventions#cc-preprocessor-definitions + //https://github.com/riscv/riscv-c-api-doc/blob/master/riscv-c-api.md#abi-related-preprocessor-definitions + #if defined(__riscv_float_abi_single) + return "lp64f"; + #elif defined(__riscv_float_abi_double) + return "lp64d"; + #elif defined(__riscv_float_abi_quad) + return "lp64q"; + #elif defined(__riscv_float_abi_soft) + return "lp64"; + #endif #else return "other"; #endif diff --git a/ppsspp_config.h b/ppsspp_config.h index 0c4e2b9c1d..cdf01e07d6 100644 --- a/ppsspp_config.h +++ b/ppsspp_config.h @@ -65,6 +65,7 @@ #endif #if defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64 + //https://github.com/riscv/riscv-c-api-doc/blob/master/riscv-c-api.md #define PPSSPP_ARCH_RISCV64 1 #define PPSSPP_ARCH_64BIT 1 #endif