All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches
@ 2016-11-01 12:07 Richard Henderson
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 1/9] target-cris: Do not dump cpu state with -d in_asm Richard Henderson
                   ` (10 more replies)
  0 siblings, 11 replies; 21+ messages in thread
From: Richard Henderson @ 2016-11-01 12:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

V2, now with more windows workarounds.  I'll note that I have not
been 100% successful in actually building a mingw64 image.  But
at least the error Peter saw with v1 is fixed.

I'll report on the other mingw64 failures under separate cover.


r~



The following changes since commit e80b4b8fb6babce7dcc91ea9ddeecbc351fd4646:

  Merge remote-tracking branch 'remotes/awilliam/tags/vfio-updates-20161031.0' into staging (2016-10-31 18:19:06 +0000)

are available in the git repository at:

  git://github.com/rth7680/qemu.git tags/pull-tcg-20161101

for you to fetch changes up to 13110e2d41d0b9d77edea5b23e1a808c86eb22cb:

  tcg: correct 32-bit tcg_gen_ld8s_i64 sign-extension (2016-10-31 21:36:29 -0600)

----------------------------------------------------------------
tcg queued patches

----------------------------------------------------------------
Joseph Myers (1):
      tcg: correct 32-bit tcg_gen_ld8s_i64 sign-extension

Peter Maydell (1):
      tcg/tcg.h: Improve documentation of TCGv_i32 etc types

Pranith Kumar (1):
      MAINTAINERS: Update PPC status and maintainer

Richard Henderson (6):
      target-cris: Do not dump cpu state with -d in_asm
      target-microblaze: Do not dump cpu state with -d in_asm
      target-openrisc: Do not dump cpu state with -d in_asm
      log: Add locking to large logging blocks
      tcg: Add tcg_gen_mulsu2_{i32,i64,tl}
      target-microblaze: Cleanup dec_mul

 MAINTAINERS                   |  4 +--
 cpu-exec.c                    |  2 ++
 exec.c                        |  2 ++
 include/qemu/log.h            | 16 ++++++++++
 include/sysemu/os-posix.h     | 12 ++++++++
 include/sysemu/os-win32.h     | 11 +++++++
 target-alpha/translate.c      |  2 ++
 target-arm/translate-a64.c    |  2 ++
 target-arm/translate.c        |  2 ++
 target-cris/translate.c       | 27 +++-------------
 target-i386/translate.c       |  4 +++
 target-lm32/translate.c       |  2 ++
 target-m68k/translate.c       |  2 ++
 target-microblaze/translate.c | 72 ++++++++-----------------------------------
 target-mips/translate.c       |  2 ++
 target-openrisc/translate.c   |  9 +++---
 target-ppc/translate.c        |  2 ++
 target-s390x/translate.c      |  2 ++
 target-sh4/translate.c        |  2 ++
 target-sparc/translate.c      |  2 ++
 target-tilegx/translate.c     |  6 +++-
 target-tricore/translate.c    |  2 ++
 target-unicore32/translate.c  |  2 ++
 target-xtensa/translate.c     |  2 ++
 tcg/tcg-op.c                  | 45 ++++++++++++++++++++++++++-
 tcg/tcg-op.h                  |  4 +++
 tcg/tcg.c                     |  8 +++++
 tcg/tcg.h                     | 38 ++++++++++++++++++-----
 translate-all.c               |  2 ++
 29 files changed, 188 insertions(+), 100 deletions(-)

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [Qemu-devel] [PULL v2 for-2.8 1/9] target-cris: Do not dump cpu state with -d in_asm
  2016-11-01 12:07 [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches Richard Henderson
@ 2016-11-01 12:07 ` Richard Henderson
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 2/9] target-microblaze: " Richard Henderson
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Richard Henderson @ 2016-11-01 12:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

Dumping cpu state is what -d cpu is for.

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target-cris/translate.c | 25 ++-----------------------
 1 file changed, 2 insertions(+), 23 deletions(-)

diff --git a/target-cris/translate.c b/target-cris/translate.c
index b5ab0a5..8d4c864 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -3135,29 +3135,6 @@ void gen_intermediate_code(CPUCRISState *env, struct TranslationBlock *tb)
 
     dc->cpustate_changed = 0;
 
-    if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)) {
-        qemu_log(
-                "pc=%x %x flg=%" PRIx64 " bt=%x ds=%u ccs=%x\n"
-                "pid=%x usp=%x\n"
-                "%x.%x.%x.%x\n"
-                "%x.%x.%x.%x\n"
-                "%x.%x.%x.%x\n"
-                "%x.%x.%x.%x\n",
-                dc->pc, dc->ppc,
-                (uint64_t)tb->flags,
-                env->btarget, (unsigned)tb->flags & 7,
-                env->pregs[PR_CCS],
-                env->pregs[PR_PID], env->pregs[PR_USP],
-                env->regs[0], env->regs[1], env->regs[2], env->regs[3],
-                env->regs[4], env->regs[5], env->regs[6], env->regs[7],
-                env->regs[8], env->regs[9],
-                env->regs[10], env->regs[11],
-                env->regs[12], env->regs[13],
-                env->regs[14], env->regs[15]);
-        qemu_log("--------------\n");
-        qemu_log("IN: %s\n", lookup_symbol(pc_start));
-    }
-
     next_page_start = (pc_start & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE;
     num_insns = 0;
     max_insns = tb->cflags & CF_COUNT_MASK;
@@ -3313,6 +3290,8 @@ void gen_intermediate_code(CPUCRISState *env, struct TranslationBlock *tb)
 #if !DISAS_CRIS
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
         && qemu_log_in_addr_range(pc_start)) {
+        qemu_log("--------------\n");
+        qemu_log("IN: %s\n", lookup_symbol(pc_start));
         log_target_disas(cs, pc_start, dc->pc - pc_start,
                          env->pregs[PR_VR]);
         qemu_log("\nisize=%d osize=%d\n",
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [Qemu-devel] [PULL v2 for-2.8 2/9] target-microblaze: Do not dump cpu state with -d in_asm
  2016-11-01 12:07 [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches Richard Henderson
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 1/9] target-cris: Do not dump cpu state with -d in_asm Richard Henderson
@ 2016-11-01 12:07 ` Richard Henderson
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 3/9] target-openrisc: " Richard Henderson
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Richard Henderson @ 2016-11-01 12:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

Dumping cpu state is what -d cpu is for.

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target-microblaze/translate.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index 80098ec..5a4a8b9 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -1670,13 +1670,6 @@ void gen_intermediate_code(CPUMBState *env, struct TranslationBlock *tb)
         cpu_abort(cs, "Microblaze: unaligned PC=%x\n", pc_start);
     }
 
-    if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)) {
-#if !SIM_COMPAT
-        qemu_log("--------------\n");
-        log_cpu_state(CPU(cpu), 0);
-#endif
-    }
-
     next_page_start = (pc_start & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE;
     num_insns = 0;
     max_insns = tb->cflags & CF_COUNT_MASK;
@@ -1820,7 +1813,7 @@ void gen_intermediate_code(CPUMBState *env, struct TranslationBlock *tb)
 #if !SIM_COMPAT
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
         && qemu_log_in_addr_range(pc_start)) {
-        qemu_log("\n");
+        qemu_log("--------------\n");
 #if DISAS_GNU
         log_target_disas(cs, pc_start, dc->pc - pc_start, 0);
 #endif
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [Qemu-devel] [PULL v2 for-2.8 3/9] target-openrisc: Do not dump cpu state with -d in_asm
  2016-11-01 12:07 [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches Richard Henderson
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 1/9] target-cris: Do not dump cpu state with -d in_asm Richard Henderson
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 2/9] target-microblaze: " Richard Henderson
@ 2016-11-01 12:07 ` Richard Henderson
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 4/9] log: Add locking to large logging blocks Richard Henderson
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Richard Henderson @ 2016-11-01 12:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Jia Liu

Dumping cpu state is what -d cpu is for.

Cc: Jia Liu <proljc@gmail.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target-openrisc/translate.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/target-openrisc/translate.c b/target-openrisc/translate.c
index 28c9446..a4625f9 100644
--- a/target-openrisc/translate.c
+++ b/target-openrisc/translate.c
@@ -1651,10 +1651,6 @@ void gen_intermediate_code(CPUOpenRISCState *env, struct TranslationBlock *tb)
     dc->synced_flags = dc->tb_flags = tb->flags;
     dc->delayed_branch = !!(dc->tb_flags & D_FLAG);
     dc->singlestep_enabled = cs->singlestep_enabled;
-    if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)) {
-        qemu_log("-----------------------------------------\n");
-        log_cpu_state(CPU(cpu), 0);
-    }
 
     next_page_start = (pc_start & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE;
     num_insns = 0;
@@ -1754,7 +1750,8 @@ void gen_intermediate_code(CPUOpenRISCState *env, struct TranslationBlock *tb)
 #ifdef DEBUG_DISAS
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
         && qemu_log_in_addr_range(pc_start)) {
-        qemu_log("\n");
+        qemu_log("----------------\n");
+        qemu_log("IN: %s\n", lookup_symbol(pc_start));
         log_target_disas(cs, pc_start, dc->pc - pc_start, 0);
         qemu_log("\nisize=%d osize=%d\n",
                  dc->pc - pc_start, tcg_op_buf_count());
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [Qemu-devel] [PULL v2 for-2.8 4/9] log: Add locking to large logging blocks
  2016-11-01 12:07 [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches Richard Henderson
                   ` (2 preceding siblings ...)
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 3/9] target-openrisc: " Richard Henderson
@ 2016-11-01 12:07 ` Richard Henderson
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 5/9] tcg: Add tcg_gen_mulsu2_{i32, i64, tl} Richard Henderson
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Richard Henderson @ 2016-11-01 12:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

Reuse the existing locking provided by stdio to keep in_asm, cpu,
op, op_opt, op_ind, and out_asm as contiguous blocks.

While it isn't possible to interleave e.g. in_asm or op_opt logs
because of the TB lock protecting all code generation, it is
possible to interleave cpu logs, or to interleave a cpu dump with
an out_asm dump.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 cpu-exec.c                    |  2 ++
 exec.c                        |  2 ++
 include/qemu/log.h            | 16 ++++++++++++++++
 include/sysemu/os-posix.h     | 12 ++++++++++++
 include/sysemu/os-win32.h     | 11 +++++++++++
 target-alpha/translate.c      |  2 ++
 target-arm/translate-a64.c    |  2 ++
 target-arm/translate.c        |  2 ++
 target-cris/translate.c       |  2 ++
 target-i386/translate.c       |  4 ++++
 target-lm32/translate.c       |  2 ++
 target-m68k/translate.c       |  2 ++
 target-microblaze/translate.c |  2 ++
 target-mips/translate.c       |  2 ++
 target-openrisc/translate.c   |  2 ++
 target-ppc/translate.c        |  2 ++
 target-s390x/translate.c      |  2 ++
 target-sh4/translate.c        |  2 ++
 target-sparc/translate.c      |  2 ++
 target-tilegx/translate.c     |  6 +++++-
 target-tricore/translate.c    |  2 ++
 target-unicore32/translate.c  |  2 ++
 target-xtensa/translate.c     |  2 ++
 tcg/tcg.c                     |  8 ++++++++
 translate-all.c               |  2 ++
 25 files changed, 94 insertions(+), 1 deletion(-)

diff --git a/cpu-exec.c b/cpu-exec.c
index 3e40886..4188fed 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -150,11 +150,13 @@ static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock *itb)
 #if defined(DEBUG_DISAS)
     if (qemu_loglevel_mask(CPU_LOG_TB_CPU)
         && qemu_log_in_addr_range(itb->pc)) {
+        qemu_log_lock();
 #if defined(TARGET_I386)
         log_cpu_state(cpu, CPU_DUMP_CCOP);
 #else
         log_cpu_state(cpu, 0);
 #endif
+        qemu_log_unlock();
     }
 #endif /* DEBUG_DISAS */
 
