Statistics
| Branch: | Revision:

root / tcg @ ded37f0d

# Date Author Comment
24c7f754 10/13/2012 01:39 pm Richard Henderson

tcg-sparc: Fix brcond2

Much the same problem as recently fixed for hppa.

Signed-off-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

ded37f0d 10/13/2012 01:39 pm Richard Henderson

tcg-sparc: Implement movcond.

Signed-off-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

d8382011 10/07/2012 07:36 pm Stefan Weil

tcg: Remove redundant pointer from TCGContext

The pointer entry 'temps' always refers to the array entry 'static_temps'.
Removing the pointer and renaming 'static_temps' to 'temps' reduces the
size of TCGContext (4 or 8 byte) and allows better code generation....

048d3612 10/06/2012 07:54 pm Aurelien Jarno

Merge branch 'trivial-patches' of git://github.com/stefanha/qemu

  • 'trivial-patches' of git://github.com/stefanha/qemu:
    versatilepb: Use symbolic indices for ARM PIC
    qdev: kill bogus comment
    qemu-barrier: Fix compiler version check for future gcc versions...
0aed257f 10/06/2012 07:48 pm Richard Henderson

tcg: Add TCG_COND_NEVER, TCG_COND_ALWAYS

There are several cases that can be handled easier inside both
translators and code generators if we have out-of-band values
for conditions. It's easy enough to handle ALWAYS and NEVER in
the natural way inside the tcg middle-end....

d1e321b8 10/06/2012 07:48 pm Richard Henderson

tcg: Add tcg_high_cond

The table that was recently added for hppa is generally usable.
And with the renumbering of the TCG_COND constants it's not too
difficult to compute rather than have a table.

Signed-off-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

bcc66562 10/06/2012 07:48 pm Richard Henderson

tcg: Add is_unsigned_cond

Before we rearrange the TCG_COND enumeration, add a predicate for
the (single) use of comparisons vs TCGCond.

Signed-off-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

626cd050 10/06/2012 07:47 pm Aurelien Jarno

tcg: remove obsolete jmp op

The TCG jmp operation doesn't really make sense in the QEMU context, it
is unused, it is not implemented by some targets, and it is wrongly
implemented by some others.

This patch simply removes it.

Reviewed-by: Richard Henderson <>...

f97713ff 10/05/2012 03:12 pm Peter Maydell

tcg/arm: Use tcg_out_mov_reg rather than inline equivalent code

Use the recently introduced tcg_out_mov_reg() function rather than
the equivalent inline code.

Signed-off-by: Peter Maydell <>
Reviewed-by: Aurelien Jarno <>...

6673f47d 09/27/2012 10:28 pm Stefan Weil

tci: Fix for AREG0 free mode

Support for helper functions with 5 arguments was missing
in the code generator and in the interpreter.

There is no need to pass the constant TCG_AREG0 from the
code generator to the interpreter. Remove that code for
the INDEX_op_qemu_st* opcodes....

f813cb83 09/26/2012 01:31 am Aurelien Jarno

tcg/i386: fix build with -march < i686

The movcond_i32 op has to be protected with TCG_TARGET_HAS_movcond_i32
to fix the build with -march < i686.

Thanks to Richard Henderson for the hint.

Reported-by: Alex Barcelo <>
Signed-off-by: Aurelien Jarno <>

0a209d4b 09/26/2012 01:31 am Richard Henderson

tcg: Sanity check goto_tb input

Checking that we don't try for idx != [01] is trivial. Checking
that we don't issue more than one of any index requires a tad
more data and some ifdefs protecting that new variable.

Signed-off-by: Richard Henderson <>...

a463133e 09/26/2012 01:31 am Richard Henderson

tcg: Streamline movcond_i64 using 32-bit arithmetic

Avoiding 64-bit arithmetic (outside of the compare) reduces the
generated op count from 15 to 12, and the generated code size on
i686 from 105 to 88 bytes.

