Skip to contentSkip to conversation

tcg patch queue

GIT PULL Applied Richard Henderson 2 participants 6 messages Jun 4, 2014 – Jun 5, 2014

lore
Share & tools
lore
#0 lore raw

TCG patches accumulated over the last 2 weeks.
Please pull.

r~

The following changes since commit e00fcfeab3d452cba3d0a08991a39ab15df66424:

Merge remote-tracking branch 'remotes/awilliam/tags/vfio-pci-for-qemu-20140602.0' into staging (2014-06-03 14:37:43 +0100)

are available in the git repository at:

git://github.com/rth7680/qemu.git tcg-next

for you to fetch changes up to e3eb9806c70c7315336b5e310a841c8f381dacea:

TCG: Fix tcg_gen_extr_i64_tl for 32bit (2014-06-04 14:11:45 -0700)

----------------------------------------------------------------
Alexander Graf (1):
TCG: Fix tcg_gen_extr_i64_tl for 32bit

Richard Henderson (3):
tcg-i386: Fix win64 qemu store
tci: Convert to new ldst opcodes
tcg: Remove TCG_TARGET_HAS_new_ldst

 tcg/aarch64/tcg-target.h |   2 -
 tcg/arm/tcg-target.h     |   2 -
 tcg/i386/tcg-target.c    |   3 +-
 tcg/i386/tcg-target.h    |   2 -
 tcg/ia64/tcg-target.h    |   2 -
 tcg/mips/tcg-target.h    |   2 -
 tcg/optimize.c           |   5 -
 tcg/ppc/tcg-target.h     |   2 -
 tcg/ppc64/tcg-target.h   |   2 -
 tcg/s390/tcg-target.h    |   2 -
 tcg/sparc/tcg-target.h   |   2 -
 tcg/tcg-op.h             |   2 +-
 tcg/tcg-opc.h            | 114 +++--------------
 tcg/tcg.c                | 123 +++---------------
 tcg/tci/tcg-target.c     |  76 +++++------
 tcg/tci/tcg-target.h     |   2 -
 tci.c                    | 322 ++++++++++++++++++++++++++---------------------
 17 files changed, 237 insertions(+), 428 deletions(-)
#1 lore raw

[Qemu-devel] [PULL 1/4] tcg-i386: Fix win64 qemu store

The first non-register argument isn't placed at offset 0.

---
 tcg/i386/tcg-target.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tcg/i386/tcg-target.c +2 -1
index d910233..4133dcf 100644
@@ -1407,7 +1407,8 @@ static void tcg_out_qemu_st_slow_path(TCGContext *s, TCGLabelQemuLdst *l)
         } else {
             retaddr = TCG_REG_RAX;
             tcg_out_movi(s, TCG_TYPE_PTR, retaddr, (uintptr_t)l->raddr);
-            tcg_out_st(s, TCG_TYPE_PTR, retaddr, TCG_REG_ESP, 0);
+            tcg_out_st(s, TCG_TYPE_PTR, retaddr, TCG_REG_ESP,
+                       TCG_TARGET_CALL_STACK_OFFSET);
         }
     }
 
Signature · 1 line
1.9.3
#2 lore raw

[Qemu-devel] [PULL 2/4] tci: Convert to new ldst opcodes

In reply to Richard Henderson
---
 tcg/tci/tcg-target.c |  76 +++++-------
 tcg/tci/tcg-target.h |   2 +-
 tci.c                | 322 ++++++++++++++++++++++++++++-----------------------
 3 files changed, 207 insertions(+), 193 deletions(-)
