diff --git a/src/frontend/translate/translate_arm/extension.cpp b/src/frontend/translate/translate_arm/extension.cpp index 1df77459..f4ee00ae 100644 --- a/src/frontend/translate/translate_arm/extension.cpp +++ b/src/frontend/translate/translate_arm/extension.cpp @@ -96,8 +96,16 @@ bool ArmTranslatorVisitor::arm_UXTAB(Cond cond, Reg n, Reg d, SignExtendRotation } bool ArmTranslatorVisitor::arm_UXTAB16(Cond cond, Reg n, Reg d, SignExtendRotation rotate, Reg m) { - UNUSED(cond, n, d, rotate, m); - return InterpretThisInstruction(); + if (d == Reg::PC || m == Reg::PC || n == Reg::PC) + return UnpredictableInstruction(); + if (ConditionPassed(cond)) { + auto rotated = SignZeroExtendRor(m, rotate); + auto result = ir.And(rotated, ir.Imm32(0x00FF00FF)); + auto reg_n = ir.GetRegister(n); + result = ir.PackedAddU16(reg_n, result).result; + ir.SetRegister(d, result); + } + return true; } bool ArmTranslatorVisitor::arm_UXTAH(Cond cond, Reg n, Reg d, SignExtendRotation rotate, Reg m) { diff --git a/tests/arm/fuzz_arm.cpp b/tests/arm/fuzz_arm.cpp index ef8634a0..7f6e705c 100644 --- a/tests/arm/fuzz_arm.cpp +++ b/tests/arm/fuzz_arm.cpp @@ -831,7 +831,7 @@ TEST_CASE("Fuzz ARM extension instructions", "[JitX64]") { InstructionGenerator("cccc011011001111ddddrr000111mmmm", is_valid), InstructionGenerator("cccc011011111111ddddrr000111mmmm", is_valid), InstructionGenerator("cccc01101110nnnnddddrr000111mmmm", is_valid), - InstructionGenerator("cccc01101100nnnnddddrr000111mmmm", is_valid), + InstructionGenerator("cccc01101100nnnnddddrr000111mmmm", is_valid), //UXTAB16 InstructionGenerator("cccc01101111nnnnddddrr000111mmmm", is_valid), }};