Skip to content

Commit

Permalink
Merge pull request #14043 from unknownbrackets/vertexjit-abi
Browse files Browse the repository at this point in the history
vertexjit: Correct saved registers on x64
  • Loading branch information
unknownbrackets authored Jan 31, 2021
2 parents dfbde19 + cc4d047 commit 30b6f1f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions Core/HLE/HLE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@ void CallSyscall(MIPSOpcode op)
int funcnum = callno & 0xFFF;
int modulenum = (callno & 0xFF000) >> 12;
double total = time_now_d() - start - hleSteppingTime;
_dbg_assert_msg_(total >= 0.0, "Time spent in syscall became negative");
hleSteppingTime = 0.0;
updateSyscallStats(modulenum, funcnum, total);
}
Expand Down
6 changes: 5 additions & 1 deletion GPU/Common/VertexDecoderX86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ JittedVertexDecoder VertexDecoderJitCache::Compile(const VertexDecoder &dec, int
// Parameters automatically fall into place.

// This will align the stack properly to 16 bytes (the call of this function pushed RIP, which is 8 bytes).
const uint8_t STACK_FIXED_ALLOC = 64 + 8;
const uint8_t STACK_FIXED_ALLOC = 96 + 8;
#endif

// Allocate temporary storage on the stack.
Expand All @@ -197,6 +197,8 @@ JittedVertexDecoder VertexDecoderJitCache::Compile(const VertexDecoder &dec, int
MOVUPS(MDisp(ESP, 16), XMM5);
MOVUPS(MDisp(ESP, 32), XMM6);
MOVUPS(MDisp(ESP, 48), XMM7);
MOVUPS(MDisp(ESP, 64), XMM8);
MOVUPS(MDisp(ESP, 80), XMM9);

bool prescaleStep = false;
// Look for prescaled texcoord steps
Expand Down Expand Up @@ -273,6 +275,8 @@ JittedVertexDecoder VertexDecoderJitCache::Compile(const VertexDecoder &dec, int
MOVUPS(XMM5, MDisp(ESP, 16));
MOVUPS(XMM6, MDisp(ESP, 32));
MOVUPS(XMM7, MDisp(ESP, 48));
MOVUPS(XMM8, MDisp(ESP, 64));
MOVUPS(XMM9, MDisp(ESP, 80));
ADD(PTRBITS, R(ESP), Imm8(STACK_FIXED_ALLOC));

#ifdef _M_IX86
Expand Down
5 changes: 4 additions & 1 deletion GPU/GPUCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,9 @@ void GPUCommon::NotifySteppingExit() {
if (timeSteppingStarted_ <= 0.0) {
ERROR_LOG(G3D, "Mismatched stepping enter/exit.");
}
timeSpentStepping_ += time_now_d() - timeSteppingStarted_;
double total = time_now_d() - timeSteppingStarted_;
_dbg_assert_msg_(total >= 0.0, "Time spent stepping became negative");
timeSpentStepping_ += total;
timeSteppingStarted_ = 0.0;
}
}
Expand Down Expand Up @@ -1028,6 +1030,7 @@ bool GPUCommon::InterpretList(DisplayList &list) {

if (coreCollectDebugStats) {
double total = time_now_d() - start - timeSpentStepping_;
_dbg_assert_msg_(total >= 0.0, "Time spent DL processing became negative");
hleSetSteppingTime(timeSpentStepping_);
timeSpentStepping_ = 0.0;
gpuStats.msProcessingDisplayLists += total;
Expand Down

0 comments on commit 30b6f1f

Please sign in to comment.