summaryrefslogtreecommitdiffstats
path: root/vm/compiler/codegen/arm/ArchUtility.c
diff options
context:
space:
mode:
authorbuzbee <buzbee@google.com>2010-08-05 11:01:12 -0700
committerbuzbee <buzbee@google.com>2010-08-05 11:01:12 -0700
commit14f711ba6ffea52d6000e7d442d01b684bbe7f97 (patch)
tree05886643392ca9caeb4e1336b944e7247608ab17 /vm/compiler/codegen/arm/ArchUtility.c
parentbff121aa3e5d3c34caf837227cb00a46bf3f1966 (diff)
downloadandroid_dalvik-14f711ba6ffea52d6000e7d442d01b684bbe7f97.tar.gz
android_dalvik-14f711ba6ffea52d6000e7d442d01b684bbe7f97.tar.bz2
android_dalvik-14f711ba6ffea52d6000e7d442d01b684bbe7f97.zip
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
Diffstat (limited to 'vm/compiler/codegen/arm/ArchUtility.c')
-rw-r--r--vm/compiler/codegen/arm/ArchUtility.c14
1 files changed, 14 insertions, 0 deletions
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: