|
|
@ -644,7 +644,8 @@ void JitCompiler::Compile_MAD(Instruction instr) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void JitCompiler::Compile_IF(Instruction instr) { |
|
|
void JitCompiler::Compile_IF(Instruction instr) { |
|
|
ASSERT_MSG(instr.flow_control.dest_offset > *offset_ptr, "Backwards if-statements not supported"); |
|
|
|
|
|
|
|
|
ASSERT_MSG(instr.flow_control.dest_offset > *offset_ptr, "Backwards if-statements (%d -> %d) not supported", |
|
|
|
|
|
*offset_ptr, instr.flow_control.dest_offset.Value()); |
|
|
|
|
|
|
|
|
// Evaluate the "IF" condition
|
|
|
// Evaluate the "IF" condition
|
|
|
if (instr.opcode.Value() == OpCode::Id::IFU) { |
|
|
if (instr.opcode.Value() == OpCode::Id::IFU) { |
|
|
@ -675,7 +676,8 @@ void JitCompiler::Compile_IF(Instruction instr) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void JitCompiler::Compile_LOOP(Instruction instr) { |
|
|
void JitCompiler::Compile_LOOP(Instruction instr) { |
|
|
ASSERT_MSG(instr.flow_control.dest_offset > *offset_ptr, "Backwards loops not supported"); |
|
|
|
|
|
|
|
|
ASSERT_MSG(instr.flow_control.dest_offset > *offset_ptr, "Backwards loops (%d -> %d) not supported", |
|
|
|
|
|
*offset_ptr, instr.flow_control.dest_offset.Value()); |
|
|
ASSERT_MSG(!looping, "Nested loops not supported"); |
|
|
ASSERT_MSG(!looping, "Nested loops not supported"); |
|
|
|
|
|
|
|
|
looping = true; |
|
|
looping = true; |
|
|
@ -703,7 +705,8 @@ void JitCompiler::Compile_LOOP(Instruction instr) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void JitCompiler::Compile_JMP(Instruction instr) { |
|
|
void JitCompiler::Compile_JMP(Instruction instr) { |
|
|
ASSERT_MSG(instr.flow_control.dest_offset > *offset_ptr, "Backwards jumps not supported"); |
|
|
|
|
|
|
|
|
ASSERT_MSG(instr.flow_control.dest_offset > *offset_ptr, "Backwards jumps (%d -> %d) not supported", |
|
|
|
|
|
*offset_ptr, instr.flow_control.dest_offset.Value()); |
|
|
|
|
|
|
|
|
if (instr.opcode.Value() == OpCode::Id::JMPC) |
|
|
if (instr.opcode.Value() == OpCode::Id::JMPC) |
|
|
Compile_EvaluateCondition(instr); |
|
|
Compile_EvaluateCondition(instr); |
|
|
|