Signed-off-by: Richard Henderson <>...

a80a6b63 09/26/2012 01:31 am Richard Henderson

tcg: Streamline movcond_i64 using movcond_i32

When movcond_i32 is available we can further reduce the generated
op count from 12 to 6, and the generated code size on i686 from
88 to 74 bytes.

Signed-off-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

8f06bf69 09/26/2012 01:31 am Aurelien Jarno

tcg/mips: fix MIPS32 detection

Fix the MIPS32 cpu detection so that it also works with
-march=octeon. Thanks to Andrew Pinski for the hint.

Cc: Andrew Pinski <>
Signed-off-by: Aurelien Jarno <>

5a696f6a 09/26/2012 01:31 am Richard Henderson

tcg: Adjust descriptions of *cond opcodes

The README file documented the operand ordering of the tcg_gen_*
functions. Since we're documenting opcodes here, use the true
operand ordering.

Signed-off-by: Richard Henderson <>
Cc: malc <>...

42ce3e20 09/26/2012 01:31 am Richard Henderson

tcg: Emit ANDI as EXTU for appropriate constants

Note that andi_i64 failed to perform even the minimal
optimizations promised by the README.

Signed-off-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

d81ada7f 09/26/2012 01:31 am Richard Henderson

tcg: Optimize initial inputs for ori_i64

Copy the same optimizations from ori_i32.

Signed-off-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

6f3bb33e 09/26/2012 01:31 am Richard Henderson

tcg: Emit XORI as NOT for appropriate constants

Note that xori_i64 failed to perform even the minimal
optimizations promised by the README.

Signed-off-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

77276f65 09/26/2012 01:31 am Richard Henderson

tcg: Implement concat*_i64 with deposit_i64

For tcg_gen_concat_i32_i64 we only use deposit if the host supports it.
For tcg_gen_concat32_i64 even if the host does not, as we get identical
code before and after.

Note that this relies on the ANDI -> EXTU patch for the identity claim....

c552d6c0 09/26/2012 01:31 am Richard Henderson

tcg: Add tcg_debug_assert

Like the C assert macro, except only enabled for CONFIG_DEBUG_TCG,
and without having to set _NDEBUG and disable all other asserts at
the same time.

The use of __builtin_unreachable (when available) gives the compiler
the same information, which may (or may not) help it optimize better....

717e7036 09/26/2012 01:31 am Richard Henderson

tcg: Sanity check deposit inputs

Given these are constants, checking once here means everything
after can assume they're correct.

Signed-off-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

04cbbdee 09/22/2012 08:59 pm Blue Swirl

Merge branch 'tcg-sparc' of git://repo.or.cz/qemu/rth

  • 'tcg-sparc' of git://repo.or.cz/qemu/rth:
    tcg-sparc: Preserve branch destinations during retranslation
    tcg-sparc: Fix and enable direct TB chaining.
    tcg-sparc: Add %g/%o registers to alloc_order...
e809c0dc 09/22/2012 08:24 pm Aurelien Jarno

Revert "tcg/mips"

This reverts commit ad49d1f75115663731bfe06dec61eed6775526ad.

This commit was not supposed to be pushed.

Signed-off-by: Aurelien Jarno <>

23f3ff26 09/22/2012 06:16 pm malc

tcg/ppc32: Implement movcond32

Thanks to Richard Henderson

Signed-off-by: malc <>

ad49d1f7 09/22/2012 06:07 pm Aurelien Jarno

tcg/mips

b18212c6 09/22/2012 05:52 pm Stefan Weil

tcg/i386: Add shortcuts for registers used in L constraint

While 64 bit hosts use the first three registers which are also used
as function input parameters, 32 bit hosts use TCG_REG_EAX and
TCG_REG_EDX which are not used in parameter passing.

After defining new register macros for the registers used in L...

d73685e3 09/22/2012 05:52 pm Stefan Weil

tcg/i386: Remove unused registers from tcg_target_call_iarg_regs

