aboutsummaryrefslogtreecommitdiff
path: root/lib/arm/assemble.h
diff options
context:
space:
mode:
authorYifan Lu2016-11-23 17:25:19 -0600
committerYifan Lu2016-11-23 17:25:19 -0600
commitbbfc407fd6cb437c9cc720de1f4dfbb9050dccd4 (patch)
treeba915dfbb0ed068adcc5c9574fdc2436d7a4845a /lib/arm/assemble.h
parentFixed defination of CC_CBXZ collides with other bits (diff)
downloadsubstitute-bbfc407fd6cb437c9cc720de1f4dfbb9050dccd4.tar.gz
Changes to reflect older changes in merge
Diffstat (limited to 'lib/arm/assemble.h')
-rw-r--r--lib/arm/assemble.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/arm/assemble.h b/lib/arm/assemble.h
index 3066802..91b273e 100644
--- a/lib/arm/assemble.h
+++ b/lib/arm/assemble.h
@@ -120,14 +120,15 @@ static inline void Bccrel(struct assemble_ctx ctx, int offset) {
}
static inline void LDR_PC(struct assemble_ctx ctx, uint32_t dpc) {
- if (actx_pc(ctx) & 2)
+ int align = !!(actx_pc(ctx) & 2);
+ if (align)
op16(ctx.codep, 0xbf00);
if (ctx.thumb)
op32(ctx.codep, 0xf000f8df);
else
op32(ctx.codep, 0x051ff004 | ctx.cond << 28);
op32(ctx.codep, (uint32_t) dpc);
- if (ctx.pc & 2) // for alignment
+ if (align)
op16(ctx.codep, 0xbf00);
}