diff --git a/exec.c b/exec.c
index 4d08581..b1094c0 100644
--- a/exec.c
+++ b/exec.c
@@ -911,11 +911,13 @@ void cpu_abort(CPUState *cpu, const char *fmt, ...)
     fprintf(stderr, "\n");
     cpu_dump_state(cpu, stderr, fprintf, CPU_DUMP_FPU | CPU_DUMP_CCOP);
     if (qemu_log_separate()) {
+        qemu_log_lock();
         qemu_log("qemu: fatal: ");
         qemu_log_vprintf(fmt, ap2);
         qemu_log("\n");
         log_cpu_state(cpu, CPU_DUMP_FPU | CPU_DUMP_CCOP);
         qemu_log_flush();
+        qemu_log_unlock();
         qemu_log_close();
     }
     va_end(ap2);
diff --git a/include/qemu/log.h b/include/qemu/log.h
index 00bf37f..a50e994 100644
--- a/include/qemu/log.h
+++ b/include/qemu/log.h
@@ -51,6 +51,22 @@ static inline bool qemu_loglevel_mask(int mask)
     return (qemu_loglevel & mask) != 0;
 }
 
+/* Lock output for a series of related logs.  Since this is not needed
+ * for a single qemu_log / qemu_log_mask / qemu_log_mask_and_addr, we
+ * assume that qemu_loglevel_mask has already been tested, and that
+ * qemu_loglevel is never set when qemu_logfile is unset.
+ */
+
+static inline void qemu_log_lock(void)
+{
+    qemu_flockfile(qemu_logfile);
+}
+
+static inline void qemu_log_unlock(void)
+{
+    qemu_funlockfile(qemu_logfile);
+}
+
 /* Logging functions: */
 
 /* main logging function
diff --git a/include/sysemu/os-posix.h b/include/sysemu/os-posix.h
index 3cfedbc..b0a6c06 100644
--- a/include/sysemu/os-posix.h
+++ b/include/sysemu/os-posix.h
@@ -87,4 +87,16 @@ void *qemu_alloc_stack(size_t *sz);
  */
 void qemu_free_stack(void *stack, size_t sz);
 
+/* POSIX and Mingw32 differ in the name of the stdio lock functions.  */
+
+static inline void qemu_flockfile(FILE *f)
+{
+    flockfile(f);
+}
+
+static inline void qemu_funlockfile(FILE *f)
+{
+    funlockfile(f);
+}
+
 #endif
diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h
index 17aad3b..7492004 100644
--- a/include/sysemu/os-win32.h
+++ b/include/sysemu/os-win32.h
@@ -103,6 +103,17 @@ static inline char *realpath(const char *path, char *resolved_path)
     return resolved_path;
 }
 