32 bit x86 hosts don't need registers for helper function arguments
because they use the default stack based calling convention.

Removing the registers allows simpler code for function
tcg_target_get_call_iarg_regs_count....

6e17d0c5 09/22/2012 05:52 pm Stefan Weil

tcg: Remove tcg_target_get_call_iarg_regs_count

The TCG targets no longer need individual implementations.

Since commit 6a18ae2d2947532d5c26439548afa0481c4529f9,
'flags' is no longer used in tcg_target_get_call_iarg_regs_count.

The remaining tcg_target_get_call_iarg_regs_count is trivial and only...

f0da3757 09/22/2012 04:10 pm Richard Henderson

tcg-hppa: Implement movcond

Signed-off-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

9bacf414 09/22/2012 04:10 pm Max Filippov

tcg/README: document tcg_gen_goto_tb restrictions

See
http://lists.nongnu.org/archive/html/qemu-devel/2012-09/msg03196.html
for the whole story.

Signed-off-by: Max Filippov <>
Signed-off-by: Aurelien Jarno <>

1b7621ad 09/22/2012 04:10 pm Stefan Weil

w64: Fix TCG helper functions with 5 arguments

TCG uses 6 registers for function arguments on 64 bit Linux hosts,
but only 4 registers on W64 hosts.

Commit 2999a0b20074a7e4a58f56572bb1436749368f59 increased the number
of arguments for some important helper functions from 4 to 5...

e590d4e6 09/22/2012 04:10 pm Aurelien Jarno

tcg/optimize: rework copy progagation

The copy propagation pass tries to keep track what is a copy of what
and what has copy of what, and in addition it keep a circular list of
of all the copies. Unfortunately this doesn't fully work: a mov from
a temp which has a state "COPY" changed it into a state "HAS_COPY"....

1ff8c541 09/22/2012 04:10 pm Aurelien Jarno

tcg/optimize: do copy propagation for all operations

It is possible to due copy propagation for all operations, even the one
that have side effects or clobber arguments (it only concerns input
arguments). That said, the call operation should be handled differently...

0aba1c73 09/22/2012 04:10 pm Aurelien Jarno

tcg/optimize: optimize "op r, a, a => mov r, a"

Now that we can easily detect all copies, we can optimize the
"op r, a, a => mov r, a" case a bit more.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

3c94193e 09/22/2012 04:10 pm Aurelien Jarno

tcg/optimize: optimize "op r, a, a => movi r, 0"

Now that it's possible to detect copies, we can optimize the case
the "op r, a, a => movi r, 0". This helps in the computation of
overflow flags when one of the two args is 0.

Reviewed-by: Richard Henderson <>...

b336ceb6 09/22/2012 04:10 pm Aurelien Jarno

tcg/optimize: further optimize brcond/movcond/setcond

When both argument of brcond/movcond/setcond are the same or when one
of the two values is a constant equal to zero, it's possible to do
further optimizations.

Reviewed-by: Richard Henderson <>...

c2b0e2fe 09/22/2012 04:10 pm Aurelien Jarno

tcg/optimize: prefer the "op a, a, b" form for commutative ops

The "op a, a, b" form is better handled on non-RISC host than the "op
a, b, a" form, so swap the arguments to this form when possible, and
when b is not a constant.

This reduces the number of generated instructions by a tiny bit....

fba3161f 09/22/2012 04:10 pm Aurelien Jarno

tcg: remove #ifdef #endif around TCGOpcode tests

Commit 25c4d9cc changed all TCGOpcode enums to be available, so we don't
need to #ifdef #endif the one that are available only on some targets.
This makes the code easier to read.

Reviewed-by: Richard Henderson <>...

7ef55fc9 09/22/2012 04:10 pm Aurelien Jarno

tcg/optimize: add constant folding for deposit

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

0f46c064 09/22/2012 04:10 pm Aurelien Jarno

tcg/mips: optimize brcond arg, 0

