diff --git a/FEXCore/Source/Interface/Core/Interpreter/InterpreterOps.cpp b/FEXCore/Source/Interface/Core/Interpreter/InterpreterOps.cpp index 1363d4087..449b7f605 100644 --- a/FEXCore/Source/Interface/Core/Interpreter/InterpreterOps.cpp +++ b/FEXCore/Source/Interface/Core/Interpreter/InterpreterOps.cpp @@ -346,8 +346,10 @@ void InterpreterOps::InterpretIR(FEXCore::Core::CpuStateFrame *Frame, FEXCore::I auto BlockEnd = CurrentIR->GetBlocks().end(); - constexpr size_t ListEntrySizeInBytes = sizeof(InterpVector256); - const size_t SSADataSize = ListSize * ListEntrySizeInBytes; + // SSA data elements must be able to accommodate data that would + // fit inside the largest vector size (otherwise vector operations + // go kaboom, and we don't want that). + const size_t SSADataSize = ListSize * MaxInterpeterVectorSize; InterpreterOps::IROpData OpData{ .State = Frame->Thread, diff --git a/FEXCore/Source/Interface/Core/Interpreter/InterpreterOps.h b/FEXCore/Source/Interface/Core/Interpreter/InterpreterOps.h index 4a8943f78..00dc6f73e 100644 --- a/FEXCore/Source/Interface/Core/Interpreter/InterpreterOps.h +++ b/FEXCore/Source/Interface/Core/Interpreter/InterpreterOps.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include @@ -433,13 +434,14 @@ namespace FEXCore::CPU { return IROp->Size; } + // The maximum size a vector can be within FEX's interpreter. + // NOTE: If we ever support AVX-512, this should be changed + // to 64 bytes in size. + static constexpr size_t MaxInterpeterVectorSize = Core::CPUState::XMM_AVX_REG_SIZE; + // Alias for specifying temporary data that is operated on // before storing into a destination. - // - // NOTE: This should be the maximum size a vector can be within - // FEX. e.g. If we ever support AVX-512, this should be changed - // to be 64 bytes in size. - using TempVectorDataArray = std::array; + using TempVectorDataArray = std::array; }; } // namespace FEXCore::CPU