+/* POSIX and Mingw32 differ in the name of the stdio lock functions.  */
+
+static inline void qemu_flockfile(FILE *f)
+{
+    _lock_file(f);
+}
+
+static inline void qemu_funlockfile(FILE *f)
+{
+    _unlock_file(f);
+}
 
 /* We wrap all the sockets functions so that we can
  * set errno based on WSAGetLastError()
diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index 03e4776..114927b 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -2994,9 +2994,11 @@ void gen_intermediate_code(CPUAlphaState *env, struct TranslationBlock *tb)
 #ifdef DEBUG_DISAS
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
         && qemu_log_in_addr_range(pc_start)) {
+        qemu_log_lock();
         qemu_log("IN: %s\n", lookup_symbol(pc_start));
         log_target_disas(cs, pc_start, ctx.pc - pc_start, 1);
         qemu_log("\n");
+        qemu_log_unlock();
     }
 #endif
 }
diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c
index ded924a..de48747 100644
--- a/target-arm/translate-a64.c
+++ b/target-arm/translate-a64.c
@@ -11420,11 +11420,13 @@ done_generating:
 #ifdef DEBUG_DISAS
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM) &&
         qemu_log_in_addr_range(pc_start)) {
+        qemu_log_lock();
         qemu_log("----------------\n");
         qemu_log("IN: %s\n", lookup_symbol(pc_start));
         log_target_disas(cs, pc_start, dc->pc - pc_start,
                          4 | (bswap_code(dc->sctlr_b) ? 2 : 0));
         qemu_log("\n");
+        qemu_log_unlock();
     }
 #endif
     tb->size = dc->pc - pc_start;
diff --git a/target-arm/translate.c b/target-arm/translate.c
index 718f7d0..0ad9070 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -11963,11 +11963,13 @@ done_generating:
 #ifdef DEBUG_DISAS
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM) &&
         qemu_log_in_addr_range(pc_start)) {
+        qemu_log_lock();
         qemu_log("----------------\n");
         qemu_log("IN: %s\n", lookup_symbol(pc_start));
         log_target_disas(cs, pc_start, dc->pc - pc_start,
                          dc->thumb | (dc->sctlr_b << 1));
         qemu_log("\n");
+        qemu_log_unlock();
     }
 #endif
     tb->size = dc->pc - pc_start;
diff --git a/target-cris/translate.c b/target-cris/translate.c
index 8d4c864..b910427 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -3290,12 +3290,14 @@ void gen_intermediate_code(CPUCRISState *env, struct TranslationBlock *tb)
 #if !DISAS_CRIS
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
         && qemu_log_in_addr_range(pc_start)) {
+        qemu_log_lock();
         qemu_log("--------------\n");
         qemu_log("IN: %s\n", lookup_symbol(pc_start));
         log_target_disas(cs, pc_start, dc->pc - pc_start,
                          env->pregs[PR_VR]);
         qemu_log("\nisize=%d osize=%d\n",
                  dc->pc - pc_start, tcg_op_buf_count());
+        qemu_log_unlock();
     }
 #endif
 #endif
diff --git a/target-i386/translate.c b/target-i386/translate.c
index 927b366..324103c 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -2432,11 +2432,13 @@ static void gen_unknown_opcode(CPUX86State *env, DisasContext *s)
 
     if (qemu_loglevel_mask(LOG_UNIMP)) {
         target_ulong pc = s->pc_start, end = s->pc;
+        qemu_log_lock();
         qemu_log("ILLOPC: " TARGET_FMT_lx ":", pc);
         for (; pc < end; ++pc) {
             qemu_log(" %02x", cpu_ldub_code(env, pc));
         }
         qemu_log("\n");
+        qemu_log_unlock();
     }
 }
 
@@ -8470,6 +8472,7 @@ done_generating:
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
         && qemu_log_in_addr_range(pc_start)) {
         int disas_flags;
+        qemu_log_lock();
         qemu_log("----------------\n");
         qemu_log("IN: %s\n", lookup_symbol(pc_start));
 #ifdef TARGET_X86_64
@@ -8480,6 +8483,7 @@ done_generating:
             disas_flags = !dc->code32;
         log_target_disas(cs, pc_start, pc_ptr - pc_start, disas_flags);
         qemu_log("\n");
+        qemu_log_unlock();
     }
 #endif
 
diff --git a/target-lm32/translate.c b/target-lm32/translate.c
index 842af63..692882f 100644
--- a/target-lm32/translate.c
+++ b/target-lm32/translate.c
@@ -1148,10 +1148,12 @@ void gen_intermediate_code(CPULM32State *env, struct TranslationBlock *tb)
 #ifdef DEBUG_DISAS
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
         && qemu_log_in_addr_range(pc_start)) {
+        qemu_log_lock();
         qemu_log("\n");
         log_target_disas(cs, pc_start, dc->pc - pc_start, 0);
         qemu_log("\nisize=%d osize=%d\n",
                  dc->pc - pc_start, tcg_op_buf_count());
+        qemu_log_unlock();
     }
 #endif
 }
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index ee0ffe3..9ad974f 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -3549,10 +3549,12 @@ void gen_intermediate_code(CPUM68KState *env, TranslationBlock *tb)
 #ifdef DEBUG_DISAS
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
         && qemu_log_in_addr_range(pc_start)) {
+        qemu_log_lock();
         qemu_log("----------------\n");
         qemu_log("IN: %s\n", lookup_symbol(pc_start));
         log_target_disas(cs, pc_start, dc->pc - pc_start, 0);
         qemu_log("\n");
+        qemu_log_unlock();
     }
 #endif
     tb->size = dc->pc - pc_start;
diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index 5a4a8b9..5274191 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -1813,12 +1813,14 @@ void gen_intermediate_code(CPUMBState *env, struct TranslationBlock *tb)
 #if !SIM_COMPAT
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
         && qemu_log_in_addr_range(pc_start)) {
+        qemu_log_lock();
         qemu_log("--------------\n");
 #if DISAS_GNU
         log_target_disas(cs, pc_start, dc->pc - pc_start, 0);
 #endif
         qemu_log("\nisize=%d osize=%d\n",
                  dc->pc - pc_start, tcg_op_buf_count());
+        qemu_log_unlock();
     }
 #endif
 #endif
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 55c2ca0..d8dde7a 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -20043,9 +20043,11 @@ done_generating:
     LOG_DISAS("\n");
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
         && qemu_log_in_addr_range(pc_start)) {
+        qemu_log_lock();
         qemu_log("IN: %s\n", lookup_symbol(pc_start));
         log_target_disas(cs, pc_start, ctx.pc - pc_start, 0);
         qemu_log("\n");
+        qemu_log_unlock();
     }
 #endif
 }
diff --git a/target-openrisc/translate.c b/target-openrisc/translate.c
index a4625f9..229361a 100644
--- a/target-openrisc/translate.c
+++ b/target-openrisc/translate.c
@@ -1750,11 +1750,13 @@ void gen_intermediate_code(CPUOpenRISCState *env, struct TranslationBlock *tb)
 #ifdef DEBUG_DISAS
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
         && qemu_log_in_addr_range(pc_start)) {
+        qemu_log_lock();
         qemu_log("----------------\n");
         qemu_log("IN: %s\n", lookup_symbol(pc_start));
         log_target_disas(cs, pc_start, dc->pc - pc_start, 0);
         qemu_log("\nisize=%d osize=%d\n",
                  dc->pc - pc_start, tcg_op_buf_count());
+        qemu_log_unlock();
     }
 #endif
 }
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 43505a9..54f35e9 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -7211,9 +7211,11 @@ void gen_intermediate_code(CPUPPCState *env, struct TranslationBlock *tb)
         int flags;
         flags = env->bfd_mach;
         flags |= ctx.le_mode << 16;
+        qemu_log_lock();
         qemu_log("IN: %s\n", lookup_symbol(pc_start));
         log_target_disas(cs, pc_start, ctx.nip - pc_start, flags);
         qemu_log("\n");
+        qemu_log_unlock();
     }
 #endif
 }
diff --git a/target-s390x/translate.c b/target-s390x/translate.c
index 1a07d70..02bc705 100644
--- a/target-s390x/translate.c
+++ b/target-s390x/translate.c
@@ -5432,9 +5432,11 @@ void gen_intermediate_code(CPUS390XState *env, struct TranslationBlock *tb)
 #if defined(S390X_DEBUG_DISAS)
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
         && qemu_log_in_addr_range(pc_start)) {
+        qemu_log_lock();
         qemu_log("IN: %s\n", lookup_symbol(pc_start));
         log_target_disas(cs, pc_start, dc.pc - pc_start, 1);
         qemu_log("\n");
+        qemu_log_unlock();
     }
 #endif
 }
diff --git a/target-sh4/translate.c b/target-sh4/translate.c
index ca80cf7..c89a147 100644
--- a/target-sh4/translate.c
+++ b/target-sh4/translate.c
@@ -1927,9 +1927,11 @@ void gen_intermediate_code(CPUSH4State * env, struct TranslationBlock *tb)
 #ifdef DEBUG_DISAS
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
         && qemu_log_in_addr_range(pc_start)) {
+        qemu_log_lock();
 	qemu_log("IN:\n");	/* , lookup_symbol(pc_start)); */
         log_target_disas(cs, pc_start, ctx.pc - pc_start, 0);
 	qemu_log("\n");
+        qemu_log_unlock();
     }
 #endif
 }
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index e7691e4..dc505f7 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -5672,10 +5672,12 @@ void gen_intermediate_code(CPUSPARCState * env, TranslationBlock * tb)
 #ifdef DEBUG_DISAS
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
         && qemu_log_in_addr_range(pc_start)) {
+        qemu_log_lock();
         qemu_log("--------------\n");
         qemu_log("IN: %s\n", lookup_symbol(pc_start));
         log_target_disas(cs, pc_start, last_pc + 4 - pc_start, 0);
         qemu_log("\n");
+        qemu_log_unlock();
     }
 #endif
 }
