Re: [Qemu-devel] [PATCH 0/8] tcg: tidy the type of code_ptr

2014-03-31 Thread Jay Foad
Is there a better name than 'tcg_itype' ? Putting 'type' in the name of a type is a bit redundant, and suggests it contains a type rather than an insn. I'm open to suggestions there as well. On x86 and ia64, it won't hold an entire insn, so tcg_insn seemed inappropriate.

Re: [Qemu-devel] [PATCH] tci: Add implementation of rotl_i64, rotr_i64

2013-09-05 Thread Jay Foad
diff --git a/tci.c b/tci.c index 18c888e..94b7851 100644 --- a/tci.c +++ b/tci.c @@ -952,8 +952,16 @@ uintptr_t tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) break; #if TCG_TARGET_HAS_rot_i64 case INDEX_op_rotl_i64: +t0 = *tb_ptr++; +

Re: [Qemu-devel] [RFC 01/14] tcg-aarch64: Allow immediate operands to add and sub

2013-08-13 Thread Jay Foad
-static inline void tcg_out_addi(TCGContext *s, int ext, -TCGReg rd, TCGReg rn, unsigned int aimm) +static void tcg_out_addi(TCGContext *s, int ext, TCGReg rd, TCGReg rn, + tcg_target_long aimm) { -/* add immediate aimm unsigned

[Qemu-devel] [PATCH] int128: optimize

2013-07-02 Thread Jay Foad
static inline Int128 int128_neg(Int128 a) { -a.lo = ~a.lo; -a.hi = ~a.hi; -return int128_add(a, int128_one()); +uint64_t lo = -a.lo; +return (Int128) { lo, ~a.hi + !lo }; } This leaves int128_one unused. (Also the temporary lo seems a bit pointless, since you could

Re: [Qemu-devel] [PATCH 1/4] tcg-arm: Implement deposit for armv7

2013-03-06 Thread Jay Foad
diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index b6eed1f..cb89419 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -73,10 +73,13 @@ typedef enum { #define TCG_TARGET_HAS_eqv_i32 0 #define TCG_TARGET_HAS_nand_i32 0 #define

Re: [Qemu-devel] [PATCH v2] bswap: Fix width of swap in leul_to_cpu

2013-02-12 Thread Jay Foad
@@ -458,7 +458,15 @@ static inline void cpu_to_32wu(uint32_t *p, uint32_t v) static inline unsigned long leul_to_cpu(unsigned long v) { -return le_bswap(v, HOST_LONG_BITS); +/* In order to break an include loop between here and + qemu-common.h, don't rely on HOST_LONG_BITS.

Re: [Qemu-devel] [PATCH 00/57] target-i386 eflags cleanup and bmi/adx extensions

2013-01-28 Thread Jay Foad
Checkpatch doesn't work well with the pattern #ifdef SOMETHING if (foo) { bar(); } else #endif { baz1(); baz2(); } Which is exactly the case for all three errors reported in this series. I know of no other good way to arrange this pattern.

Re: [Qemu-devel] [PATCH 2/3] optimize: track nonzero bits of registers

2013-01-16 Thread Jay Foad
@@ -621,6 +627,87 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr, break; } +/* Simplify using known-zero bits */ +mask = -1; +switch (op) { +CASE_OP_32_64(ext8s): +if ((temps[args[1]].mask

Re: [Qemu-devel] [PATCH v2] bitops.h: Add field32() and field64() functions to extract bitfields

2012-06-27 Thread Jay Foad
Eric Blake wrote: assert(start = 0 length 0 (unsigned) start + length = 64); This is shorter and avoids the ugly cast: assert(start = 0 length 0 length = 64 - start); Jay.

Re: [Qemu-devel] [PATCH 1/3] Add support for 128-bit arithmeticRe: [PATCH 1/3] Add support for 128-bit arithmetic

2012-02-10 Thread Jay Foad
On 30 Oct 2011, Avi Kivity wrote: The memory API supports 64-bit buses (e.g. PCI). A size on such a bus cannot be represented with a 64-bit data type, if both 0 and the entire address space size are to be represented. Futhermore, any address arithemetic may overflow and return unexpected

Re: [Qemu-devel] [PATCH] linux-user: Protect against allocation failure in load_symbols.

2010-07-30 Thread Jay Foad
+/* Attempt to free the storage associated with the local symbols + that we threw away. Whether or not this has any effect on the + memory allocation depends on the malloc implementation and how + many symbols we managed to discard. */ syms = realloc(syms, nsyms *

[Qemu-devel] Re: [PATCH] target-sparc: fix --enable-debug build for 64 bit host

2010-02-25 Thread Jay Foad
On 25 February 2010 18:05, Stefan Weil w...@mail.berlios.de wrote: b551ec04ca45d1925417dd2ec7c1b7f115c84f1d fixed the compilation for 32 bit hosts, but introduced a new error for 64 bit hosts: Sorry. Thanks for fixing it. Jay.

[Qemu-devel] gcc 4.4 miscompiling cpu_exec() ?

2010-02-23 Thread Jay Foad
I'm building QEMU mipsel-linux-user with Ubuntu's GCC 4.4 on an x86 host. Whenever I try to run a trivial MIPS executable, QEMU segfaults in cpu_loop() shortly after the call to cpu_mips_exec(). The problem seems to be that cpu_exec() doesn't preserve ebp. It tries to: saved_env_reg =

Re: [Qemu-devel] gcc 4.4 miscompiling cpu_exec() ?

2010-02-23 Thread Jay Foad
On 23 February 2010 17:03, Aurelien Jarno aurel...@aurel32.net wrote: Jay Foad a écrit : I'm building QEMU mipsel-linux-user with Ubuntu's GCC 4.4 on an x86 host. Whenever I try to run a trivial MIPS executable, QEMU segfaults in cpu_loop() shortly after the call to cpu_mips_exec

[Qemu-devel] Re: gcc 4.4 miscompiling cpu_exec() ?

2010-02-23 Thread Jay Foad
Can you try this patch: It works! Thanks. and if it works, possibly only each hunk of it? Just the first hunk: works! Just the second hunk: doesn't work Can you explain why the volatile is necessary? Or is it working around a problem with the compiler? Thanks, Jay.

Re: [Qemu-devel] [PATCH v2] tcg: fix assertion with --enable-debug

2010-02-22 Thread Jay Foad
This patch breaks building on ppc32. Reverting it makes it compile again: /suse/agraf/git/qemu/tcg/ppc/tcg-target.c:1696: error: ‘INDEX_op_qemu_ld32s’ undeclared here (not in a function) Does it build if you remove line 1696? If so, I'd suggest doing that. Thanks, Jay.

[Qemu-devel] [PATCH] tcg: fix build on 32-bit hppa, ppc and sparc hosts

2010-02-22 Thread Jay Foad
The qemu_ld32s op is only defined if TCG_TARGET_REG_BITS == 64. Signed-off-by: Jay Foad jay.f...@gmail.com --- tcg/hppa/tcg-target.c |1 - tcg/ppc/tcg-target.c |2 -- tcg/sparc/tcg-target.c |4 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tcg/hppa/tcg

Re: [Qemu-devel] [PATCH v2] tcg: fix assertion with --enable-debug

2010-02-22 Thread Jay Foad
Does it build if you remove line 1696? If so, I'd suggest doing that. Yes, that fixes it. Please grep through all tcg targets and send a patch removing all references to ld32s if you think it's not necessary. Done. Unfortunately I'm not in a position to try building any of the affected tcg

Re: [Qemu-devel] [PATCH] tcg: fix build on 32-bit hppa, ppc and sparc hosts

2010-02-22 Thread Jay Foad
--- a/tcg/ppc/tcg-target.c +++ b/tcg/ppc/tcg-target.c @@ -1693,7 +1693,6 @@ static const TCGTargetOpDef ppc_op_defs[] = {      { INDEX_op_qemu_ld16u, { r, L } },      { INDEX_op_qemu_ld16s, { r, L } },      { INDEX_op_qemu_ld32u, { r, L } }, -    { INDEX_op_qemu_ld32s, { r, L } }, No. As

Re: [Qemu-devel] [PATCH] target-sparc: fix --enable-debug build

2010-02-20 Thread Jay Foad
Yes, except for the Signed-off-by: line. Do I need to resend it for that? And if so, does that make it PATCH v2 (even though the patch hasn't changed)? Or can I just put the fixed Signed-off-by: line in a reply? Thanks, Jay.

[Qemu-devel] [PATCH v2] tcg: fix assertion with --enable-debug

2010-02-20 Thread Jay Foad
On 32-bit hosts op_qemu_ld32s is unused. Remove it to fix the following assertion failure: qemu-alpha: tcg/tcg.c:1055: tcg_add_target_add_op_defs: Assertion `tcg_op_defs[op].used' failed. Signed-off-by: Jay Foad jay.f...@gmail.com --- tcg/tcg-opc.h |5 - 1 files changed, 0 insertions

[Qemu-devel] [PATCH v2] target-sparc: fix --enable-debug build

2010-02-20 Thread Jay Foad
Use 32-bit arithmetic for the address offset calculation to fix a build failure on 32-bit hosts. Signed-off-by: Jay Foad jay.f...@gmail.com --- target-sparc/translate.c | 22 +++--- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/target-sparc/translate.c b

[Qemu-devel] [PATCH] target-sparc: fix --enable-debug build

2010-02-19 Thread Jay Foad
/foad/git/qemu/tcg/tcg-op.h:422: note: expected ‘TCGv_i32’ but argument is of type ‘TCGv_i64’ make[1]: *** [translate.o] Error 1 Does this look like a reasonable fix? Signed-off-by: Jay Foad addr...@hidden --- diff --git a/target-sparc/translate.c b/target-sparc/translate.c index 7e9f0cf..b7d2a32

[Qemu-devel] [PATCH] tcg: fix assertion with --enable-debug

2010-02-19 Thread Jay Foad
appears to be unused on 32-bit hosts. Is it OK to just remove it? Signed-off-by: Jay Foad addr...@hidden --- tcg/tcg-opc.h |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/tcg/tcg-opc.h b/tcg/tcg-opc.h index 89db3b4..838f1f4 100644 --- a/tcg/tcg-opc.h +++ b/tcg/tcg