diff options
author | comex | 2015-01-11 22:19:44 -0500 |
---|---|---|
committer | comex | 2015-01-11 22:19:44 -0500 |
commit | b47b52576e253ff2fd1347597f7af5cf074bc62b (patch) | |
tree | 501d1f426cdde88d9af0d5a7c67695824c4e9a11 /lib/dis-arm64.inc.h | |
parent | thumb2 and stuff (diff) | |
download | substitute-b47b52576e253ff2fd1347597f7af5cf074bc62b.tar.gz |
that was easy
Diffstat (limited to 'lib/dis-arm64.inc.h')
-rw-r--r-- | lib/dis-arm64.inc.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/dis-arm64.inc.h b/lib/dis-arm64.inc.h new file mode 100644 index 0000000..d99cae7 --- /dev/null +++ b/lib/dis-arm64.inc.h @@ -0,0 +1,27 @@ +static INLINE tdis_ret P(adrlabel_label_unk_Xd_1_ADR)(tdis_ctx ctx, struct bitslice Xd, struct bitslice label) { + return P(pcrel)(ctx, ctx->pc + sext(bs_get(label, ctx->op), 22), bs_get(Xd, ctx->op), false); +} +static INLINE tdis_ret P(adrplabel_label_unk_Xd_1_ADRP)(tdis_ctx ctx, struct bitslice Xd, struct bitslice label) { + return P(pcrel)(ctx, ctx->pc + (sext(bs_get(label, ctx->op), 22) << 12), bs_get(Xd, ctx->op), false); +} +static INLINE tdis_ret P(am_b_target_addr_B_1_B)(tdis_ctx ctx, struct bitslice addr) { + return P(branch)(ctx, ctx->pc + sext(bs_get(addr, ctx->op), 26) * 4); +} +static INLINE tdis_ret P(am_bl_target_addr_1_BL)(tdis_ctx ctx, struct bitslice addr) { + return P(branch)(ctx, ctx->pc + sext(bs_get(addr, ctx->op), 26) * 4); +} +static INLINE tdis_ret P(am_brcond_target_B_5_Bcc)(tdis_ctx ctx, struct bitslice target) { + return P(branch)(ctx, ctx->pc + sext(bs_get(target, ctx->op), 19) * 4); +} +static INLINE tdis_ret P(am_ldrlit_label_unk_Rt_6_LDRDl)(tdis_ctx ctx, struct bitslice Rt, struct bitslice label) { + return P(pcrel)(ctx, ctx->pc + sext(bs_get(label, ctx->op), 19) * 4, bs_get(Rt, ctx->op), true); +} +static INLINE tdis_ret P(am_tbrcond_target_B_4_TBNZW)(tdis_ctx ctx, struct bitslice target) { + return P(branch)(ctx, ctx->pc + sext(bs_get(target, ctx->op), 14) * 4); +} + +static tdis_ret P(dis_arm64)(tdis_ctx ctx) { + unsigned op = ctx->op; + #include "../generated/transform-dis-arm64.inc.h" + __builtin_abort(); +} |