diff --git a/target-tilegx/translate.c b/target-tilegx/translate.c
index 11c9732..9c734ee 100644
--- a/target-tilegx/translate.c
+++ b/target-tilegx/translate.c
@@ -2391,6 +2391,7 @@ void gen_intermediate_code(CPUTLGState *env, struct TranslationBlock *tb)
     TCGV_UNUSED_I64(dc->zero);
 
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)) {
+        qemu_log_lock();
         qemu_log("IN: %s\n", lookup_symbol(pc_start));
     }
     if (!max_insns) {
@@ -2429,7 +2430,10 @@ void gen_intermediate_code(CPUTLGState *env, struct TranslationBlock *tb)
     tb->size = dc->pc - pc_start;
     tb->icount = num_insns;
 
-    qemu_log_mask(CPU_LOG_TB_IN_ASM, "\n");
+    if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)) {
+        qemu_log("\n");
+        qemu_log_unlock();
+    }
 }
 
 void restore_state_to_opc(CPUTLGState *env, TranslationBlock *tb,
diff --git a/target-tricore/translate.c b/target-tricore/translate.c
index 9a50df9..36f734a 100644
--- a/target-tricore/translate.c
+++ b/target-tricore/translate.c
@@ -8789,9 +8789,11 @@ void gen_intermediate_code(CPUTriCoreState *env, struct TranslationBlock *tb)
 #ifdef DEBUG_DISAS
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
         && qemu_log_in_addr_range(pc_start)) {
+        qemu_log_lock();
         qemu_log("IN: %s\n", lookup_symbol(pc_start));
         log_target_disas(cs, pc_start, ctx.pc - pc_start, 0);
         qemu_log("\n");
+        qemu_log_unlock();
     }
 #endif
 }
diff --git a/target-unicore32/translate.c b/target-unicore32/translate.c
index 09354f9..514d460 100644
--- a/target-unicore32/translate.c
+++ b/target-unicore32/translate.c
@@ -2024,10 +2024,12 @@ done_generating:
 #ifdef DEBUG_DISAS
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
         && qemu_log_in_addr_range(pc_start)) {
+        qemu_log_lock();
         qemu_log("----------------\n");
         qemu_log("IN: %s\n", lookup_symbol(pc_start));
         log_target_disas(cs, pc_start, dc->pc - pc_start, 0);
         qemu_log("\n");
+        qemu_log_unlock();
     }
 #endif
     tb->size = dc->pc - pc_start;
diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c
index fb0fa56..0858c29 100644
--- a/target-xtensa/translate.c
+++ b/target-xtensa/translate.c
@@ -3155,10 +3155,12 @@ void gen_intermediate_code(CPUXtensaState *env, TranslationBlock *tb)
 #ifdef DEBUG_DISAS
     if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM)
         && qemu_log_in_addr_range(pc_start)) {
+        qemu_log_lock();
         qemu_log("----------------\n");
         qemu_log("IN: %s\n", lookup_symbol(pc_start));
         log_target_disas(cs, pc_start, dc.pc - pc_start, 0);
         qemu_log("\n");
+        qemu_log_unlock();
     }
 #endif
     tb->size = dc.pc - pc_start;
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 2d3e498..aabf94f 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -412,10 +412,12 @@ void tcg_prologue_init(TCGContext *s)
 
 #ifdef DEBUG_DISAS
     if (qemu_loglevel_mask(CPU_LOG_TB_OUT_ASM)) {
+        qemu_log_lock();
         qemu_log("PROLOGUE: [size=%zu]\n", prologue_size);
         log_disas(buf0, prologue_size);
         qemu_log("\n");
         qemu_log_flush();
+        qemu_log_unlock();
     }
 #endif
 }
@@ -2542,9 +2544,11 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb)
 #ifdef DEBUG_DISAS
     if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP)
                  && qemu_log_in_addr_range(tb->pc))) {
+        qemu_log_lock();
         qemu_log("OP:\n");
         tcg_dump_ops(s);
         qemu_log("\n");
+        qemu_log_unlock();
     }
 #endif
 
@@ -2570,9 +2574,11 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb)
 #ifdef DEBUG_DISAS
             if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP_IND)
                          && qemu_log_in_addr_range(tb->pc))) {
+                qemu_log_lock();
                 qemu_log("OP before indirect lowering:\n");
                 tcg_dump_ops(s);
                 qemu_log("\n");
+                qemu_log_unlock();
             }
 #endif
             /* Replace indirect temps with direct temps.  */
@@ -2590,9 +2596,11 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb)
 #ifdef DEBUG_DISAS
     if (unlikely(qemu_loglevel_mask(CPU_LOG_TB_OP_OPT)
                  && qemu_log_in_addr_range(tb->pc))) {
+        qemu_log_lock();
         qemu_log("OP after optimization and liveness analysis:\n");
         tcg_dump_ops(s);
         qemu_log("\n");
+        qemu_log_unlock();
     }
 #endif
 
diff --git a/translate-all.c b/translate-all.c
index e6a8b07..3dd9214 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -1355,10 +1355,12 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
 #ifdef DEBUG_DISAS
     if (qemu_loglevel_mask(CPU_LOG_TB_OUT_ASM) &&
         qemu_log_in_addr_range(tb->pc)) {
+        qemu_log_lock();
         qemu_log("OUT: [size=%d]\n", gen_code_size);
         log_disas(tb->tc_ptr, gen_code_size);
         qemu_log("\n");
         qemu_log_flush();
+        qemu_log_unlock();
     }
 #endif
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [Qemu-devel] [PULL v2 for-2.8 5/9] tcg: Add tcg_gen_mulsu2_{i32, i64, tl}
  2016-11-01 12:07 [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches Richard Henderson
                   ` (3 preceding siblings ...)
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 4/9] log: Add locking to large logging blocks Richard Henderson
@ 2016-11-01 12:07 ` Richard Henderson
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 6/9] target-microblaze: Cleanup dec_mul Richard Henderson
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Richard Henderson @ 2016-11-01 12:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

This multiply has one signed input and one unsigned input,
producing the full double-width result.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Message-Id: <1475011433-24456-2-git-send-email-rth@twiddle.net>
---
 tcg/tcg-op.c | 43 +++++++++++++++++++++++++++++++++++++++++++
 tcg/tcg-op.h |  4 ++++
 2 files changed, 47 insertions(+)

diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c
index bb2bfee..4d125df 100644
--- a/tcg/tcg-op.c
+++ b/tcg/tcg-op.c
@@ -678,6 +678,33 @@ void tcg_gen_muls2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32 arg1, TCGv_i32 arg2)
     }
 }
 
+void tcg_gen_mulsu2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32 arg1, TCGv_i32 arg2)
+{
+    if (TCG_TARGET_REG_BITS == 32) {
+        TCGv_i32 t0 = tcg_temp_new_i32();
+        TCGv_i32 t1 = tcg_temp_new_i32();
+        TCGv_i32 t2 = tcg_temp_new_i32();
+        tcg_gen_mulu2_i32(t0, t1, arg1, arg2);
+        /* Adjust for negative input for the signed arg1.  */
+        tcg_gen_sari_i32(t2, arg1, 31);
+        tcg_gen_and_i32(t2, t2, arg2);
+        tcg_gen_sub_i32(rh, t1, t2);
+        tcg_gen_mov_i32(rl, t0);
+        tcg_temp_free_i32(t0);
+        tcg_temp_free_i32(t1);
+        tcg_temp_free_i32(t2);
+    } else {
+        TCGv_i64 t0 = tcg_temp_new_i64();
+        TCGv_i64 t1 = tcg_temp_new_i64();
+        tcg_gen_ext_i32_i64(t0, arg1);
+        tcg_gen_extu_i32_i64(t1, arg2);
+        tcg_gen_mul_i64(t0, t0, t1);
+        tcg_gen_extr_i64_i32(rl, rh, t0);
+        tcg_temp_free_i64(t0);
+        tcg_temp_free_i64(t1);
+    }
+}
+
 void tcg_gen_ext8s_i32(TCGv_i32 ret, TCGv_i32 arg)
 {
     if (TCG_TARGET_HAS_ext8s_i32) {
@@ -1748,6 +1775,22 @@ void tcg_gen_muls2_i64(TCGv_i64 rl, TCGv_i64 rh, TCGv_i64 arg1, TCGv_i64 arg2)
     }
 }
 
