From 0773f01ec6e22fee809e213902194cec824740eb Mon Sep 17 00:00:00 2001 From: r-a-sattarov Date: Sat, 10 Feb 2024 00:15:48 +0300 Subject: [PATCH] Optick: Add e2k support Ref: https://en.wikipedia.org/wiki/Elbrus_(computer) --- neo/libs/optick/optick.h | 3 +++ neo/libs/optick/optick_core.cpp | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/neo/libs/optick/optick.h b/neo/libs/optick/optick.h index 26ad07494..48c7365f1 100644 --- a/neo/libs/optick/optick.h +++ b/neo/libs/optick/optick.h @@ -56,6 +56,9 @@ # elif defined(__arm__) || defined(_M_ARM) # define OPTICK_ARM (1) # define OPTICK_32BIT (1) +# elif defined(__e2k__) +# define OPTICK_E2K (1) +# define OPTICK_64BIT (1) # endif #else #error Compiler not supported diff --git a/neo/libs/optick/optick_core.cpp b/neo/libs/optick/optick_core.cpp index 97a897cd1..5c36d6901 100644 --- a/neo/libs/optick/optick_core.cpp +++ b/neo/libs/optick/optick_core.cpp @@ -745,6 +745,8 @@ bool SwitchContextCollector::Serialize(OutputDataStream& stream) #define CPUID(INFO, ID) __cpuid(INFO, ID) #elif (defined(__ANDROID__) || defined(OPTICK_ARM)) // Nothing +#elif defined(OPTICK_E2K) +// Nothing #elif defined(OPTICK_GCC) #include #define CPUID(INFO, ID) __cpuid(ID, INFO[0], INFO[1], INFO[2], INFO[3]) @@ -773,6 +775,12 @@ string GetCPUName() #else return "ARM 64-bit"; #endif +#elif defined(OPTICK_E2K) + #if (defined(__LCC__) && defined(__MCST__)) // MCST LCC (eLbrus Compiler Collection) + return __builtin_cpu_name(); // e.g. elbrus-8c + #else + return "MCST Elbrus CPU"; + #endif #else int cpuInfo[4] = { -1 }; char cpuBrandString[0x40] = { 0 };