x64: Backend-specific user configurations
Wunkolo opened this issue · 1 comments
Backend-specific enums like HostFeature should be exposed to the user such that particular backend-specific features can be toggled on/off and to relief the backend code the responsibility of things like checking if the host supports FastBMI2
.
dynarmic/src/dynarmic/backend/x64/block_of_code.cpp
Lines 165 to 179 in ff47d0d
Backend-specific configuration structures could possibly exist as a field within the current A{32,64}::UserConfig
structures as a void* backend_config
to avoid leaking too-many backend-specific code and structures to the user's codebase and to allow for future backends to have their own configuration structure(think of Vulkan's pNext
pattern).
The current use-case for backend-specific configurations that I have in mind would allow for Yuzu to turn on/off certain host-features like AVX512
, BMI2
(and checking for pre-Zen3 hardware), WAITPKG
, usage of ymm
/zmm
registers, and possibly allow for configuring of things like finding an optimal const-pool size or address some other magic-numbers across the code-base.
This would also be great for debugging and profiling particular ISA-features and implementations or mitigating feature-bugs out in the field(if a feature behind the HostFeature::COOLFEATURE
flag introduced a bug after releasing to the public, then users could be advised to just turn off HostFeature::COOLFEATURE
until it is fixed).
Backend-specific configuration structures could possibly exist as a field within the current A{32,64}::UserConfig structures as a void* backend_config to avoid leaking too-many backend-specific code and structures to the user's codebase and to allow for future backends to have their own configuration structure(think of Vulkan's pNext pattern).
std::any
is perfect for this usecase.