From 14f711ba6ffea52d6000e7d442d01b684bbe7f97 Mon Sep 17 00:00:00 2001 From: buzbee Date: Thu, 5 Aug 2010 11:01:12 -0700 Subject: JIT: Support for shift field in disassembler [issue 2465170] Many Thumb2 instructions allow for an optional shift to be applied to operand 2. This cl enhances the disassembler to show a non-zero shift in the dump output. Change-Id: I6cbfec46cd45e3f2acc9553f880e80764a1eb65d --- vm/compiler/codegen/arm/ArchUtility.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'vm/compiler/codegen/arm/ArchUtility.c') diff --git a/vm/compiler/codegen/arm/ArchUtility.c b/vm/compiler/codegen/arm/ArchUtility.c index d5acd13ef..2e6845968 100644 --- a/vm/compiler/codegen/arm/ArchUtility.c +++ b/vm/compiler/codegen/arm/ArchUtility.c @@ -18,6 +18,12 @@ #include "libdex/OpCodeNames.h" #include "ArmLIR.h" +static char *shiftNames[4] = { + "lsl", + "lsr", + "asr", + "ror"}; + /* Decode and print a ARM register name */ static char * decodeRegList(int vector, char *buf) { @@ -83,6 +89,14 @@ static void buildInsnString(char *fmt, ArmLIR *lir, char* buf, assert((unsigned)(nc-'0') < 4); operand = lir->operands[nc-'0']; switch(*fmt++) { + case 'H': + if (operand != 0) { + sprintf(tbuf, ", %s %d",shiftNames[operand & 0x3], + operand >> 2); + } else { + strcpy(tbuf,""); + } + break; case 'B': switch (operand) { case kSY: -- cgit v1.2.3