aboutsummaryrefslogtreecommitdiff
path: root/tcg/x86_64
diff options
context:
space:
mode:
Diffstat (limited to 'tcg/x86_64')
-rw-r--r--tcg/x86_64/tcg-target.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/tcg/x86_64/tcg-target.c b/tcg/x86_64/tcg-target.c
index 8b0f472715..9cd89b2778 100644
--- a/tcg/x86_64/tcg-target.c
+++ b/tcg/x86_64/tcg-target.c
@@ -356,16 +356,22 @@ static inline void tcg_out_movi(TCGContext *s, TCGType type,
}
}
-static inline void tcg_out_ld(TCGContext *s, int ret,
+static inline void tcg_out_ld(TCGContext *s, TCGType type, int ret,
int arg1, tcg_target_long arg2)
{
- tcg_out_modrm_offset(s, 0x8b | P_REXW, ret, arg1, arg2); /* movq */
+ if (type == TCG_TYPE_I32)
+ tcg_out_modrm_offset(s, 0x8b, ret, arg1, arg2); /* movl */
+ else
+ tcg_out_modrm_offset(s, 0x8b | P_REXW, ret, arg1, arg2); /* movq */
}
-static inline void tcg_out_st(TCGContext *s, int arg,
+static inline void tcg_out_st(TCGContext *s, TCGType type, int arg,
int arg1, tcg_target_long arg2)
{
- tcg_out_modrm_offset(s, 0x89 | P_REXW, arg, arg1, arg2); /* movq */
+ if (type == TCG_TYPE_I32)
+ tcg_out_modrm_offset(s, 0x89, arg, arg1, arg2); /* movl */
+ else
+ tcg_out_modrm_offset(s, 0x89 | P_REXW, arg, arg1, arg2); /* movq */
}
static inline void tgen_arithi32(TCGContext *s, int c, int r0, int32_t val)