+void tcg_gen_mulsu2_i64(TCGv_i64 rl, TCGv_i64 rh, TCGv_i64 arg1, TCGv_i64 arg2)
+{
+    TCGv_i64 t0 = tcg_temp_new_i64();
+    TCGv_i64 t1 = tcg_temp_new_i64();
+    TCGv_i64 t2 = tcg_temp_new_i64();
+    tcg_gen_mulu2_i64(t0, t1, arg1, arg2);
+    /* Adjust for negative input for the signed arg1.  */
+    tcg_gen_sari_i64(t2, arg1, 63);
+    tcg_gen_and_i64(t2, t2, arg2);
+    tcg_gen_sub_i64(rh, t1, t2);
+    tcg_gen_mov_i64(rl, t0);
+    tcg_temp_free_i64(t0);
+    tcg_temp_free_i64(t1);
+    tcg_temp_free_i64(t2);
+}
+
 /* Size changing operations.  */
 
 void tcg_gen_extrl_i64_i32(TCGv_i32 ret, TCGv_i64 arg)
diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h
index 89b59e8..6d044b7 100644
--- a/tcg/tcg-op.h
+++ b/tcg/tcg-op.h
@@ -306,6 +306,7 @@ void tcg_gen_sub2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32 al,
                       TCGv_i32 ah, TCGv_i32 bl, TCGv_i32 bh);
 void tcg_gen_mulu2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32 arg1, TCGv_i32 arg2);
 void tcg_gen_muls2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32 arg1, TCGv_i32 arg2);
+void tcg_gen_mulsu2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32 arg1, TCGv_i32 arg2);
 void tcg_gen_ext8s_i32(TCGv_i32 ret, TCGv_i32 arg);
 void tcg_gen_ext16s_i32(TCGv_i32 ret, TCGv_i32 arg);
 void tcg_gen_ext8u_i32(TCGv_i32 ret, TCGv_i32 arg);
@@ -482,6 +483,7 @@ void tcg_gen_sub2_i64(TCGv_i64 rl, TCGv_i64 rh, TCGv_i64 al,
                       TCGv_i64 ah, TCGv_i64 bl, TCGv_i64 bh);
 void tcg_gen_mulu2_i64(TCGv_i64 rl, TCGv_i64 rh, TCGv_i64 arg1, TCGv_i64 arg2);
 void tcg_gen_muls2_i64(TCGv_i64 rl, TCGv_i64 rh, TCGv_i64 arg1, TCGv_i64 arg2);
+void tcg_gen_mulsu2_i64(TCGv_i64 rl, TCGv_i64 rh, TCGv_i64 arg1, TCGv_i64 arg2);
 void tcg_gen_not_i64(TCGv_i64 ret, TCGv_i64 arg);
 void tcg_gen_ext8s_i64(TCGv_i64 ret, TCGv_i64 arg);
 void tcg_gen_ext16s_i64(TCGv_i64 ret, TCGv_i64 arg);
@@ -956,6 +958,7 @@ void tcg_gen_atomic_xor_fetch_i64(TCGv_i64, TCGv, TCGv_i64, TCGArg, TCGMemOp);
 #define tcg_gen_sub2_tl tcg_gen_sub2_i64
 #define tcg_gen_mulu2_tl tcg_gen_mulu2_i64
 #define tcg_gen_muls2_tl tcg_gen_muls2_i64
+#define tcg_gen_mulsu2_tl tcg_gen_mulsu2_i64
 #define tcg_gen_atomic_cmpxchg_tl tcg_gen_atomic_cmpxchg_i64
 #define tcg_gen_atomic_xchg_tl tcg_gen_atomic_xchg_i64
 #define tcg_gen_atomic_fetch_add_tl tcg_gen_atomic_fetch_add_i64
@@ -1043,6 +1046,7 @@ void tcg_gen_atomic_xor_fetch_i64(TCGv_i64, TCGv, TCGv_i64, TCGArg, TCGMemOp);
 #define tcg_gen_sub2_tl tcg_gen_sub2_i32
 #define tcg_gen_mulu2_tl tcg_gen_mulu2_i32
 #define tcg_gen_muls2_tl tcg_gen_muls2_i32
+#define tcg_gen_mulsu2_tl tcg_gen_mulsu2_i32
 #define tcg_gen_atomic_cmpxchg_tl tcg_gen_atomic_cmpxchg_i32
 #define tcg_gen_atomic_xchg_tl tcg_gen_atomic_xchg_i32
 #define tcg_gen_atomic_fetch_add_tl tcg_gen_atomic_fetch_add_i32
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [Qemu-devel] [PULL v2 for-2.8 6/9] target-microblaze: Cleanup dec_mul
  2016-11-01 12:07 [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches Richard Henderson
                   ` (4 preceding siblings ...)
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 5/9] tcg: Add tcg_gen_mulsu2_{i32, i64, tl} Richard Henderson
@ 2016-11-01 12:07 ` Richard Henderson
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 7/9] MAINTAINERS: Update PPC status and maintainer Richard Henderson
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Richard Henderson @ 2016-11-01 12:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

Use tcg_gen_mul_tl for muli and mul instructions.
Use tcg_gen_muls2_tl for mulh instruction.
Use tcg_gen_mulu2_tl for mulhu instruction.
Use tcg_gen_mulsu2_tl for mulhsu instruction.

Note that this last fixes a bug, in that mulhsu was
previously treating both operands as signed, instead
of treating rb as unsigned.

Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Message-Id: <1475011433-24456-3-git-send-email-rth@twiddle.net>
---
 target-microblaze/translate.c | 61 +++++++------------------------------------
 1 file changed, 9 insertions(+), 52 deletions(-)

diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c
index 5274191..de2090a 100644
--- a/target-microblaze/translate.c
+++ b/target-microblaze/translate.c
@@ -581,50 +581,10 @@ static void dec_msr(DisasContext *dc)
     }
 }
 
-/* 64-bit signed mul, lower result in d and upper in d2.  */
-static void t_gen_muls(TCGv d, TCGv d2, TCGv a, TCGv b)
-{
-    TCGv_i64 t0, t1;
-
-    t0 = tcg_temp_new_i64();
-    t1 = tcg_temp_new_i64();
-
-    tcg_gen_ext_i32_i64(t0, a);
-    tcg_gen_ext_i32_i64(t1, b);
-    tcg_gen_mul_i64(t0, t0, t1);
-
-    tcg_gen_extrl_i64_i32(d, t0);
-    tcg_gen_shri_i64(t0, t0, 32);
-    tcg_gen_extrl_i64_i32(d2, t0);
-
-    tcg_temp_free_i64(t0);
-    tcg_temp_free_i64(t1);
-}
-
-/* 64-bit unsigned muls, lower result in d and upper in d2.  */
-static void t_gen_mulu(TCGv d, TCGv d2, TCGv a, TCGv b)
-{
-    TCGv_i64 t0, t1;
-
-    t0 = tcg_temp_new_i64();
-    t1 = tcg_temp_new_i64();
-
-    tcg_gen_extu_i32_i64(t0, a);
-    tcg_gen_extu_i32_i64(t1, b);
-    tcg_gen_mul_i64(t0, t0, t1);
-
-    tcg_gen_extrl_i64_i32(d, t0);
-    tcg_gen_shri_i64(t0, t0, 32);
-    tcg_gen_extrl_i64_i32(d2, t0);
-
-    tcg_temp_free_i64(t0);
-    tcg_temp_free_i64(t1);
-}
-
 /* Multiplier unit.  */
 static void dec_mul(DisasContext *dc)
 {
-    TCGv d[2];
+    TCGv tmp;
     unsigned int subcode;
 
     if ((dc->tb_flags & MSR_EE_FLAG)
@@ -636,13 +596,11 @@ static void dec_mul(DisasContext *dc)
     }
 
     subcode = dc->imm & 3;
-    d[0] = tcg_temp_new();
-    d[1] = tcg_temp_new();
 
     if (dc->type_b) {
         LOG_DIS("muli r%d r%d %x\n", dc->rd, dc->ra, dc->imm);
-        t_gen_mulu(cpu_R[dc->rd], d[1], cpu_R[dc->ra], *(dec_alu_op_b(dc)));
-        goto done;
+        tcg_gen_mul_tl(cpu_R[dc->rd], cpu_R[dc->ra], *(dec_alu_op_b(dc)));
+        return;
     }
 
     /* mulh, mulhsu and mulhu are not available if C_USE_HW_MUL is < 2.  */
@@ -651,30 +609,29 @@ static void dec_mul(DisasContext *dc)
         /* nop??? */
     }
 
