Arm: BLX is UNPREDICTABLE when Rm is PC
This commit is contained in:
parent
1af5bef32c
commit
4dcd1d1859
2 changed files with 4 additions and 1 deletions
|
@ -44,6 +44,8 @@ bool ArmTranslatorVisitor::arm_BLX_imm(bool H, Imm24 imm24) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ArmTranslatorVisitor::arm_BLX_reg(Cond cond, Reg m) {
|
bool ArmTranslatorVisitor::arm_BLX_reg(Cond cond, Reg m) {
|
||||||
|
if (m == Reg::PC)
|
||||||
|
return UnpredictableInstruction();
|
||||||
// BLX <Rm>
|
// BLX <Rm>
|
||||||
if (ConditionPassed(cond)) {
|
if (ConditionPassed(cond)) {
|
||||||
ir.SetRegister(Reg::LR, ir.Imm32(ir.current_location.PC() + 4));
|
ir.SetRegister(Reg::LR, ir.Imm32(ir.current_location.PC() + 4));
|
||||||
|
|
|
@ -563,7 +563,8 @@ TEST_CASE("Fuzz ARM data processing instructions", "[JitX64]") {
|
||||||
TEST_CASE("Fuzz ARM branch instructions", "[JitX64]") {
|
TEST_CASE("Fuzz ARM branch instructions", "[JitX64]") {
|
||||||
const std::array<InstructionGenerator, 6> instructions = {{
|
const std::array<InstructionGenerator, 6> instructions = {{
|
||||||
InstructionGenerator("1111101hvvvvvvvvvvvvvvvvvvvvvvvv"),
|
InstructionGenerator("1111101hvvvvvvvvvvvvvvvvvvvvvvvv"),
|
||||||
InstructionGenerator("cccc000100101111111111110011mmmm"),
|
InstructionGenerator("cccc000100101111111111110011mmmm",
|
||||||
|
[](u32 instr) { return Bits<0, 3>(instr) != 0b1111; }), // R15 is UNPREDICTABLE
|
||||||
InstructionGenerator("cccc1010vvvvvvvvvvvvvvvvvvvvvvvv"),
|
InstructionGenerator("cccc1010vvvvvvvvvvvvvvvvvvvvvvvv"),
|
||||||
InstructionGenerator("cccc1011vvvvvvvvvvvvvvvvvvvvvvvv"),
|
InstructionGenerator("cccc1011vvvvvvvvvvvvvvvvvvvvvvvv"),
|
||||||
InstructionGenerator("cccc000100101111111111110001mmmm"),
|
InstructionGenerator("cccc000100101111111111110001mmmm"),
|
||||||
|
|
Loading…
Reference in a new issue