diff options
author | comex | 2015-01-12 01:21:43 -0500 |
---|---|---|
committer | comex | 2015-01-12 01:22:20 -0500 |
commit | 21277f290a705c6382453f348e4a224cd7695320 (patch) | |
tree | b3eac4e66f7aec0dede880e7405171c413497a68 /lib/dis-thumb2.inc.h | |
parent | minor improvements (diff) | |
download | substitute-21277f290a705c6382453f348e4a224cd7695320.tar.gz |
these functions are actually pointless, since it's easier to change the *offset* for actual pc-rel loads (and the rest are accounted for, albeit implicitly in the case of add pc)
i might end up using the stack :/
Diffstat (limited to '')
-rw-r--r-- | lib/dis-thumb2.inc.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/dis-thumb2.inc.h b/lib/dis-thumb2.inc.h index e18f268..819471d 100644 --- a/lib/dis-thumb2.inc.h +++ b/lib/dis-thumb2.inc.h @@ -1,4 +1,15 @@ #include "dis.h" + +static inline enum pcrel_load_mode get_load_mode(unsigned op) { + bool sign = (op >> 8) & 1; + switch ((op >> 5) & 3) { + case 0: return sign ? PLM_S8 : PLM_U8; + case 1: return sign ? PLM_S16 : PLM_U16; + case 2: return sign ? PLM_S32 : PLM_U32; + default: __builtin_abort(); + } +} + static INLINE tdis_ret P(GPR_Rm_unk_Rd_1_t2MOVr)(tdis_ctx ctx, struct bitslice Rm, struct bitslice Rd) { data(rout(Rd), r(Rm)); } @@ -148,8 +159,4 @@ static INLINE tdis_ret P(unk_Rt_13_VMOVRRD)(tdis_ctx ctx, UNUSED struct bitslice return P(unidentified)(ctx); } -static tdis_ret P(dis_thumb2)(tdis_ctx ctx) { - unsigned op = ctx->op; - #include "../generated/transform-dis-thumb2.inc.h" - __builtin_abort(); -} +#define GENERATED_HEADER "../generated/transform-dis-thumb2.inc.h" |