+    tmp = tcg_temp_new();
     switch (subcode) {
         case 0:
             LOG_DIS("mul r%d r%d r%d\n", dc->rd, dc->ra, dc->rb);
-            t_gen_mulu(cpu_R[dc->rd], d[1], cpu_R[dc->ra], cpu_R[dc->rb]);
+            tcg_gen_mul_tl(cpu_R[dc->rd], cpu_R[dc->ra], cpu_R[dc->rb]);
             break;
         case 1:
             LOG_DIS("mulh r%d r%d r%d\n", dc->rd, dc->ra, dc->rb);
-            t_gen_muls(d[0], cpu_R[dc->rd], cpu_R[dc->ra], cpu_R[dc->rb]);
+            tcg_gen_muls2_tl(tmp, cpu_R[dc->rd], cpu_R[dc->ra], cpu_R[dc->rb]);
             break;
         case 2:
             LOG_DIS("mulhsu r%d r%d r%d\n", dc->rd, dc->ra, dc->rb);
-            t_gen_muls(d[0], cpu_R[dc->rd], cpu_R[dc->ra], cpu_R[dc->rb]);
+            tcg_gen_mulsu2_tl(tmp, cpu_R[dc->rd], cpu_R[dc->ra], cpu_R[dc->rb]);
             break;
         case 3:
             LOG_DIS("mulhu r%d r%d r%d\n", dc->rd, dc->ra, dc->rb);
-            t_gen_mulu(d[0], cpu_R[dc->rd], cpu_R[dc->ra], cpu_R[dc->rb]);
+            tcg_gen_mulu2_tl(tmp, cpu_R[dc->rd], cpu_R[dc->ra], cpu_R[dc->rb]);
             break;
         default:
             cpu_abort(CPU(dc->cpu), "unknown MUL insn %x\n", subcode);
             break;
     }
-done:
-    tcg_temp_free(d[0]);
-    tcg_temp_free(d[1]);
+    tcg_temp_free(tmp);
 }
 
 /* Div unit.  */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [Qemu-devel] [PULL v2 for-2.8 7/9] MAINTAINERS: Update PPC status and maintainer
  2016-11-01 12:07 [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches Richard Henderson
                   ` (5 preceding siblings ...)
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 6/9] target-microblaze: Cleanup dec_mul Richard Henderson
@ 2016-11-01 12:07 ` Richard Henderson
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 8/9] tcg/tcg.h: Improve documentation of TCGv_i32 etc types Richard Henderson
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Richard Henderson @ 2016-11-01 12:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Pranith Kumar

From: Pranith Kumar <bobby.prani@gmail.com>

Richard agreed to make odd fixes to PPC tcg parts[1]. This patch makes
the change.

[1] https://lists.gnu.org/archive/html/qemu-ppc/2016-03/msg00657.html

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 MAINTAINERS | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 3fecf45..653f52e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1504,8 +1504,8 @@ F: tcg/mips/
 F: disas/mips.c
 
 PPC
-M: Vassili Karpov (malc) <av1474@comtv.ru>
-S: Maintained
+M: Richard Henderson <rth@twiddle.net>
+S: Odd Fixes
 F: tcg/ppc/
 F: disas/ppc.c
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [Qemu-devel] [PULL v2 for-2.8 8/9] tcg/tcg.h: Improve documentation of TCGv_i32 etc types
  2016-11-01 12:07 [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches Richard Henderson
                   ` (6 preceding siblings ...)
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 7/9] MAINTAINERS: Update PPC status and maintainer Richard Henderson
@ 2016-11-01 12:07 ` Richard Henderson
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 9/9] tcg: correct 32-bit tcg_gen_ld8s_i64 sign-extension Richard Henderson
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 21+ messages in thread
From: Richard Henderson @ 2016-11-01 12:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

From: Peter Maydell <peter.maydell@linaro.org>

The typedefs we use for the TCGv_i32, TCGv_i64 and TCGv_ptr
types are somewhat confusing, because we define them as
pointers to structs, but the structs themselves are never
defined. Explain in the comments a bit more clearly why
this is OK and what is going on under the hood.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <1477067922-26202-1-git-send-email-peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/tcg.h | 38 ++++++++++++++++++++++++++++++--------
 1 file changed, 30 insertions(+), 8 deletions(-)

diff --git a/tcg/tcg.h b/tcg/tcg.h
index dc1281f..a35e4c4 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -376,14 +376,36 @@ static inline unsigned get_alignment_bits(TCGMemOp memop)
 
 typedef tcg_target_ulong TCGArg;
 