MIPS has some conditional branch instructions when comparing with zero.
Use them.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

c1cf85c9 09/22/2012 04:10 pm Aurelien Jarno

tcg/mips: optimize bswap{16,16s,32} on MIPS32R2

bswap operations can be optimized on MIPS32 Release 2 using the ROTR,
WSBH and SEH instructions. We can't use the non-R2 code to implement the
ops due to registers constraints, so don't define the corresponding...

9a152519 09/22/2012 04:10 pm Aurelien Jarno

tcg/mips: implement rotl/rotr ops on MIPS32R2

rotr operations can be optimized on MIPS32 Release 2 using the ROTR and
ROTRV instructions. Also implemented rotl operations by subtracting the
shift from 32.

Reviewed-by: Richard Henderson <>...

04f71aa3 09/22/2012 04:10 pm Aurelien Jarno

tcg/mips: implement deposit op on MIPS32R2

deposit operations can be optimized on MIPS32 Release 2 using the INS
instruction.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

7d7c4930 09/22/2012 04:10 pm Aurelien Jarno

tcg/mips: implement movcond op on MIPS32R2

movcond operation can be implemented on MIPS32 Release 2 using the MOVN,
MOVZ, SLT and SLTU instructions.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

48b56ce1 09/22/2012 04:10 pm Aurelien Jarno

tcg/optimize: remove TCG_TEMP_ANY

TCG_TEMP_ANY has no different meaning than TCG_TEMP_UNDEF, so use
the later instead.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

b80bb016 09/22/2012 04:10 pm Aurelien Jarno

tcg/optimize: check types in copy propagation

The copy propagation doesn't check the types of the temps during copy
propagation. However TCG is using the mov_i32 for the i64 to i32
conversion and thus the two are not equivalent.

With this patch tcg_opt_gen_mov() doesn't consider two temps of...

2ceb3a9e 09/22/2012 04:10 pm Aurelien Jarno

tcg-mips: fix wrong usage of 'Z' constraint

The 'Z' constraint has been introduced to map the zero register. However
when the op also accept a constant, there is no point to accept the zero
register in addition.

Reviewed-by: Richard Henderson <>...

0834c9ea 09/22/2012 04:10 pm Aurelien Jarno

tcg/mips: kill warnings in user mode

Recent versions of GCC emit warnings when compiling user mode targets.
Kill them by reordering a bit the #ifdef.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

5a0eed37 09/22/2012 04:10 pm Aurelien Jarno

tcg/mips: use TCGArg or TCGReg instead of int

Instead of int, use the correct TCGArg and TCGReg type: TCGReg when
representing a TCG target register, TCGArg when representing the latter
or a constant.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

3314e008 09/22/2012 04:10 pm Aurelien Jarno

tcg/mips: don't use global pointer

Don't use the global pointer in TCG, in case helpers try access global
variables.

Signed-off-by: Aurelien Jarno <>

0d0b53a6 09/22/2012 04:10 pm Aurelien Jarno

tcg/mips: use stack for TCG temps

Use stack instead of temp_buf array in CPUState for TCG
temps.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

f4bf0b91 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Preserve branch destinations during retranslation

Signed-off-by: Richard Henderson <>

26adfb75 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Add %g/%o registers to alloc_order

Signed-off-by: Richard Henderson <>

5bbd2cae 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Fix and enable direct TB chaining.

Signed-off-by: Richard Henderson <>

4c3204cb 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Clean up cruft stemming from attempts to use global registers.

Don't use -ffixed-gN. Don't link statically. Don't save/restore
AREG0 around calls. Don't allocate space on the stack for AREG0 save.

Signed-off-by: Richard Henderson <>

1fd95946 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Mask shift immediates to avoid illegal insns.

The xtensa-test image generates a sra_i32 with count 0x40.
Whether this is accident of tcg constant propagation or
originating directly from the instruction stream is immaterial.

