From e66d7cfd6cac5e562880892dda2a6dc7e065ef1a Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 19 Aug 2024 20:14:53 -0400 Subject: [PATCH] OpcodeDispatcher: pair mm save Signed-off-by: Alyssa Rosenzweig --- FEXCore/Source/Interface/Core/OpcodeDispatcher/Vector.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher/Vector.cpp b/FEXCore/Source/Interface/Core/OpcodeDispatcher/Vector.cpp index ce3499b96..dbb02d7a1 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher/Vector.cpp +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher/Vector.cpp @@ -2736,10 +2736,12 @@ void OpDispatchBuilder::SaveX87State(OpcodeArgs, Ref MemBase) { // MXCSR_MASK: Mask for writes to the MXCSR register // If OSFXSR bit in CR4 is not set than FXSAVE /may/ not save the XMM registers // This is implementation dependent - for (uint32_t i = 0; i < Core::CPUState::NUM_MMS; ++i) { - Ref MMReg = LoadContext(MM0Index + i); + for (uint32_t i = 0; i < Core::CPUState::NUM_MMS; i += 2) { + // TODO: Pair + Ref MMReg0 = LoadContext(MM0Index + i); + Ref MMReg1 = LoadContext(MM0Index + i + 1); - _StoreMem(FPRClass, 16, MMReg, MemBase, _Constant(i * 16 + 32), 16, MEM_OFFSET_SXTX, 1); + _StoreMemPair(FPRClass, 16, MMReg0, MMReg1, MemBase, i * 16 + 32); } }