-/* Define a type and accessor macros for variables.  Using pointer types
-   is nice because it gives some level of type safely.  Converting to and
-   from intptr_t rather than int reduces the number of sign-extension
-   instructions that get implied on 64-bit hosts.  Users of tcg_gen_* don't
-   need to know about any of this, and should treat TCGv as an opaque type.
-   In addition we do typechecking for different types of variables.  TCGv_i32
-   and TCGv_i64 are 32/64-bit variables respectively.  TCGv and TCGv_ptr
-   are aliases for target_ulong and host pointer sized values respectively.  */
+/* Define type and accessor macros for TCG variables.
+
+   TCG variables are the inputs and outputs of TCG ops, as described
+   in tcg/README. Target CPU front-end code uses these types to deal
+   with TCG variables as it emits TCG code via the tcg_gen_* functions.
+   They come in several flavours:
+    * TCGv_i32 : 32 bit integer type
+    * TCGv_i64 : 64 bit integer type
+    * TCGv_ptr : a host pointer type
+    * TCGv : an integer type the same size as target_ulong
+             (an alias for either TCGv_i32 or TCGv_i64)
+   The compiler's type checking will complain if you mix them
+   up and pass the wrong sized TCGv to a function.
+
+   Users of tcg_gen_* don't need to know about any of the internal
+   details of these, and should treat them as opaque types.
+   You won't be able to look inside them in a debugger either.
+
+   Internal implementation details follow:
+
+   Note that there is no definition of the structs TCGv_i32_d etc anywhere.
+   This is deliberate, because the values we store in variables of type
+   TCGv_i32 are not really pointers-to-structures. They're just small
+   integers, but keeping them in pointer types like this means that the
+   compiler will complain if you accidentally pass a TCGv_i32 to a
+   function which takes a TCGv_i64, and so on. Only the internals of
+   TCG need to care about the actual contents of the types, and they always
+   box and unbox via the MAKE_TCGV_* and GET_TCGV_* functions.
+   Converting to and from intptr_t rather than int reduces the number
+   of sign-extension instructions that get implied on 64-bit hosts.  */
 
 typedef struct TCGv_i32_d *TCGv_i32;
 typedef struct TCGv_i64_d *TCGv_i64;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [Qemu-devel] [PULL v2 for-2.8 9/9] tcg: correct 32-bit tcg_gen_ld8s_i64 sign-extension
  2016-11-01 12:07 [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches Richard Henderson
                   ` (7 preceding siblings ...)
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 8/9] tcg/tcg.h: Improve documentation of TCGv_i32 etc types Richard Henderson
@ 2016-11-01 12:07 ` Richard Henderson
  2016-11-01 14:26 ` [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches Peter Maydell
  2016-11-01 15:34 ` Richard Henderson
  10 siblings, 0 replies; 21+ messages in thread
From: Richard Henderson @ 2016-11-01 12:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Joseph Myers

From: Joseph Myers <joseph@codesourcery.com>

The version of tcg_gen_ld8s_i64 for 32-bit systems does a load into
the low part of the return value - then attempts a sign extension into
the high part, but wrongly sets the high part to a sign extension of
itself rather than of the low part.  This results in TCG internal
errors from the use of the uninitialized high part (in some GCC tests
of AArch64 NEON shift intrinsics, in particular).  This patch corrects
the sign-extension logic, making it match other functions such as
tcg_gen_ld16s_i64.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Joseph Myers <joseph@codesourcery.com>
Message-Id: <alpine.DEB.2.20.1610272333560.22353@digraph.polyomino.org.uk>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/tcg-op.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c
index 4d125df..6e2fb35 100644
--- a/tcg/tcg-op.c
+++ b/tcg/tcg-op.c
@@ -817,7 +817,7 @@ void tcg_gen_ld8u_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset)
 void tcg_gen_ld8s_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset)
 {
     tcg_gen_ld8s_i32(TCGV_LOW(ret), arg2, offset);
-    tcg_gen_sari_i32(TCGV_HIGH(ret), TCGV_HIGH(ret), 31);
+    tcg_gen_sari_i32(TCGV_HIGH(ret), TCGV_LOW(ret), 31);
 }
 
 void tcg_gen_ld16u_i64(TCGv_i64 ret, TCGv_ptr arg2, tcg_target_long offset)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches
  2016-11-01 12:07 [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches Richard Henderson
                   ` (8 preceding siblings ...)
  2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 9/9] tcg: correct 32-bit tcg_gen_ld8s_i64 sign-extension Richard Henderson
@ 2016-11-01 14:26 ` Peter Maydell
  2016-11-01 16:38   ` Richard Henderson
  2016-11-01 15:34 ` Richard Henderson
  10 siblings, 1 reply; 21+ messages in thread
From: Peter Maydell @ 2016-11-01 14:26 UTC (permalink / raw)
  To: Richard Henderson; +Cc: QEMU Developers

On 1 November 2016 at 12:07, Richard Henderson <rth@twiddle.net> wrote:
> V2, now with more windows workarounds.  I'll note that I have not
> been 100% successful in actually building a mingw64 image.  But
> at least the error Peter saw with v1 is fixed.
>
> I'll report on the other mingw64 failures under separate cover.
>
>
> r~
>
>
>
> The following changes since commit e80b4b8fb6babce7dcc91ea9ddeecbc351fd4646:
>
>   Merge remote-tracking branch 'remotes/awilliam/tags/vfio-updates-20161031.0' into staging (2016-10-31 18:19:06 +0000)
>
> are available in the git repository at:
>
>   git://github.com/rth7680/qemu.git tags/pull-tcg-20161101
>
> for you to fetch changes up to 13110e2d41d0b9d77edea5b23e1a808c86eb22cb:
>
>   tcg: correct 32-bit tcg_gen_ld8s_i64 sign-extension (2016-10-31 21:36:29 -0600)
>
> ----------------------------------------------------------------
> tcg queued patches

i686-w64-mingw32 builds fail to link :-(

exec.o: In function `qemu_flockfile':
/home/petmay01/linaro/qemu-for-merges/include/sysemu/os-win32.h:110:
undefined reference to `_imp___lock_file'
exec.o: In function `qemu_funlockfile':
/home/petmay01/linaro/qemu-for-merges/include/sysemu/os-win32.h:115:
undefined reference to `_imp___unlock_file'
(repeated a lot of times)

thanks
-- PMM

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches
  2016-11-01 12:07 [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches Richard Henderson
                   ` (9 preceding siblings ...)
  2016-11-01 14:26 ` [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches Peter Maydell
@ 2016-11-01 15:34 ` Richard Henderson
  2016-11-01 15:54   ` Peter Maydell
  2016-11-01 16:20   ` Daniel P. Berrange
  10 siblings, 2 replies; 21+ messages in thread
From: Richard Henderson @ 2016-11-01 15:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

On 11/01/2016 06:07 AM, Richard Henderson wrote:
> V2, now with more windows workarounds.  I'll note that I have not
> been 100% successful in actually building a mingw64 image.  But
> at least the error Peter saw with v1 is fixed.
>
> I'll report on the other mingw64 failures under separate cover.

Bah.  I think I've been tripped up by the fact that we fail to preserve 
PKG_CONFIG_PATH when re-running configure via make.  We really should finally 
fix that -- it's really really annoying when building a non-default config.


r~

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches
  2016-11-01 15:34 ` Richard Henderson
@ 2016-11-01 15:54   ` Peter Maydell
  2016-11-01 16:20   ` Daniel P. Berrange
  1 sibling, 0 replies; 21+ messages in thread
From: Peter Maydell @ 2016-11-01 15:54 UTC (permalink / raw)
  To: Richard Henderson; +Cc: QEMU Developers

On 1 November 2016 at 15:34, Richard Henderson <rth@twiddle.net> wrote:
> Bah.  I think I've been tripped up by the fact that we fail to preserve
> PKG_CONFIG_PATH when re-running configure via make.  We really should
> finally fix that -- it's really really annoying when building a non-default
> config.

FWIW this doesn't bite me because I use configure
--cross-prefix=i686-w64-mingw32-
and then configure runs i686-w64-mingw32-pkg-config, which is a wrapper
script that gets the PKG_CONFIG_LIBDIR right.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches
  2016-11-01 15:34 ` Richard Henderson
  2016-11-01 15:54   ` Peter Maydell
@ 2016-11-01 16:20   ` Daniel P. Berrange
  2016-11-01 16:26     ` Peter Maydell
  1 sibling, 1 reply; 21+ messages in thread
From: Daniel P. Berrange @ 2016-11-01 16:20 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel, peter.maydell

On Tue, Nov 01, 2016 at 09:34:24AM -0600, Richard Henderson wrote:
> On 11/01/2016 06:07 AM, Richard Henderson wrote:
> > V2, now with more windows workarounds.  I'll note that I have not
> > been 100% successful in actually building a mingw64 image.  But
> > at least the error Peter saw with v1 is fixed.
> > 
> > I'll report on the other mingw64 failures under separate cover.
> 
> Bah.  I think I've been tripped up by the fact that we fail to preserve
> PKG_CONFIG_PATH when re-running configure via make.  We really should
> finally fix that -- it's really really annoying when building a non-default
> config.

I sent a fix for this issue last year, but it never got picked up
by anyone for merge

https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg04074.html

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches
  2016-11-01 16:20   ` Daniel P. Berrange
@ 2016-11-01 16:26     ` Peter Maydell
  2016-11-01 17:43       ` Daniel P. Berrange
  0 siblings, 1 reply; 21+ messages in thread
From: Peter Maydell @ 2016-11-01 16:26 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: Richard Henderson, QEMU Developers

On 1 November 2016 at 16:20, Daniel P. Berrange <berrange@redhat.com> wrote:
> On Tue, Nov 01, 2016 at 09:34:24AM -0600, Richard Henderson wrote:
>> On 11/01/2016 06:07 AM, Richard Henderson wrote:
>> > V2, now with more windows workarounds.  I'll note that I have not
>> > been 100% successful in actually building a mingw64 image.  But
>> > at least the error Peter saw with v1 is fixed.
>> >
>> > I'll report on the other mingw64 failures under separate cover.
>>
>> Bah.  I think I've been tripped up by the fact that we fail to preserve
>> PKG_CONFIG_PATH when re-running configure via make.  We really should
>> finally fix that -- it's really really annoying when building a non-default
>> config.
>
> I sent a fix for this issue last year, but it never got picked up
> by anyone for merge
>
> https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg04074.html

Hmm, that's a lot of random environment variables.
I think I prefer the approach of "if you care about anything
in the environment, pass it to both configure and to make".
For instance we don't pass PATH from configure to make, so
with that patch we would have the opposite behaviour, that
make can run configure (which will get the saved PATH from
config.status) but then make itself runs with a different PATH.
That seems awkwardly inconsistent.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches
  2016-11-01 14:26 ` [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches Peter Maydell
@ 2016-11-01 16:38   ` Richard Henderson
  0 siblings, 0 replies; 21+ messages in thread
From: Richard Henderson @ 2016-11-01 16:38 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

On 11/01/2016 08:26 AM, Peter Maydell wrote:
> i686-w64-mingw32 builds fail to link :-(
>
> exec.o: In function `qemu_flockfile':
> /home/petmay01/linaro/qemu-for-merges/include/sysemu/os-win32.h:110:
> undefined reference to `_imp___lock_file'
> exec.o: In function `qemu_funlockfile':
> /home/petmay01/linaro/qemu-for-merges/include/sysemu/os-win32.h:115:

I see the symbols present in libmsvcrt.a.  I wonder why it isn't being seen.

Oh well.  I'm going to simply disable file locking for mingw32 and let someone 
who cares deal with it later.  The situation with logging is no worse than 
before the patch.


r~

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches
  2016-11-01 16:26     ` Peter Maydell
@ 2016-11-01 17:43       ` Daniel P. Berrange
  2016-11-01 17:51         ` Richard Henderson
  0 siblings, 1 reply; 21+ messages in thread
From: Daniel P. Berrange @ 2016-11-01 17:43 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Richard Henderson, QEMU Developers

On Tue, Nov 01, 2016 at 04:26:57PM +0000, Peter Maydell wrote:
> On 1 November 2016 at 16:20, Daniel P. Berrange <berrange@redhat.com> wrote:
> > On Tue, Nov 01, 2016 at 09:34:24AM -0600, Richard Henderson wrote:
> >> On 11/01/2016 06:07 AM, Richard Henderson wrote:
> >> > V2, now with more windows workarounds.  I'll note that I have not
> >> > been 100% successful in actually building a mingw64 image.  But
> >> > at least the error Peter saw with v1 is fixed.
> >> >
> >> > I'll report on the other mingw64 failures under separate cover.
> >>
> >> Bah.  I think I've been tripped up by the fact that we fail to preserve
> >> PKG_CONFIG_PATH when re-running configure via make.  We really should
> >> finally fix that -- it's really really annoying when building a non-default
> >> config.
> >
> > I sent a fix for this issue last year, but it never got picked up
> > by anyone for merge
> >
> > https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg04074.html
> 
> Hmm, that's a lot of random environment variables.
> I think I prefer the approach of "if you care about anything
> in the environment, pass it to both configure and to make".
> For instance we don't pass PATH from configure to make, so
> with that patch we would have the opposite behaviour, that
> make can run configure (which will get the saved PATH from
> config.status) but then make itself runs with a different PATH.
> That seems awkwardly inconsistent.

Yeah, it is akward - I was coming at it from an autotools perspective
where the generated Makefile tends to get variables added for each
tool used, containing the fully qualified path. eg so 'make' ends
up running '/usr/bin/sed' instead of just 'sed', and so 'make' is
not dependant on stuff in your env like $PATH - it mostly honours the
env that was set at time of configure.

Of course QEMU is not using autotools, so this doesn't map exactly
hence the inconsistency you point out.

Personally the idea that you must explicitly pass the same environment
to both configure & make is kind of hard to guarantee - I'll have
many terminal windows open when working on QEMU and I can't have any
confidence that the env seen by 'make' will exactly match what I used
with 'configure' (which may have been run quite some time earlier - hours
or even days).

It was a particular pain-point for me when doing mingw builds, where
I would typically use 'PKG_CONFIG_PATH=/blah ./configure' so that I
didn't permanently pollute my shell with mingw32 pkg-config env

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches
  2016-11-01 17:43       ` Daniel P. Berrange
@ 2016-11-01 17:51         ` Richard Henderson
  2016-11-01 18:17           ` Peter Maydell
  0 siblings, 1 reply; 21+ messages in thread
From: Richard Henderson @ 2016-11-01 17:51 UTC (permalink / raw)
  To: Daniel P. Berrange, Peter Maydell; +Cc: QEMU Developers

On 11/01/2016 11:43 AM, Daniel P. Berrange wrote:
> It was a particular pain-point for me when doing mingw builds, where
> I would typically use 'PKG_CONFIG_PATH=/blah ./configure' so that I
> didn't permanently pollute my shell with mingw32 pkg-config env

The usual pain point for me is building for 32-bit on a 64-bit system, where 
there is no cross-prefix that one can use, and PKG_CONFIG_PATH and 
--extra-cflags are the only changes.


r~

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches
  2016-11-01 17:51         ` Richard Henderson
@ 2016-11-01 18:17           ` Peter Maydell
  2016-11-01 19:21             ` Richard Henderson
  0 siblings, 1 reply; 21+ messages in thread
From: Peter Maydell @ 2016-11-01 18:17 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Daniel P. Berrange, QEMU Developers

On 1 November 2016 at 17:51, Richard Henderson <rth@twiddle.net> wrote:
> The usual pain point for me is building for 32-bit on a 64-bit
> system, where there is no cross-prefix that one can use, and
> PKG_CONFIG_PATH and --extra-cflags are the only changes.

That sounds like a bug in how the 32-bit compilers work on
x86 ;-) Ideally you should be able to get a 32-bit compile
with i586-linux-gnu-gcc...

thanks
-- PMM

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches
  2016-11-01 18:17           ` Peter Maydell
@ 2016-11-01 19:21             ` Richard Henderson
  2016-11-01 21:08               ` Peter Maydell
  0 siblings, 1 reply; 21+ messages in thread
From: Richard Henderson @ 2016-11-01 19:21 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Daniel P. Berrange, QEMU Developers

On 11/01/2016 12:17 PM, Peter Maydell wrote:
> On 1 November 2016 at 17:51, Richard Henderson <rth@twiddle.net> wrote:
>> The usual pain point for me is building for 32-bit on a 64-bit
>> system, where there is no cross-prefix that one can use, and
>> PKG_CONFIG_PATH and --extra-cflags are the only changes.
>
> That sounds like a bug in how the 32-bit compilers work on
> x86 ;-) Ideally you should be able to get a 32-bit compile
> with i586-linux-gnu-gcc...

gcc -m32 worked very well for years, before pkg-config came along and mucked 
things up by using package-local include and library directories.  As long as 
everything was installed in the toolchain-aware search paths, everything Just 
Worked.


r~

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches
  2016-11-01 19:21             ` Richard Henderson
@ 2016-11-01 21:08               ` Peter Maydell
  0 siblings, 0 replies; 21+ messages in thread
From: Peter Maydell @ 2016-11-01 21:08 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Daniel P. Berrange, QEMU Developers

On 1 November 2016 at 19:21, Richard Henderson <rth@twiddle.net> wrote:
> On 11/01/2016 12:17 PM, Peter Maydell wrote:
>> On 1 November 2016 at 17:51, Richard Henderson <rth@twiddle.net> wrote:
>>>
>>> The usual pain point for me is building for 32-bit on a 64-bit
>>> system, where there is no cross-prefix that one can use, and
>>> PKG_CONFIG_PATH and --extra-cflags are the only changes.
>>
>>
>> That sounds like a bug in how the 32-bit compilers work on
>> x86 ;-) Ideally you should be able to get a 32-bit compile
>> with i586-linux-gnu-gcc...

> gcc -m32 worked very well for years, before pkg-config
> came along and mucked things up by using package-local
> include and library directories.  As long as everything
> was installed in the toolchain-aware search paths, everything
> Just Worked.

-m32 doesn't extend to anything other than the 32-bit/64-bit
special case, though, and pkg-config does more than just
tell you include paths.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2016-11-01 21:09 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-01 12:07 [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches Richard Henderson
2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 1/9] target-cris: Do not dump cpu state with -d in_asm Richard Henderson
2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 2/9] target-microblaze: " Richard Henderson
2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 3/9] target-openrisc: " Richard Henderson
2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 4/9] log: Add locking to large logging blocks Richard Henderson
2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 5/9] tcg: Add tcg_gen_mulsu2_{i32, i64, tl} Richard Henderson
2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 6/9] target-microblaze: Cleanup dec_mul Richard Henderson
2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 7/9] MAINTAINERS: Update PPC status and maintainer Richard Henderson
2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 8/9] tcg/tcg.h: Improve documentation of TCGv_i32 etc types Richard Henderson
2016-11-01 12:07 ` [Qemu-devel] [PULL v2 for-2.8 9/9] tcg: correct 32-bit tcg_gen_ld8s_i64 sign-extension Richard Henderson
2016-11-01 14:26 ` [Qemu-devel] [PULL v2 for-2.8 0/9] tcg queued patches Peter Maydell
2016-11-01 16:38   ` Richard Henderson
2016-11-01 15:34 ` Richard Henderson
2016-11-01 15:54   ` Peter Maydell
2016-11-01 16:20   ` Daniel P. Berrange
2016-11-01 16:26     ` Peter Maydell
2016-11-01 17:43       ` Daniel P. Berrange
2016-11-01 17:51         ` Richard Henderson
2016-11-01 18:17           ` Peter Maydell
2016-11-01 19:21             ` Richard Henderson
2016-11-01 21:08               ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.