From e2395c46c89514628fc5950d1a104fa624c4728b Mon Sep 17 00:00:00 2001 From: comex Date: Sat, 17 Jan 2015 22:51:13 -0500 Subject: ldrd/strd fix - we definitely need to know that in ldrd r0, r1, [pc], we can't use r1 as scratch --- lib/dis.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/dis.h') diff --git a/lib/dis.h b/lib/dis.h index e0cbc4f..7a53f27 100644 --- a/lib/dis.h +++ b/lib/dis.h @@ -81,9 +81,11 @@ static const unsigned null_op = -0x100; #define rout(nn) nn, true, true #define rsout(nn, l, s) bs_slice(nn, l, s), true, true #define rnull null_bs, false, false -#define data(...) data_(__VA_ARGS__, rnull, rnull, rnull, rnull) + +#define data(...) data_flags(0, __VA_ARGS__) +#define data_flags(...) data_(__VA_ARGS__, rnull, rnull, rnull, rnull) #define data_(...) data__(__VA_ARGS__) -#define data__(b1, o1, v1, b2, o2, v2, b3, o3, v3, b4, o4, v4, ...) do { \ +#define data__(fl, b1, o1, v1, b2, o2, v2, b3, o3, v3, b4, o4, v4, ...) do { \ P(data)(ctx, \ v1 ? bs_get(b1, ctx->op) : null_op, \ v2 ? bs_get(b2, ctx->op) : null_op, \ @@ -92,7 +94,8 @@ static const unsigned null_op = -0x100; (o1 << 0) | \ (o2 << 1) | \ (o3 << 2) | \ - (o4 << 3)); \ + (o4 << 3) | \ + fl); \ if (TDIS_CTX_MODIFY(ctx)) { \ unsigned new = ctx->op; \ new = bs_set(b1, TDIS_CTX_NEWVAL(ctx, 0), new); \ @@ -116,6 +119,7 @@ static const unsigned null_op = -0x100; #define MIN_INSN_SIZE 2 #define TARGET_DIS_HEADER "dis-arm-multi.inc.h" struct arch_dis_ctx { unsigned thumb_it_length; }; + enum { IS_LDRD_STRD = 1 << 16 }; #elif defined(TARGET_arm64) #define MIN_INSN_SIZE 4 #define TARGET_DIS_HEADER "dis-arm64.inc.h" -- cgit v1.2.3