Statistics
| Branch: | Revision:

root / tcg @ 01ee5282

# Date Author Comment
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...

f05ae537 05/03/2012 02:48 pm malc

Bail out if CONFIG_TCG_PASS_AREG0 is defined

Signed-off-by: malc <>

f6af014e 05/03/2012 02:47 pm malc

Restore consistent formatting

Signed-off-by: malc <>

c170cb66 04/15/2012 10:25 pm Stefan Weil

tcg/i386: Use GDB JIT debugging interface only for hosts with ELF

Not all i386 / x86_64 hosts use ELF.
Ask the compiler whether ELF is used.

On w64, gdb crashes when ELF_HOST_MACHINE is defined.

Cc: Blue Swirl <>
Acked-by: Richard Henderson <>...

8d918718 04/15/2012 10:25 pm Stefan Weil

tcg/i386: Add support for w64 ABI

w64 uses the registers rcx, rdx, r8 and r9 for function arguments,
so it needs a different declaration of tcg_target_call_iarg_regs.

rax, rcx, rdx, r8, r9, r10 and r11 may be changed by function calls.

rbx, rbp, rdi, rsi, r12, r13, r14 and r15 remain unchanged by function calls....

f638f0d3 03/29/2012 10:10 am Li Zhang

qemu tcg: Remove one entry of INDEX_op_ld_i64 from ppc_op_defs

