aboutsummaryrefslogtreecommitdiff
path: root/lib/arm/dis-arm.inc.h
diff options
context:
space:
mode:
authorcomex2016-11-15 21:57:23 -0500
committercomex2016-11-15 21:57:23 -0500
commit66bd9f17e9467b1eb5d6b2098b02241f03f8bbf6 (patch)
treedb2bde0572ddac99f148d46c43c7122849fb7487 /lib/arm/dis-arm.inc.h
parentfix bool arguments with false default (diff)
downloadsubstitute-66bd9f17e9467b1eb5d6b2098b02241f03f8bbf6.tar.gz
fix some ARM stuff including calls, and test it
wow this code sucks
Diffstat (limited to 'lib/arm/dis-arm.inc.h')
-rw-r--r--lib/arm/dis-arm.inc.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/arm/dis-arm.inc.h b/lib/arm/dis-arm.inc.h
index 18285cd..021227c 100644
--- a/lib/arm/dis-arm.inc.h
+++ b/lib/arm/dis-arm.inc.h
@@ -164,7 +164,7 @@ static INLINE void P(adrlabel_label_unk_Rd_1_ADR)(tdis_ctx ctx, struct bitslice
}
static INLINE void P(br_target_target_pred_p_B_1_Bcc)(tdis_ctx ctx, struct bitslice target, struct bitslice p) {
unsigned p_val = bs_get(p, ctx->base.op);
- return P(branch)(ctx, ctx->base.pc + 8 + sext(bs_get(target, ctx->base.op), 24),
+ return P(branch)(ctx, ctx->base.pc + 8 + 4 * sext(bs_get(target, ctx->base.op), 24),
p_val == 0xe ? 0 : (CC_ARMCC | p_val));
}
static INLINE void P(ldst_so_reg_addr_unk_Rt_2_LDRB_PRE_REG)(tdis_ctx ctx, struct bitslice addr, struct bitslice Rt) {
@@ -210,8 +210,9 @@ static INLINE void P(GPR_func_3_BLX)(tdis_ctx ctx, UNUSED struct bitslice func)
return P(indirect_call)(ctx);
}
static INLINE void P(bl_target_func_2_BL)(tdis_ctx ctx, struct bitslice func) {
- return P(branch)(ctx, ctx->base.pc + 8 + sext(bs_get(func, ctx->base.op), 24),
- CC_CALL);
+ unsigned p_val = ctx->base.op >> 28; // XXX fix this to actually be an op
+ return P(branch)(ctx, ctx->base.pc + 8 + 4 * sext(bs_get(func, ctx->base.op), 24),
+ CC_CALL | (p_val == 0xe ? 0 : (CC_ARMCC | p_val)));
}
static INLINE void P(dis_arm)(tdis_ctx ctx) {