aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/ChangeLog5
-rw-r--r--opcodes/arm-dis.c22
2 files changed, 21 insertions, 6 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 42dcc60..e14b99f 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,8 @@
+2011-10-18 Jie Zhang <jie@codesourcery.com>
+ Julian Brown <julian@codesourcery.com>
+
+ * arm-dis.c (print_insn_arm): Explicitly specify rotation if needed.
+
2011-10-10 Nick Clifton <nickc@redhat.com>
* po/es.po: Updated Spanish translation.
diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c
index fafa7f6..03062ad 100644
--- a/opcodes/arm-dis.c
+++ b/opcodes/arm-dis.c
@@ -3140,13 +3140,23 @@ print_insn_arm (bfd_vma pc, struct disassemble_info *info, long given)
case 'o':
if ((given & 0x02000000) != 0)
{
- int rotate = (given & 0xf00) >> 7;
- int immed = (given & 0xff);
+ unsigned int rotate = (given & 0xf00) >> 7;
+ unsigned int immed = (given & 0xff);
+ unsigned int a, i;
+
+ a = (((immed << (32 - rotate))
+ | (immed >> rotate)) & 0xffffffff);
+ /* If there is another encoding with smaller rotate,
+ the rotate should be specified directly. */
+ for (i = 0; i < 32; i += 2)
+ if ((a << i | a >> (32 - i)) <= 0xff)
+ break;
- immed = (((immed << (32 - rotate))
- | (immed >> rotate)) & 0xffffffff);
- func (stream, "#%d", immed);
- value_in_comment = immed;
+ if (i != rotate)
+ func (stream, "#%d, %d", immed, rotate);
+ else
+ func (stream, "#%d", a);
+ value_in_comment = a;
}
else
arm_decode_shift (given, func, stream, TRUE);