提交 2bb8656d 编写于 作者: R Richard Henderson

tcg: Tidy generated code for tcg_outN

Aliasing was forcing s->code_ptr to be re-read after the store.
Keep the pointer in a local variable to help the compiler.
Signed-off-by: NRichard Henderson <rth@twiddle.net>
上级 f7ad538e
......@@ -121,14 +121,16 @@ static inline void tcg_out8(TCGContext *s, uint8_t v)
static inline void tcg_out16(TCGContext *s, uint16_t v)
{
*(uint16_t *)s->code_ptr = v;
s->code_ptr += 2;
uint8_t *p = s->code_ptr;
*(uint16_t *)p = v;
s->code_ptr = p + 2;
}
static inline void tcg_out32(TCGContext *s, uint32_t v)
{
*(uint32_t *)s->code_ptr = v;
s->code_ptr += 4;
uint8_t *p = s->code_ptr;
*(uint32_t *)p = v;
s->code_ptr = p + 4;
}
/* label relocation processing */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册