Signed-off-by: Richard Henderson <>

375816f8 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Use defines for temporaries.

And change from %i4/%i5 to %g1/%o7 to remove a v8plus fixme.

Signed-off-by: Richard Henderson <>

c6f7e4fb 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Support GUEST_BASE.

Signed-off-by: Richard Henderson <>

0c554161 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Change AREG0 in generated code to %i0.

We can now move the TCG variable from %g56 to a call-preserved
windowed register.

Signed-off-by: Richard Henderson <>

a0ce341a 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Fix qemu_ld/st to handle 32-bit host.

At the same time, split out the tlb load logic to a new function.
Fixes the cases of two data registers and two address registers.
Fixes the signature of, and adds missing, qemu_ld/st opcodes.

Signed-off-by: Richard Henderson <>

9b9c37c3 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Assume v9 cpu always, i.e. force v8plus in 32-bit mode.

Current code doesn't actually work in 32-bit mode at all. Since
no one really noticed, drop the complication of v7 and v8 cpus.
Eliminate the --sparc_cpu configure option and standardize macro...

3ee60ad4 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Hack in qemu_ld/st64 for 32-bit.

Not actually implemented, but at least we avoid the tcg assert at startup.

Signed-off-by: Richard Henderson <>

a221ae3f 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Fix ADDX opcode.

Signed-off-by: Richard Henderson <>

e55f523d 09/21/2012 08:53 pm Richard Henderson

tcg-hppa: Fix broken load/store helpers

The CONFIG_TCG_PASS_AREG0 code for calling ld/st helpers
was not respecting the ABI requirement for 64-bit values
being aligned in registers.

Mirror the ARM port in use of helper functions to marshal
arguments into the correct registers....

d0a16297 09/21/2012 08:53 pm Richard Henderson

tcg-i386: Implement movcond

Signed-off-by: Richard Henderson <>
Reviewed-by: Aurelien Jarno <>
Signed-off-by: Aurelien Jarno <>

fa01a208 09/21/2012 08:53 pm Richard Henderson

tcg: Optimize movcond for constant comparisons

Signed-off-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

5d8f5363 09/21/2012 08:53 pm Richard Henderson

tcg: Optimize two-address commutative operations

While swapping constants to the second operand, swap
sources matching destinations to the first operand.

Signed-off-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

fe7e1d3e 09/21/2012 08:53 pm Richard Henderson

tcg: Fix !USE_DIRECT_JUMP

Commit 6375e09e changed the type of TranslationBlock.tb_next,
but failed to change the type of TCGContext.tb_next.

Signed-off-by: Richard Henderson <>
Reviewed-by: Andreas Färber <>
Signed-off-by: Aurelien Jarno <>

c08d9ee3 09/21/2012 08:53 pm Richard Henderson

tcg-hppa: Fix brcond2 and setcond2

Neither of these functions were performing double-word
compares properly.

Signed-off-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

ffc5ea09 09/21/2012 08:53 pm Richard Henderson

tcg: Introduce movcond

Implemented with setcond if the target does not provide
the optional opcode.

Signed-off-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

a2550660 09/19/2012 10:53 pm Aurelien Jarno

tcg/optimize: fix end of basic block detection

Commit e31b0a7c050711884ad570fe73df806520953618 fixed copy propagation on
32-bit host by restricting the copy between different types. This was the
wrong fix.

The real problem is that the all temps states should be reset at the end...

d104bebd 09/19/2012 10:40 pm Aurelien Jarno

revert "TCG: fix copy propagation"

Given the copy propagation breakage on 32-bit hosts has been fixed
commit e31b0a7c050711884ad570fe73df806520953618 can be reverted.

Cc: Blue Swirl <>
Signed-off-by: Aurelien Jarno <>

5c2d2a9e 09/19/2012 10:40 pm Aurelien Jarno

tcg/i386: allow constants in load/store ops

On x86, it is possible to move a constant value to memory. Add code to
handle a constant argument to load/store ops.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