tcg/tci/tcg-target.c +30 -46
index 375e590..03a7b46 100644
@@ -227,21 +227,11 @@ static const TCGTargetOpDef tcg_target_op_defs[] = {
 #endif
 #endif /* TCG_TARGET_REG_BITS == 64 */
 
-    { INDEX_op_qemu_ld8u, { R, L } },
-    { INDEX_op_qemu_ld8s, { R, L } },
-    { INDEX_op_qemu_ld16u, { R, L } },
-    { INDEX_op_qemu_ld16s, { R, L } },
-    { INDEX_op_qemu_ld32, { R, L } },
-#if TCG_TARGET_REG_BITS == 64
-    { INDEX_op_qemu_ld32u, { R, L } },
-    { INDEX_op_qemu_ld32s, { R, L } },
-#endif
-    { INDEX_op_qemu_ld64, { R64, L } },
+    { INDEX_op_qemu_ld_i32, { R, L } },
+    { INDEX_op_qemu_ld_i64, { R64, L } },
 
-    { INDEX_op_qemu_st8, { R, S } },
-    { INDEX_op_qemu_st16, { R, S } },
-    { INDEX_op_qemu_st32, { R, S } },
-    { INDEX_op_qemu_st64, { R64, S } },
+    { INDEX_op_qemu_st_i32, { R, S } },
+    { INDEX_op_qemu_st_i64, { R64, S } },
 
 #if TCG_TARGET_HAS_ext8s_i32
     { INDEX_op_ext8s_i32, { R, R } },
@@ -767,58 +757,52 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args,
         tcg_out8(s, args[2]);           /* condition */
         tci_out_label(s, args[3]);
         break;
-    case INDEX_op_qemu_ld8u:
-    case INDEX_op_qemu_ld8s:
-    case INDEX_op_qemu_ld16u:
-    case INDEX_op_qemu_ld16s:
-    case INDEX_op_qemu_ld32:
-#if TCG_TARGET_REG_BITS == 64
-    case INDEX_op_qemu_ld32s:
-    case INDEX_op_qemu_ld32u:
-#endif
+    case INDEX_op_qemu_ld_i32:
         tcg_out_r(s, *args++);
         tcg_out_r(s, *args++);
-#if TARGET_LONG_BITS > TCG_TARGET_REG_BITS
-        tcg_out_r(s, *args++);
-#endif
+        if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) {
+            tcg_out_r(s, *args++);
+        }
+        tcg_out_i(s, *args++);
 #ifdef CONFIG_SOFTMMU
         tcg_out_i(s, *args);
 #endif
         break;
-    case INDEX_op_qemu_ld64:
-        tcg_out_r(s, *args++);
-#if TCG_TARGET_REG_BITS == 32
+    case INDEX_op_qemu_ld_i64:
         tcg_out_r(s, *args++);
-#endif
-        tcg_out_r(s, *args++);
-#if TARGET_LONG_BITS > TCG_TARGET_REG_BITS
+        if (TCG_TARGET_REG_BITS == 32) {
+            tcg_out_r(s, *args++);
+        }
         tcg_out_r(s, *args++);
-#endif
+        if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) {
+            tcg_out_r(s, *args++);
+        }
+        tcg_out_i(s, *args++);
 #ifdef CONFIG_SOFTMMU
         tcg_out_i(s, *args);
 #endif
         break;
-    case INDEX_op_qemu_st8:
-    case INDEX_op_qemu_st16:
-    case INDEX_op_qemu_st32:
+    case INDEX_op_qemu_st_i32:
         tcg_out_r(s, *args++);
         tcg_out_r(s, *args++);
-#if TARGET_LONG_BITS > TCG_TARGET_REG_BITS
-        tcg_out_r(s, *args++);
-#endif
+        if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) {
+            tcg_out_r(s, *args++);
+        }
+        tcg_out_i(s, *args++);
 #ifdef CONFIG_SOFTMMU
         tcg_out_i(s, *args);
 #endif
         break;
-    case INDEX_op_qemu_st64:
-        tcg_out_r(s, *args++);
-#if TCG_TARGET_REG_BITS == 32
-        tcg_out_r(s, *args++);
-#endif
+    case INDEX_op_qemu_st_i64:
         tcg_out_r(s, *args++);
-#if TARGET_LONG_BITS > TCG_TARGET_REG_BITS
+        if (TCG_TARGET_REG_BITS == 32) {
+            tcg_out_r(s, *args++);
+        }
         tcg_out_r(s, *args++);
-#endif
+        if (TARGET_LONG_BITS > TCG_TARGET_REG_BITS) {
+            tcg_out_r(s, *args++);
+        }
+        tcg_out_i(s, *args++);
 #ifdef CONFIG_SOFTMMU
         tcg_out_i(s, *args);
 #endif
tcg/tci/tcg-target.h +1 -1
index 0be5acd..6319303 100644
@@ -118,7 +118,7 @@
 #define TCG_TARGET_HAS_mulu2_i32        1
 #endif /* TCG_TARGET_REG_BITS == 64 */
 
-#define TCG_TARGET_HAS_new_ldst         0
+#define TCG_TARGET_HAS_new_ldst         1
 
 /* Number of registers available.
    For 32 bit hosts, we need more than 8 registers (call arguments). */
tci.c +176 -146

369 lines not on this page · raw message

Signature · 1 line
1.9.3
#3 lore raw

[Qemu-devel] [PULL 3/4] tcg: Remove TCG_TARGET_HAS_new_ldst

In reply to Richard Henderson

Since all backends have been converted, remove the compatibility code.

