mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-24 11:25:45 +01:00
shader_jit_x64: Get rid of unnecessary last_program_counter variable.
This commit is contained in:
parent
f3afe24594
commit
6e0319eec9
@ -677,7 +677,7 @@ void JitCompiler::Compile_MAD(Instruction instr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void JitCompiler::Compile_IF(Instruction instr) {
|
void JitCompiler::Compile_IF(Instruction instr) {
|
||||||
RuntimeAssert(instr.flow_control.dest_offset > last_program_counter, "Backwards if-statements not supported");
|
RuntimeAssert(instr.flow_control.dest_offset >= program_counter, "Backwards if-statements not supported");
|
||||||
|
|
||||||
// Evaluate the "IF" condition
|
// Evaluate the "IF" condition
|
||||||
if (instr.opcode.Value() == OpCode::Id::IFU) {
|
if (instr.opcode.Value() == OpCode::Id::IFU) {
|
||||||
@ -708,7 +708,7 @@ void JitCompiler::Compile_IF(Instruction instr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void JitCompiler::Compile_LOOP(Instruction instr) {
|
void JitCompiler::Compile_LOOP(Instruction instr) {
|
||||||
RuntimeAssert(instr.flow_control.dest_offset > last_program_counter, "Backwards loops not supported");
|
RuntimeAssert(instr.flow_control.dest_offset >= program_counter, "Backwards loops not supported");
|
||||||
RuntimeAssert(!looping, "Nested loops not supported");
|
RuntimeAssert(!looping, "Nested loops not supported");
|
||||||
|
|
||||||
looping = true;
|
looping = true;
|
||||||
@ -770,8 +770,6 @@ void JitCompiler::Compile_Return() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void JitCompiler::Compile_NextInstr() {
|
void JitCompiler::Compile_NextInstr() {
|
||||||
last_program_counter = program_counter;
|
|
||||||
|
|
||||||
auto search = return_offsets.find(program_counter);
|
auto search = return_offsets.find(program_counter);
|
||||||
if (search != return_offsets.end()) {
|
if (search != return_offsets.end()) {
|
||||||
Compile_Return();
|
Compile_Return();
|
||||||
@ -839,7 +837,6 @@ void JitCompiler::Compile() {
|
|||||||
FindReturnOffsets();
|
FindReturnOffsets();
|
||||||
|
|
||||||
// Reset flow control state
|
// Reset flow control state
|
||||||
last_program_counter = 0;
|
|
||||||
program_counter = 0;
|
program_counter = 0;
|
||||||
looping = false;
|
looping = false;
|
||||||
code_ptr.fill(nullptr);
|
code_ptr.fill(nullptr);
|
||||||
|
@ -108,7 +108,6 @@ private:
|
|||||||
/// Offsets in code where a return needs to be inserted
|
/// Offsets in code where a return needs to be inserted
|
||||||
std::set<unsigned> return_offsets;
|
std::set<unsigned> return_offsets;
|
||||||
|
|
||||||
unsigned last_program_counter = 0; ///< Offset of the most recent instruction decoded
|
|
||||||
unsigned program_counter = 0; ///< Offset of the next instruction to decode
|
unsigned program_counter = 0; ///< Offset of the next instruction to decode
|
||||||
bool looping = false; ///< True if compiling a loop, used to check for nested loops
|
bool looping = false; ///< True if compiling a loop, used to check for nested loops
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user