]> Git Repo - qemu.git/blobdiff - tcg/x86_64/tcg-target.c
Fix i32 memory backed variables on 64-bit host
[qemu.git] / tcg / x86_64 / tcg-target.c
index 8b0f472715d1613d8707adc3367d7ff7df7209d4..9cd89b27784e6321ace240f9c38a58d8c4f0e497 100644 (file)
@@ -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)
This page took 0.023452 seconds and 4 git commands to generate.