mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-02-19 06:49:38 +00:00
externals: Update oaknut to 2.0.2
Merge commit '48dcc318c977ce17373f3710d04d96f9b05860a0'
This commit is contained in:
62
externals/oaknut/tests/_feature_detect.cpp
vendored
62
externals/oaknut/tests/_feature_detect.cpp
vendored
@@ -5,8 +5,12 @@
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
#include "oaknut/feature_detection/feature_detection.hpp"
|
||||
#include "oaknut/feature_detection/feature_detection_idregs.hpp"
|
||||
#include "architecture.hpp"
|
||||
|
||||
#ifdef ON_ARM64
|
||||
|
||||
# include "oaknut/feature_detection/feature_detection.hpp"
|
||||
# include "oaknut/feature_detection/feature_detection_idregs.hpp"
|
||||
|
||||
using namespace oaknut;
|
||||
|
||||
@@ -16,26 +20,6 @@ TEST_CASE("Print CPU features (Default)")
|
||||
|
||||
std::fputs("CPU Features: ", stdout);
|
||||
|
||||
#define OAKNUT_CPU_FEATURE(name) \
|
||||
if (features.has(CpuFeature::name)) \
|
||||
std::fputs(#name " ", stdout);
|
||||
#include "oaknut/impl/cpu_feature.inc.hpp"
|
||||
#undef OAKNUT_CPU_FEATURE
|
||||
|
||||
std::fputs("\n", stdout);
|
||||
}
|
||||
|
||||
#if OAKNUT_SUPPORTS_READING_ID_REGISTERS == 1
|
||||
|
||||
TEST_CASE("Print CPU features (Using CPUID)")
|
||||
{
|
||||
std::optional<id::IdRegisters> id_regs = read_id_registers();
|
||||
REQUIRE(!!id_regs);
|
||||
|
||||
CpuFeatures features = detect_features_via_id_registers(*id_regs);
|
||||
|
||||
std::fputs("CPU Features (CPUID method): ", stdout);
|
||||
|
||||
# define OAKNUT_CPU_FEATURE(name) \
|
||||
if (features.has(CpuFeature::name)) \
|
||||
std::fputs(#name " ", stdout);
|
||||
@@ -45,7 +29,27 @@ TEST_CASE("Print CPU features (Using CPUID)")
|
||||
std::fputs("\n", stdout);
|
||||
}
|
||||
|
||||
#elif OAKNUT_SUPPORTS_READING_ID_REGISTERS == 2
|
||||
# if OAKNUT_SUPPORTS_READING_ID_REGISTERS == 1
|
||||
|
||||
TEST_CASE("Print CPU features (Using CPUID)")
|
||||
{
|
||||
std::optional<id::IdRegisters> id_regs = read_id_registers();
|
||||
REQUIRE(!!id_regs);
|
||||
|
||||
CpuFeatures features = detect_features_via_id_registers(*id_regs);
|
||||
|
||||
std::fputs("CPU Features (CPUID method): ", stdout);
|
||||
|
||||
# define OAKNUT_CPU_FEATURE(name) \
|
||||
if (features.has(CpuFeature::name)) \
|
||||
std::fputs(#name " ", stdout);
|
||||
# include "oaknut/impl/cpu_feature.inc.hpp"
|
||||
# undef OAKNUT_CPU_FEATURE
|
||||
|
||||
std::fputs("\n", stdout);
|
||||
}
|
||||
|
||||
# elif OAKNUT_SUPPORTS_READING_ID_REGISTERS == 2
|
||||
|
||||
TEST_CASE("Print CPU features (Using CPUID)")
|
||||
{
|
||||
@@ -58,14 +62,16 @@ TEST_CASE("Print CPU features (Using CPUID)")
|
||||
|
||||
std::printf("CPU Features (CPUID method - Core %zu): ", core_index);
|
||||
|
||||
# define OAKNUT_CPU_FEATURE(name) \
|
||||
if (features.has(CpuFeature::name)) \
|
||||
std::fputs(#name " ", stdout);
|
||||
# include "oaknut/impl/cpu_feature.inc.hpp"
|
||||
# undef OAKNUT_CPU_FEATURE
|
||||
# define OAKNUT_CPU_FEATURE(name) \
|
||||
if (features.has(CpuFeature::name)) \
|
||||
std::fputs(#name " ", stdout);
|
||||
# include "oaknut/impl/cpu_feature.inc.hpp"
|
||||
# undef OAKNUT_CPU_FEATURE
|
||||
|
||||
std::fputs("\n", stdout);
|
||||
}
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user