---
 tcg/aarch64/tcg-target.h |   2 -
 tcg/arm/tcg-target.h     |   2 -
 tcg/i386/tcg-target.h    |   2 -
 tcg/ia64/tcg-target.h    |   2 -
 tcg/mips/tcg-target.h    |   2 -
 tcg/optimize.c           |   5 --
 tcg/ppc/tcg-target.h     |   2 -
 tcg/ppc64/tcg-target.h   |   2 -
 tcg/s390/tcg-target.h    |   2 -
 tcg/sparc/tcg-target.h   |   2 -
 tcg/tcg-opc.h            | 114 ++++++-------------------------------------
 tcg/tcg.c                | 123 ++++++-----------------------------------------
 tcg/tci/tcg-target.h     |   2 -
 13 files changed, 28 insertions(+), 234 deletions(-)
tcg/aarch64/tcg-target.h +0 -2
index a32aea6..60c7493 100644
@@ -99,8 +99,6 @@ typedef enum {
 #define TCG_TARGET_HAS_muluh_i64        1
 #define TCG_TARGET_HAS_mulsh_i64        1
 
-#define TCG_TARGET_HAS_new_ldst         1
-
 static inline void flush_icache_range(uintptr_t start, uintptr_t stop)
 {
     __builtin___clear_cache((char *)start, (char *)stop);
tcg/arm/tcg-target.h +0 -2
index 73f10c4..1c719e2 100644
@@ -86,8 +86,6 @@ extern bool use_idiv_instructions;
 #define TCG_TARGET_HAS_div_i32          use_idiv_instructions
 #define TCG_TARGET_HAS_rem_i32          0
 
-#define TCG_TARGET_HAS_new_ldst         1
-
 extern bool tcg_target_deposit_valid(int ofs, int len);
 #define TCG_TARGET_deposit_i32_valid  tcg_target_deposit_valid
 
tcg/i386/tcg-target.h +0 -2
index 6c94e5c..7a9980e 100644
@@ -130,8 +130,6 @@ extern bool have_bmi1;
 #define TCG_TARGET_HAS_mulsh_i64        0
 #endif
 
-#define TCG_TARGET_HAS_new_ldst         1
-
 #define TCG_TARGET_deposit_i32_valid(ofs, len) \
     (((ofs) == 0 && (len) == 8) || ((ofs) == 8 && (len) == 8) || \
      ((ofs) == 0 && (len) == 16))
tcg/ia64/tcg-target.h +0 -2
index 3a59b50..d675589 100644
@@ -160,8 +160,6 @@ typedef enum {
 #define TCG_TARGET_HAS_mulsh_i64        0
 #define TCG_TARGET_HAS_trunc_shr_i32    0
 
-#define TCG_TARGET_HAS_new_ldst         1
-
 #define TCG_TARGET_deposit_i32_valid(ofs, len) ((len) <= 16)
 #define TCG_TARGET_deposit_i64_valid(ofs, len) ((len) <= 16)
 
tcg/mips/tcg-target.h +0 -2
index b5face8..c88a1c9 100644
@@ -118,8 +118,6 @@ extern bool use_mips32r2_instructions;
 #define TCG_TARGET_HAS_ext16s_i32       use_mips32r2_instructions
 #define TCG_TARGET_HAS_rot_i32          use_mips32r2_instructions
 
-#define TCG_TARGET_HAS_new_ldst         1
-
 /* optional instructions automatically implemented */
 #define TCG_TARGET_HAS_neg_i32          0 /* sub  rd, zero, rt   */
 #define TCG_TARGET_HAS_ext8u_i32        0 /* andi rt, rs, 0xff   */
tcg/optimize.c +0 -5
index 77da2f9..16cebbe 100644
@@ -889,17 +889,12 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
             break;
 
         CASE_OP_32_64(ld8u):
-        case INDEX_op_qemu_ld8u:
             mask = 0xff;
             break;
         CASE_OP_32_64(ld16u):
-        case INDEX_op_qemu_ld16u:
             mask = 0xffff;
             break;
         case INDEX_op_ld32u_i64:
-#if TCG_TARGET_REG_BITS == 64
-        case INDEX_op_qemu_ld32u:
-#endif
             mask = 0xffffffffu;
             break;
 
tcg/ppc/tcg-target.h +0 -2
index dd7e557..05069ae 100644
@@ -100,8 +100,6 @@ typedef enum {
 #define TCG_TARGET_HAS_muluh_i32        0
 #define TCG_TARGET_HAS_mulsh_i32        0
 
-#define TCG_TARGET_HAS_new_ldst         1
-
 #define TCG_AREG0 TCG_REG_R27
 
 #define tcg_qemu_tb_exec(env, tb_ptr) \
tcg/ppc64/tcg-target.h +0 -2
index 29f479a..f2360c8 100644
@@ -124,8 +124,6 @@ typedef enum {
 #define TCG_TARGET_HAS_muluh_i64        1
 #define TCG_TARGET_HAS_mulsh_i64        1
 
-#define TCG_TARGET_HAS_new_ldst         1
-
 #define TCG_AREG0 TCG_REG_R27
 
 #define TCG_TARGET_EXTEND_ARGS 1
tcg/s390/tcg-target.h +0 -2
index ad2c6dd..5acc28c 100644
@@ -100,8 +100,6 @@ typedef enum TCGReg {
 #define TCG_TARGET_HAS_muluh_i64        0
 #define TCG_TARGET_HAS_mulsh_i64        0
 
-#define TCG_TARGET_HAS_new_ldst         1
-
 extern bool tcg_target_deposit_valid(int ofs, int len);
 #define TCG_TARGET_deposit_i32_valid  tcg_target_deposit_valid
 #define TCG_TARGET_deposit_i64_valid  tcg_target_deposit_valid
tcg/sparc/tcg-target.h +0 -2
index 473bfc7..089f976 100644
@@ -140,8 +140,6 @@ typedef enum {
 #define TCG_TARGET_HAS_muluh_i64        0
 #define TCG_TARGET_HAS_mulsh_i64        0
 
-#define TCG_TARGET_HAS_new_ldst         1
-
 #define TCG_AREG0 TCG_REG_I0
 
 static inline void flush_icache_range(uintptr_t start, uintptr_t stop)
tcg/tcg-opc.h +14 -100

120 lines not on this page · raw message

tcg/tcg.c +14 -109

155 lines not on this page · raw message

tcg/tci/tcg-target.h +0 -2
index 6319303..bd1e974 100644
@@ -118,8 +118,6 @@
 #define TCG_TARGET_HAS_mulu2_i32        1
 #endif /* TCG_TARGET_REG_BITS == 64 */
 
-#define TCG_TARGET_HAS_new_ldst         1
-
 /* Number of registers available.
    For 32 bit hosts, we need more than 8 registers (call arguments). */
 /* #define TCG_TARGET_NB_REGS 8 */
Signature · 1 line
1.9.3
#4 lore raw

[Qemu-devel] [PULL 4/4] TCG: Fix tcg_gen_extr_i64_tl for 32bit

In reply to Richard Henderson

From: Alexander Graf <[email protected]>

We expose a generic helper "tcg_gen_extr_i64_tl" for 64bit targets, but the same function for 32bit targets is a misnomer and refers to an invalid function name.

Fix up the definition to point to the correct internal helper names instead.

---
 tcg/tcg-op.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tcg/tcg-op.h +1 -1
index 719533a..019dd9b 100644
@@ -2718,7 +2718,7 @@ static inline void tcg_gen_qemu_st64(TCGv_i64 arg, TCGv addr, int mem_index)
 #define tcg_gen_bswap16_tl tcg_gen_bswap16_i32
 #define tcg_gen_bswap32_tl tcg_gen_bswap32_i32
 #define tcg_gen_concat_tl_i64 tcg_gen_concat_i32_i64
-#define tcg_gen_extr_tl_i64 tcg_gen_extr_i32_i64
+#define tcg_gen_extr_i64_tl tcg_gen_extr_i64_i32
 #define tcg_gen_andc_tl tcg_gen_andc_i32
 #define tcg_gen_eqv_tl tcg_gen_eqv_i32
 #define tcg_gen_nand_tl tcg_gen_nand_i32
Signature · 1 line
1.9.3
#5 lore raw
In reply to Richard Henderson
Quoted 11 lines · Richard Henderson

TCG patches accumulated over the last 2 weeks.
Please pull.

r~

The following changes since commit e00fcfeab3d452cba3d0a08991a39ab15df66424:

Merge remote-tracking branch 'remotes/awilliam/tags/vfio-pci-for-qemu-20140602.0' into staging (2014-06-03 14:37:43 +0100)

Quoted 7 lines

are available in the git repository at:

git://github.com/rth7680/qemu.git tcg-next

for you to fetch changes up to e3eb9806c70c7315336b5e310a841c8f381dacea:

TCG: Fix tcg_gen_extr_i64_tl for 32bit (2014-06-04 14:11:45 -0700

Applied, thanks.

-- PMM