thumb32: Implement SXTB
This commit is contained in:
parent
3cefdc3ab9
commit
75a28b00a7
3 changed files with 14 additions and 1 deletions
|
@ -203,7 +203,7 @@ INST(thumb32_SXTB16, "SXTB16", "11111010001011111111dd
|
||||||
INST(thumb32_SXTAB16, "SXTAB16", "111110100010nnnn1111dddd10rrmmmm")
|
INST(thumb32_SXTAB16, "SXTAB16", "111110100010nnnn1111dddd10rrmmmm")
|
||||||
INST(thumb32_UXTB16, "UXTB16", "11111010001111111111dddd10rrmmmm")
|
INST(thumb32_UXTB16, "UXTB16", "11111010001111111111dddd10rrmmmm")
|
||||||
INST(thumb32_UXTAB16, "UXTAB16", "111110100011nnnn1111dddd10rrmmmm")
|
INST(thumb32_UXTAB16, "UXTAB16", "111110100011nnnn1111dddd10rrmmmm")
|
||||||
//INST(thumb32_SXTB, "SXTB", "11111010010011111111----1-------")
|
INST(thumb32_SXTB, "SXTB", "11111010010011111111dddd10rrmmmm")
|
||||||
//INST(thumb32_SXTAB, "SXTAB", "111110100100----1111----1-------")
|
//INST(thumb32_SXTAB, "SXTAB", "111110100100----1111----1-------")
|
||||||
//INST(thumb32_UXTB, "UXTB", "11111010010111111111----1-------")
|
//INST(thumb32_UXTB, "UXTB", "11111010010111111111----1-------")
|
||||||
//INST(thumb32_UXTAB, "UXTAB", "111110100101----1111----1-------")
|
//INST(thumb32_UXTAB, "UXTAB", "111110100101----1111----1-------")
|
||||||
|
|
|
@ -11,6 +11,18 @@ static IR::U32 Rotate(A32::IREmitter& ir, Reg m, SignExtendRotation rotate) {
|
||||||
return ir.RotateRight(ir.GetRegister(m), ir.Imm8(rotate_by), ir.Imm1(0)).result;
|
return ir.RotateRight(ir.GetRegister(m), ir.Imm8(rotate_by), ir.Imm1(0)).result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ThumbTranslatorVisitor::thumb32_SXTB(Reg d, SignExtendRotation rotate, Reg m) {
|
||||||
|
if (d == Reg::PC || m == Reg::PC) {
|
||||||
|
return UnpredictableInstruction();
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto rotated = Rotate(ir, m, rotate);
|
||||||
|
const auto result = ir.SignExtendByteToWord(ir.LeastSignificantByte(rotated));
|
||||||
|
|
||||||
|
ir.SetRegister(d, result);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool ThumbTranslatorVisitor::thumb32_SXTB16(Reg d, SignExtendRotation rotate, Reg m) {
|
bool ThumbTranslatorVisitor::thumb32_SXTB16(Reg d, SignExtendRotation rotate, Reg m) {
|
||||||
if (d == Reg::PC || m == Reg::PC) {
|
if (d == Reg::PC || m == Reg::PC) {
|
||||||
return UnpredictableInstruction();
|
return UnpredictableInstruction();
|
||||||
|
|
|
@ -122,6 +122,7 @@ struct ThumbTranslatorVisitor final {
|
||||||
bool thumb32_UDF();
|
bool thumb32_UDF();
|
||||||
|
|
||||||
// thumb32 data processing (register) instructions
|
// thumb32 data processing (register) instructions
|
||||||
|
bool thumb32_SXTB(Reg d, SignExtendRotation rotate, Reg m);
|
||||||
bool thumb32_SXTB16(Reg d, SignExtendRotation rotate, Reg m);
|
bool thumb32_SXTB16(Reg d, SignExtendRotation rotate, Reg m);
|
||||||
bool thumb32_SXTAB16(Reg n, Reg d, SignExtendRotation rotate, Reg m);
|
bool thumb32_SXTAB16(Reg n, Reg d, SignExtendRotation rotate, Reg m);
|
||||||
bool thumb32_SXTH(Reg d, SignExtendRotation rotate, Reg m);
|
bool thumb32_SXTH(Reg d, SignExtendRotation rotate, Reg m);
|
||||||
|
|
Loading…
Reference in a new issue