There two entries of INDEX_op_ld_i64 in the ppc_op_defs. That causes an
assertion failure in tcg_add_target_add_op_defs() when --enable-debug is
used on a ppc64 backend (that's ppc64 host, not target)....

cb1977d3 03/24/2012 09:57 pm Richard Henderson

tcg-sparc: Add debug_frame support.

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

e7bd6300 03/24/2012 09:57 pm Richard Henderson

tcg-hppa: Add debug_frame support.

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

abbb3eae 03/24/2012 09:57 pm Richard Henderson

tcg: Allow ELF_HOST_FLAGS and ELF_OSABI overrides in gdb-jit.

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

5872bbf2 03/24/2012 09:57 pm Richard Henderson

tcg: Add debug_info to JIT ELF image.

This allows us to actually supply a function name in softmmu builds;
gdb doesn't pick up the minimal symbol table otherwise. Also add a
bit of documentation and statically generate more of the ELF image.

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

813da627 03/24/2012 03:07 pm Richard Henderson

tcg: Use the GDB JIT debugging interface.

This allows us to generate unwind info for the dynamicly generated
code in the code_gen_buffer. Only i386 is converted at this point.

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

5bd33de6 03/18/2012 09:15 pm Blue Swirl

tcg: fix sparc host for AREG0 free operation

e141ab52d2ea5d0bc6ad3b1ad32841127ca04adc didn't handle
the other memory access helper case, fix.

Signed-off-by: Blue Swirl <>

e141ab52 03/18/2012 02:21 pm Blue Swirl

softmmu templates: optionally pass CPUState to memory access functions

Optionally, make memory access helpers take a parameter for CPUState
instead of relying on global env.

On most targets, perform simple moves to reorder registers. On i386,
switch from regparm(3) calling convention to standard stack-based...

6a18ae2d 03/18/2012 02:21 pm Blue Swirl

i386: Remove REGPARM

Use stack based calling convention (GCC default) for interfacing with
generated code instead of register based convention (regparm(3)).

Signed-off-by: Blue Swirl <>

69784eae 03/17/2012 03:02 pm Stefan Weil

w64: Fix data type of next_tb and tcg_qemu_tb_exec

next_tb is the numeric value of a tcg target (= QEMU host) address.

Using tcg_target_ulong instead of unsigned long shows this and makes
the code portable for hosts with an unusual size of long (w64).

The type cast '(long)(next_tb & ~3)' was not needed (casting...

4055299e 03/17/2012 02:57 pm Kirill Batuzov

Fix large memory chunks allocation with tcg_malloc.

An attempt to allocate a large memory chunk after a small one resulted in
circular links in list of pools. It caused the same memory being
allocated twice for different arrays.

Now pools for large memory chunks are kept in separate list and are...

9349b4f9 03/14/2012 11:20 pm Andreas Färber

Rename CPUState -> CPUArchState

Scripted conversion:
for file in .[hc] hw/.[hc] hw/kvm/*.[hc] linux-user/*.[hc] linux-user/m68k/*.[hc] bsd-user/*.[hc] darwin-user/*.[hc] tcg/*/*.[hc] target-*/cpu.h; do
sed -i "s/CPUState/CPUArchState/g" $file
done...

9d6fca70 03/11/2012 01:28 pm Stefan Weil

tcg: Improve tcg_out_label and fix its usage for w64

tcg_out_label is always called with a third argument of pointer type
which was casted to tcg_target_long.

These casts can be avoided by changing the prototype of tcg_out_label.

There was also a cast to long. For most hosts with...

2aeabc08 03/03/2012 08:10 pm Stefan Weil

w64: fix type casts when calling flush_icache_range

Signed-off-by: Stefan Weil <>
Signed-off-by: Blue Swirl <>

dba4f1bc 03/03/2012 08:10 pm Stefan Weil

w64: Change data type of parameters for flush_icache_range

The TCG targets i386 and tci needed a change of the function
prototype for w64.

This change is currently not needed for the other TCG targets,
but it can be applied to avoid code differences.

Cc: Blue Swirl <>...

f57a5160 03/03/2012 08:10 pm Stefan Weil

w64: Fix data type of parameters for flush_icache_range

flush_icache_range takes two address parameters which must be large
enough to address any address of the host.

For hosts with sizeof(unsigned long) == sizeof(void *), this patch
changes nothing. All currently supported hosts fall into this category....

c38bb94a 03/03/2012 08:10 pm Stefan Weil

tcg: Rearrange definitions and include statements

This change makes tcg_target_ulong available in tcg-target.h.

Signed-off-by: Stefan Weil <>
Signed-off-by: Blue Swirl <>

a97e45c8 02/23/2012 10:59 am Stefan Weil

tcg: Remove unneeded include statements

The standard include files are already included in qemu-common.h.

malloc.h and alloca.h were needed for alloca() which was removed
from TCG code some years ago when switching from dyngen to TCG
(see commit 49516bc0d622112caac9df628caf19010fda8b67)....

5c84bd90 01/13/2012 12:36 pm Aurelien Jarno

tcg-arm: fix a typo in comments

ARM still doesn't support 16GB buffers in 32-bit modes, replace the
16GB by 16MB in the comment.

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

05b922dd 01/10/2012 06:52 pm Peter Maydell

tcg/arm: Use r6 as TCG_AREG0 to avoid clash with Thumb framepointer

On ARM, in Thumb mode r7 is used for the framepointer; this meant
that we would fail to compile in debug mode because we were using r7
for TCG_AREG0. Shift to r6 instead to avoid this clash....

222f23f5 12/14/2011 10:58 pm Dr. David Alan Gilbert

tcg/arm: remove fixed map code buffer restriction

On ARM, don't map the code buffer at a fixed location, and fix up the
call/goto tcg routines to let it do long jumps.

Mapping the code buffer at a fixed address could sometimes result in it being
mapped over the top of the heap with pretty random results....

73f5e313 12/14/2011 01:13 pm Peter Maydell

tcg: make tcg_const_ptr actually accept a pointer argument

Make tcg_const_ptr() include a cast so that you can pass it a
pointer. This allows us to drop the casts we had in all the places
that use this macro.

Acked-by: Andreas Färber <>...

46d5dee0 12/09/2011 12:03 pm Stefan Weil

tcg: Remove redundant declarations of TCG_TARGET_REG_BITS

TCG_TARGET_REG_BITS is declared in tcg.h for all TCG targets.

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

9814dd27 12/02/2011 12:50 pm Dong Xu Wang

fix spelling in tcg sub directory

Signed-off-by: Dong Xu Wang <>
Signed-off-by: Stefan Hajnoczi <>

51711aee 11/28/2011 07:36 pm Stefan Weil

tci: Make flush_icache_range() inline

This is standard for other tcg targets and improves tci, too.

Signed-off-by: Stefan Weil <>
Signed-off-by: Anthony Liguori <>

b08d26b7 11/19/2011 01:20 pm Richard Henderson

tcg-sparc: Fix set-but-not used warnings.

In both cases, val is computed, but then not used in the
subsequent line, which then re-computes the quantity in
a different type (int32_t vs unsigned long).

Keep the computation type that's been working so far....

25cc4a76 11/19/2011 01:17 pm Blue Swirl

Merge branch 's390-1.0' of git://repo.or.cz/qemu/agraf

  • 's390-1.0' of git://repo.or.cz/qemu/agraf:
    s390x: initialize virtio dev region
    tcg: Use TCGReg for standard tcg-target entry points.
    tcg: Standardize on TCGReg as the enum for hard registers
    s390x: Add shutdown for TCG s390-virtio machine...
2a534aff 11/14/2011 06:47 pm Richard Henderson

tcg: Use TCGReg for standard tcg-target entry points.

Including tcg_out_ld, tcg_out_st, tcg_out_mov, tcg_out_movi.

Signed-off-by: Richard Henderson <>
Reviewed-by: Andreas Färber <>
Reviewed-by: Stefan Weil <>...

771142c2 11/14/2011 06:47 pm Richard Henderson

tcg: Standardize on TCGReg as the enum for hard registers

Most targets did not name the enum; tci used TCGRegister.

Signed-off-by: Richard Henderson <>
Reviewed-by: Andreas Färber <>
Reviewed-by: Stefan Weil <>...

9df3b45d 11/11/2011 06:33 pm David Gibson

tcg-ppc64: Fix compile errors for userspace only builds with gcc 4.6

tcg/ppc64/tcg-target.c has a couple of places where variables are set
unconditionally, but otherwise used only for softmmu builds, not
userspace only builds. This causes compiler warnings (which are fatal...

c51d9cb5 11/02/2011 10:52 pm Blue Swirl

Merge branch 'tci' of git://qemu.weilnetz.de/qemu

  • 'tci' of git://qemu.weilnetz.de/qemu:
    tcg: Add tcg interpreter to configure / make
    tcg: Add tci disassembler
    tcg: Add interpreter for bytecode
    tcg: Add bytecode generator for tcg interpreter
    tcg: Make ARRAY_SIZE(tcg_op_defs) globally available...
0756e71c 11/02/2011 12:12 am Richard Henderson

tcg: Fix whitespace in tcg-op.h.

Removing the only tabs in the file.

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

2f98c9db 11/02/2011 12:12 am Richard Henderson

tcg: Fix regression in tcg_gen_deposit_i64.

The error being caused by the failure to copy the other half of
the input to the output after having narrowed the deposit operation.

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

ce285b17 10/31/2011 10:52 pm Stefan Weil

tcg: TCG targets may define tcg_qemu_tb_exec

Targets may use a non standard definition of tcg_tb_exec
by defining this macro in their tcg_target.h.

This is used here by ppc. It will be used by the TCG interpreter, too.

Cc: malc <>
Signed-off-by: Stefan Weil <>

2a24374a 10/31/2011 10:52 pm Stefan Weil

tcg: Make ARRAY_SIZE(tcg_op_defs) globally available

tcg_op_defs was already a global array.

The tci disassembler also needs ARRAY_SIZE(tcg_op_defs),
so add a new global constant with this value.

Signed-off-by: Stefan Weil <>

7316329a 10/31/2011 10:52 pm Stefan Weil

tcg: Add bytecode generator for tcg interpreter

Unlike other tcg target code generators, this one does not generate
machine code for some cpu. It generates machine independent bytecode
which is interpreted later.

This allows running QEMU on any host.

Interpreted bytecode is slower than direct execution of generated...

df072774 10/30/2011 11:06 am Richard Henderson

tcg: Optimize some forms of deposit.

If the deposit replaces the entire word, optimize to a move.

If we're inserting to the top of the word, avoid the mask of arg2
as we'll be shifting out all of the garbage and shifting in zeros.

If the host is 32-bit, reduce a 64-bit deposit to a 32-bit deposit...

8ef935b2 10/14/2011 04:39 pm Stefan Weil

tcg: Fix spelling in comment (varables -> variables)

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

dc439de7 10/08/2011 06:21 pm Peter Maydell

tcg/s390: Remove unused tcg_out_addi()

Remove the unused function tcg_out_addi() from the s390 TCG backend;
this brings it into line with other backends.

Signed-off-by: Peter Maydell <>
Acked-by: Richard Henderson <>...

49856292 10/08/2011 06:20 pm Peter Maydell

tcg/ia64: Remove unused tcg_out_addi()

Remove the unused function tcg_out_addi() from the ia64 TCG backend;
this brings it into line with other backends.

Signed-off-by: Peter Maydell <>
Signed-off-by: Blue Swirl <>

a4773324 10/01/2011 09:42 am Jan Kiszka

tcg-i386: Introduce limited deposit support

x86 cannot provide an optimized generic deposit implementation. But at
least for a few special cases, namely for writing bits 0..7, 8..15, and
0..15, versions using only a single instruction are feasible.
Introducing such limited support improves emulating 16-bit x86 code on...

df0eda9b 10/01/2011 09:15 am Peter Maydell

tcg/arm: Remove unused tcg_out_addi()

Remove the unused function tcg_out_addi() from the ARM TCG backend;
this fixes a compilation failure on ARM hosts with newer gcc.

Signed-off-by: Peter Maydell <>
Reviewed-by: Richard Henderson <>...

7f6f0ae5 10/01/2011 09:11 am Stefan Weil

tcg: Add some assertions

Signed-off-by: Stefan Weil <>
Signed-off-by: Blue Swirl <>

c0ad3001 10/01/2011 09:11 am Stefan Weil

tcg: Add forward declarations for local functions

These functions are defined in the tcg target specific file
tcg-target.c.

The forward declarations assert that every tcg target uses
the same function prototype.

Signed-off-by: Stefan Weil <>...

840f5861 10/01/2011 09:11 am Stefan Weil

tcg: Don't declare TCG_TARGET_REG_BITS in tcg-target.h

It is now declared for all tcg targets in tcg.h,
so the tcg target specific declarations are redundant.

Signed-off-by: Stefan Weil <>
Signed-off-by: Blue Swirl <>

817b838e 10/01/2011 09:09 am Stefan Weil

tcg: Declare TCG_TARGET_REG_BITS in tcg.h

TCG_TARGET_REG_BITS can be determined by the compiler,
so there is no need to declare it for each individual tcg target.

This is especially important for new tcg targets
which will be supported by the tcg interpreter....

be9c4183 09/17/2011 08:56 pm Stefan Weil

tcg/ppc64: Only one call output register needed for 64 bit hosts

The second register is only needed for 32 bit hosts.

Cc: Vassili Karpov <>
Fine-with-me'd-by: Vassili Karpov <>
Signed-off-by: Stefan Weil <>...

26a74ae3 09/17/2011 08:55 pm Stefan Weil

tcg/sparc: Only one call output register needed for 64 bit hosts

The second register is only needed for 32 bit hosts.

Cc: Blue Swirl <>
Signed-off-by: Stefan Weil <>
Signed-off-by: Blue Swirl <>

5ddd17b4 09/17/2011 08:55 pm Stefan Weil

tcg/s390: Only one call output register needed for 64 bit hosts

The second register is only needed for 32 bit hosts.

Cc: Alexander Graf <>
Acked-by: Richard Henderson <>
Signed-off-by: Stefan Weil <>
Signed-off-by: Blue Swirl <>

af15a623 09/17/2011 08:54 pm Stefan Weil

tcg/ia64: Only one call output register needed for 64 bit hosts

The second register is never used for ia64 hosts.

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

68af23af 09/17/2011 08:54 pm Stefan Weil

tcg/i386: Only one call output register needed for 64 bit hosts

The second register is only needed for 32 bit hosts.

Signed-off-by: Stefan Weil <>
Signed-off-by: Blue Swirl <>

e89720b1 09/09/2011 06:07 pm Thomas Huth

tcg/ppc64: Fix zero extension code generation bug for ppc64 host

The ppc64 code generation backend uses an rldicr (Rotate Left Double
Immediate and Clear Right) instruction to implement zero extension of
a 32 bit quantity to a 64 bit quantity (INDEX_op_ext32u_i64). However...

70d705fd 09/01/2011 08:20 pm Peter Maydell

tcg/ppc/tcg-target.c: Avoid 'set but not used' gcc warnings

Move the declaration and initialisation of some variables in
tcg_out_qemu_ld and tcg_out_qemu_st inside CONFIG_SOFTMMU, to
avoid the "variable set but not used" warning of gcc 4.6.

Signed-off-by: Peter Maydell <>...

fe0de7aa 08/28/2011 10:17 am Blue Swirl

TCG: improve optimizer debugging

Use enum TCGOpcode instead of plain old int so that the name of
current op can be seen in GDB. Add a default case to switch
so that GCC does not complain about unhandled enum cases.

Signed-off-by: Blue Swirl <>

f412c762 08/23/2011 10:24 pm Richard Henderson

tcg: Update --enable-debug for TCG_OPF_NOT_PRESENT.

Signed-off-by: Richard Henderson <>
Reviewed-by: Peter Maydell <>
Signed-off-by: Edgar E. Iglesias <>

0bf1dbdc 08/22/2011 05:26 pm malc

tcg/ppc64: fix 16/32 mixup

Signed-off-by: malc <>

157f2662 08/22/2011 01:40 pm malc

tcg/ppc64: implement not_i32/64 and ext32u_i64

Signed-off-by: malc <>

350dba6c 08/22/2011 01:39 pm malc

tcg/ppc32: implement deposit_i32

Signed-off-by: malc <>

64ba39af 08/21/2011 09:52 pm Richard Henderson

tcg-ia64: Fix typos in AREG0 setup in prologue.

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

cb25c80a 08/21/2011 09:52 pm Richard Henderson

tcg: Constant fold neg, andc, orc, eqv, nand, nor.

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

6e6a9924 08/21/2011 09:52 pm Richard Henderson

tcg-hppa: Fix CPU_TEMP_BUF_NLONGS oversight.

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

25c4d9cc 08/21/2011 09:52 pm Richard Henderson

tcg: Always define all of the TCGOpcode enum members.

By always defining these symbols, we can eliminate a lot of ifdefs.

To allow this to be checked reliably, the semantics of the
TCG_TARGET_HAS_* macros must be changed from def/undef to true/false.
This allows even more ifdefs to be removed, converting them into...

8399ad59 08/21/2011 09:52 pm Richard Henderson

tcg: Add and use TCG_OPF_64BIT.

This allows the simplification of the op_bits function from
tcg/optimize.c.

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

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

e31b0a7c 08/07/2011 12:33 pm Blue Swirl

TCG: fix copy propagation

Copy propagation introduced in 22613af4a6d9602001e6d0e7b6d98aa40aa018dc
considered only global registers. However, register temps and stack
allocated locals must be handled differently because register temps
don't survive across brcond....

2ec00650 07/30/2011 09:54 pm Blue Swirl

TCG: fix breakage by previous patch

Fix incorrect logic and typos in previous commit
1bfd07bdfe56cea43dbe258dcb161e46b0ee29b7.

Signed-off-by: Blue Swirl <>

1bfd07bd 07/30/2011 03:21 pm Blue Swirl

TCG: fix breakage on some RISC hosts

Fix breakage by a640f03178c22355a158fa9378e4f8bfa4f517a6
and 55c0975c5b358e948b9ae7bd7b07eff92508e756.

Some TCG targets don't implement all TCG ops, so make
optimizing those conditional.

Signed-off-by: Blue Swirl <>

a640f031 07/30/2011 01:51 pm Kirill Batuzov

Do constant folding for unary operations.

Perform constant folding for NOT and EXT{8,16,32}{S,U} operations.

Signed-off-by: Kirill Batuzov <>
Signed-off-by: Blue Swirl <>

9a81090b 07/30/2011 01:51 pm Kirill Batuzov

Do constant folding for boolean operations.

Perform constant folding for AND, OR, XOR operations.

Signed-off-by: Kirill Batuzov <>
Signed-off-by: Blue Swirl <>

55c0975c 07/30/2011 01:51 pm Kirill Batuzov

Do constant folding for shift operations.

Perform constant forlding for SHR, SHL, SAR, ROTR, ROTL operations.

Signed-off-by: Kirill Batuzov <>
Signed-off-by: Blue Swirl <>

53108fb5 07/30/2011 01:51 pm Kirill Batuzov

Do constant folding for basic arithmetic operations.

Perform actual constant folding for ADD, SUB and MUL operations.

Signed-off-by: Kirill Batuzov <>
Signed-off-by: Blue Swirl <>

22613af4 07/30/2011 01:51 pm Kirill Batuzov

Add copy and constant propagation.

Make tcg_constant_folding do copy and constant propagation. It is a
preparational work before actual constant folding.

Signed-off-by: Kirill Batuzov <>
Signed-off-by: Blue Swirl <>

8f2e8c07 07/30/2011 01:51 pm Kirill Batuzov

Add TCG optimizations stub

Added file tcg/optimize.c to hold TCG optimizations. Function tcg_optimize
is called from tcg_gen_code_common. It calls other functions performing
specific optimizations. Stub for constant folding was added.

Signed-off-by: Kirill Batuzov <>...

ea15fb06 07/21/2011 12:03 am Stefan Weil

tcg/mips: Fix regression caused by typo (copy + paste bug)

cppcheck reports an error:
qemu/tcg/mips/tcg-target.c:1487: error: Invalid number of character (()

The unpatched code won't compile on mips hosts starting with commit
cea5f9a28faa528b6b1b117c9ab2d8828f473fef....

107a47cc 07/16/2011 04:17 pm Peter Maydell

tcg/README: Expand advice on number of TCG ops per target insn

Expand the note on the number of TCG ops generated per target insn,
to be clearer about the range of applicability of the 20 op rule
of thumb. Also add a note about the hard MAX_OP_PER_INSTR limit....

f74b32de 07/02/2011 09:48 pm Blue Swirl

TCG/PPC: use stack for TCG temps

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

Signed-off-by: Blue Swirl <>