332864bd 09/19/2012 10:40 pm Aurelien Jarno

tcg: mark set_label with TCG_OPF_BB_END flag

set_label is effectively the end of a basic block, as no optimization
can be made accross it. It was treated as such in the liveness analysis
code, but as a special case.

Mark it with TCG_OPF_BB_END flag so that this information can be used...

89c33337 09/15/2012 08:51 pm Blue Swirl

Remove unused CONFIG_TCG_PASS_AREG0 and dead code

Now that CONFIG_TCG_PASS_AREG0 is enabled for all targets,
remove dead code and support for !CONFIG_TCG_PASS_AREG0 case.

Remove dyngen-exec.h and all references to it. Although included by
hw/spapr_hcall.c, it does not seem to use it....

fedc0da2 09/11/2012 07:06 pm Aurelien Jarno

tcg/optimize: fix if/else/break coding style

optimizer.c contains some cases were the break is appearing in both the
if and the else parts. Fix that by moving it to the outer part. Also
move some common code there.

Reviewed-by: Richard Henderson <>...

fbeaa26c 09/11/2012 07:06 pm Aurelien Jarno

tcg/optimize: add constant folding for brcond

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

f8dd19e5 09/11/2012 07:06 pm Aurelien Jarno

tcg/optimize: add constant folding for setcond

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

65a7cce1 09/11/2012 07:05 pm Aurelien Jarno

tcg/optimize: swap brcond/setcond arguments when possible

brcond and setcond ops are not commutative, but it's easy to compute the
new condition after swapping the arguments. Try to always put the constant
argument in second position like for commutative ops, to help backends to...

01ee5282 09/11/2012 07:05 pm Aurelien Jarno

tcg/optimize: simplify shift/rot r, 0, a => movi r, 0 cases

shift/rot r, 0, a is equivalent to movi r, 0.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

61251c0c 09/11/2012 07:05 pm Aurelien Jarno

tcg/optimize: simplify and r, a, 0 cases

and r, a, 0 is equivalent to a movi r, 0.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

38ee188b 09/11/2012 07:05 pm Aurelien Jarno

tcg/optimize: simplify or/xor r, a, 0 cases

or/xor r, a, 0 is equivalent to a mov r, a.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

56e49438 09/11/2012 07:05 pm Aurelien Jarno

tcg/optimize: split expression simplification

Split expression simplification in multiple parts so that a given op
can appear multiple times. This patch should not change anything.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>

c5cc28ff 09/11/2012 07:05 pm Aurelien Jarno

tcg: improve profiler

Now that there are two passes of optimization (optimize.c, liveness)
there is no point of outputing the statistics of the liveness part
only. Update the code to take into account both optimizations.

Reviewed-by: Richard Henderson <>...

6845df48 09/10/2012 02:38 pm Aurelien Jarno

tcg/s390: fix ld/st with CONFIG_TCG_PASS_AREG0

The load/store slow path has been broken in e141ab52d:
- We need to move 4 registers for store functions and 3 registers for
load functions and not the reverse.
- According to the s390x calling convention the arguments of a function...

18fec301 08/28/2012 09:38 pm Aurelien Jarno

tcg/mips: fix broken CONFIG_TCG_PASS_AREG0 code

The CONFIG_TCG_PASS_AREG0 code for calling ld/st helpers was
broken in that it did not respect the ABI requirement that 64
bit values were passed in even-odd register pairs. The simplest
way to fix this is to implement some new utility functions...

d03c98d8 08/26/2012 10:10 pm Aurelien Jarno

tcg/ia64: fix and optimize ld/st slow path

Store slow path has been broken in e141ab52d:
- the arguments are shifted before the last one (mem_index) is written.
- the shift is done for both slow and fast paths.

Fix that. Also optimize a bit by bundling the move together. This still...

18d445b4 08/26/2012 10:10 pm Aurelien Jarno

tcg/ia64: fix prologue/epilogue

