disassembler_arm: Remove rotation helper function in favor of Common::RotateRight

Mildly reduces the amount of duplicated behavior
This commit is contained in:
Lioncash 2018-05-02 08:12:38 -04:00 committed by MerryMage
parent 51e4f1d9db
commit b38dd191bd

View file

@ -23,14 +23,8 @@ class DisassemblerVisitor {
public: public:
using instruction_return_type = std::string; using instruction_return_type = std::string;
u32 rotr(u32 x, int shift) {
shift &= 31;
if (!shift) return x;
return (x >> shift) | (x << (32 - shift));
}
u32 ArmExpandImm(int rotate, Imm8 imm8) { u32 ArmExpandImm(int rotate, Imm8 imm8) {
return rotr(static_cast<u32>(imm8), rotate*2); return Common::RotateRight(static_cast<u32>(imm8), rotate*2);
} }
std::string ShiftStr(ShiftType shift, Imm5 imm5) { std::string ShiftStr(ShiftType shift, Imm5 imm5) {