A64: Add hook_hint_instructions option

This commit is contained in:
MerryMage 2019-07-25 12:15:54 +01:00
parent 396116ee61
commit 717bd2fbb2
3 changed files with 30 additions and 6 deletions

View file

@ -37,22 +37,37 @@ bool TranslatorVisitor::NOP() {
}
bool TranslatorVisitor::YIELD() {
if (!options.hook_hint_instructions) {
return true;
}
return RaiseException(Exception::Yield);
}
bool TranslatorVisitor::WFE() {
if (!options.hook_hint_instructions) {
return true;
}
return RaiseException(Exception::WaitForEvent);
}
bool TranslatorVisitor::WFI() {
if (!options.hook_hint_instructions) {
return true;
}
return RaiseException(Exception::WaitForInterrupt);
}
bool TranslatorVisitor::SEV() {
if (!options.hook_hint_instructions) {
return true;
}
return RaiseException(Exception::SendEvent);
}
bool TranslatorVisitor::SEVL() {
if (!options.hook_hint_instructions) {
return true;
}
return RaiseException(Exception::SendEventLocal);
}

View file

@ -26,6 +26,11 @@ struct TranslationOptions {
/// If this is false, the ExceptionRaised IR instruction is emitted.
/// If this is true, we define some behaviour for some instructions.
bool define_unpredictable_behaviour = false;
/// This changes what IR we emit when we translate a hint instruction.
/// If this is false, we treat the instruction as a NOP.
/// If this is true, we emit an ExceptionRaised instruction.
bool hook_hint_instructions = true;
};
/**