Prologue and epilogue code has been broken in cea5f9a28.

Signed-off-by: Aurelien Jarno <>

9716ef3b 08/26/2012 09:14 pm Peter Maydell

tcg/arm: Fix broken CONFIG_TCG_PASS_AREG0 code

The CONFIG_TCG_PASS_AREG0 code for calling ld/st helpers was
broken in that it did not respect the ABI requirement that 64
bit values were passed in even-odd register pairs. The simplest
way to fix this is to implement some new utility functions...

3c01ae0e 06/24/2012 03:19 pm Scott Wood

tci: don't write zero for reloc in tci_out_label

If tci_out_label is called in the context of tcg_gen_code_search_pc, we
could be overwriting an already patched relocation with zero -- and not
repatch it because the set_label is past search_pc, causing a QEMU crash...

affe5189 06/24/2012 01:54 am Alexander Graf

TCG: Fix compile breakage in tcg_dump_ops

Commit eeacee4d865 changed the syntax of tcg_dump_ops, but didn't convert
all users (notably missing the ppc ones) to it. Fix them to the new syntax.

Signed-off-by: Alexander Graf <>
Signed-off-by: malc <>

eeacee4d 06/21/2012 09:45 pm Blue Swirl

qemu-log: cleanup

Don't use global variables directly but via accessor functions. Rename globals.

Convert macros to functions, add GCC format attributes.

Signed-off-by: Blue Swirl <>

24f50d7e 05/27/2012 08:52 pm Andreas Färber

tcg/ppc: Handle _CALL_DARWIN being undefined on Darwin

powerpc-apple-darwin9-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5577)
does not define _CALL_DARWIN, leading to unexpected behavior w.r.t.
register clobbering and stack frame layout.

Since _CALL_DARWIN is a reserved identifier, define a custom...

c82e5848 05/14/2012 11:53 pm Andreas Färber

tcg/ppc64: Don't hardcode register numbers for qemu_ld/st

Facilitates using r3 for prepended AREG0.

Signed-off-by: Andreas F?rber <>
Signed-off-by: malc <>

f4f7d01a 05/14/2012 11:53 pm Andreas Färber

tcg/ppc64: Fix CONFIG_TCG_PASS_AREG0

In qemu_ld/st load the registers for the helper calls directly rather
than rotating them around afterwards for AREG0.

Also clobber the additional register.

Signed-off-by: Andreas F?rber <>
Signed-off-by: malc <>

d831fdb0 05/09/2012 09:59 pm Andreas Färber

tcg/ppc: Don't hardcode register numbers

Also assure i64 alignment where necessary.

Alignment code optimization suggested by malc.

Signed-off-by: Andreas Färber <>
Acked-by: Alexander Graf <>
Signed-off-by: Anthony Liguori <>

a082615b 05/09/2012 09:59 pm Andreas Färber

tcg/ppc: Clobber r5 for 64-bit qemu_ld

This accounts for the additional addr_reg2 register.

Signed-off-by: Andreas Färber <>
Acked-by: Alexander Graf <>
Signed-off-by: Anthony Liguori <>

1b3e76eb 05/09/2012 09:59 pm Andreas Färber

tcg/ppc: Fix CONFIG_TCG_PASS_AREG0 mode

Adjust the tcg_out_qemu_{ld,st}() slow paths to pass AREG0 in r3,
based on patches by malc.

Also adjust the registers clobbered, based on patch by Alex.

Signed-off-by: Andreas Färber <>
Acked-by: Alexander Graf <>...

c1696d94 05/09/2012 09:59 pm Andreas Färber

tcg/ppc: Do not overwrite lower address word on Darwin and AIX

For targets where TARGET_LONG_BITS != 32, i.e. 64-bit guests,
addr_reg is moved to r4. For hosts without TCG_TARGET_CALL_ALIGN_ARGS
either data_reg2 or data_reg or a masked version thereof would overwrite...