arm: printModImmOperand() should print Imm as unsigned number in some special cases

This commit is contained in:
Nguyen Anh Quynh 2015-03-08 00:29:20 +08:00
parent 796f1d4022
commit e0329ddde3

View File

@ -2251,7 +2251,12 @@ static void printModImmOperand(MCInst *MI, unsigned OpNum, SStream *O)
Rotated = rotr32(Bits, Rot);
if (getSOImmVal(Rotated) == MCOperand_getImm(Op)) {
// #rot has the least possible value
if (Rotated >= 0) {
if (PrintUnsigned) {
if (Rotated > HEX_THRESHOLD || Rotated < -HEX_THRESHOLD)
SStream_concat(O, "#0x%x", Rotated);
else
SStream_concat(O, "#%u", Rotated);
} else if (Rotated >= 0) {
if (Rotated > HEX_THRESHOLD)
SStream_concat(O, "#0x%x", Rotated);
else