mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-03-04 12:39:22 +00:00
OpcodeDispatcher: reg cache avx high
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
parent
cf5ab05b90
commit
a4f8bbff02
@ -1819,9 +1819,12 @@ private:
|
||||
static const int DFIndex = 31;
|
||||
static const int FPR0Index = 32;
|
||||
static const int FPR15Index = 47;
|
||||
static const int AVXHigh0Index = 48;
|
||||
static const int AVXHigh15Index = 63;
|
||||
|
||||
int CacheIndexToContextOffset(int Index) {
|
||||
switch (Index) {
|
||||
case AVXHigh0Index ... AVXHigh15Index: return offsetof(FEXCore::Core::CPUState, avx_high[Index - AVXHigh0Index][0]);
|
||||
case AbridgedFTWIndex: return offsetof(FEXCore::Core::CPUState, AbridgedFTW);
|
||||
default: return -1;
|
||||
}
|
||||
@ -1836,7 +1839,11 @@ private:
|
||||
}
|
||||
|
||||
unsigned CacheIndexToSize(int Index) {
|
||||
return 1;
|
||||
if (Index >= AVXHigh0Index) {
|
||||
return 16;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
struct {
|
||||
@ -1858,7 +1865,7 @@ private:
|
||||
if (!(RegCache.Cached & Bit)) {
|
||||
if (Index == DFIndex) {
|
||||
RegCache.Value[Index] = _LoadDF();
|
||||
} else if (Index == AbridgedFTWIndex) {
|
||||
} else if (Index == AbridgedFTWIndex || Index >= AVXHigh0Index) {
|
||||
RegCache.Value[Index] = _LoadContext(Size, RegClass, Offset);
|
||||
} else {
|
||||
RegCache.Value[Index] = _LoadRegister(Offset, RegClass, Size);
|
||||
|
@ -562,7 +562,7 @@ void OpDispatchBuilder::AVX128_StoreResult_WithOpSize(FEXCore::X86Tables::Decode
|
||||
|
||||
Ref OpDispatchBuilder::AVX128_LoadXMMRegister(uint32_t XMM, bool High) {
|
||||
if (High) {
|
||||
return _LoadContext(16, FPRClass, offsetof(FEXCore::Core::CPUState, avx_high[XMM][0]));
|
||||
return LoadContext(AVXHigh0Index + XMM);
|
||||
} else {
|
||||
return LoadXMMRegister(XMM);
|
||||
}
|
||||
@ -570,7 +570,7 @@ Ref OpDispatchBuilder::AVX128_LoadXMMRegister(uint32_t XMM, bool High) {
|
||||
|
||||
void OpDispatchBuilder::AVX128_StoreXMMRegister(uint32_t XMM, const Ref Src, bool High) {
|
||||
if (High) {
|
||||
_StoreContext(16, FPRClass, Src, offsetof(FEXCore::Core::CPUState, avx_high[XMM][0]));
|
||||
StoreContext(AVXHigh0Index + XMM, Src);
|
||||
} else {
|
||||
StoreXMMRegister(XMM, Src);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user