Statistics
| Branch: | Revision:

root / tcg @ feature-archipelago

# Date Author Comment
c5d3c498 03/02/2014 03:12 pm Stefan Weil

tcg: Fix typo in comment (dependancies -> dependencies)

Signed-off-by: Stefan Weil <>
Signed-off-by: Michael Tokarev <>

774d566c 02/21/2014 12:39 pm Peter Maydell

tcg/i386: Fix build for systems without working cpuid.h (MacOSX, Win32)

Win32 doesn't have a cpuid.h, and MacOSX may have one but without
the __cpuid() function we use, which means that commit 9d2eec20
broke the build for those platforms. Fix this by tightening up...

23ec69ed 02/17/2014 06:12 pm Richard Henderson

tcg/optimize: Handle known-zeros masks for ANDC

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

e201b564 02/17/2014 06:12 pm Richard Henderson

tcg/optimize: Simply some logical ops to NOT

Given, of course, an appropriate constant. These could be generated
from the "canonical" operation for inversion on the guest, or via
other optimizations.

Reviewed-by: Paolo Bonzini <>
Reviewed-by: Aurelien Jarno <>...

e64e958e 02/17/2014 06:12 pm Richard Henderson

tcg/optimize: Optmize ANDC X,Y,Y to MOV X,0

Like we already do for SUB and XOR.

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

464a1441 02/17/2014 06:12 pm Richard Henderson

tcg/optimize: Add more identity simplifications

Recognize 0 operand to andc, and -1 operands to and, orc, eqv.

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

a1b29c9a 02/17/2014 06:12 pm Richard Henderson

tcg/i386: Move TCG_CT_CONST_* to tcg-target.c

These are not needed by users of tcg-target.h. No need to recompile
when we adjust them.

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

ecc7e843 02/17/2014 06:12 pm Richard Henderson

tcg/i386: Add tcg_out_vex_modrm

Prepare for emitting BMI insns which require VEX encoding.

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

9d2eec20 02/17/2014 06:12 pm Richard Henderson

tcg/i386: Use ANDN instruction

Note that the optimizer cannot simplify ANDC X,Y,C to AND X,Y,~C
so we must handle constants in the implementation of andc.

Reviewed-by: Paolo Bonzini <>
Signed-off-by: Richard Henderson <>

6399ab33 02/17/2014 06:12 pm Richard Henderson

tcg/i386: Use SHLX/SHRX/SARX instructions

These three-operand shift instructions do not require the shift count
to be placed into ECX. This reduces the number of mov insns required,
with the mere addition of a new register constraint.

Don't attempt to get rid of the matching constraint, as that's impossible...

e46b225a 02/17/2014 06:12 pm Aurelien Jarno

tcg/optimize: fix known-zero bits for right shift ops

32-bit versions of sar and shr ops should not propagate known-zero bits
from the unused 32 high bits. For sar it could even lead to wrong code
being generated.

Cc:
Reviewed-by: Paolo Bonzini <>...

3031244b 02/17/2014 06:12 pm Aurelien Jarno

tcg/optimize: fix known-zero bits optimization

Known-zero bits optimization is a great idea that helps to generate more
optimized code. However the current implementation only works in very few
cases as the computed mask is not saved.

Fix this to make it really working....

f096dc96 02/17/2014 06:12 pm Aurelien Jarno

tcg/optimize: improve known-zero bits for 32-bit ops

The shl_i32 op might set some bits of the unused 32 high bits of the
mask. Fix that by clearing the unused 32 high bits for all 32-bit ops
except load/store which operate on tl values.

Reviewed-by: Paolo Bonzini <>...

c8d70272 02/17/2014 06:12 pm Aurelien Jarno

tcg/optimize: add known-zero bits compute for load ops

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

7a3a0097 02/17/2014 06:12 pm Huw Davies

tcg-arm: The shift count of op_rotl_i32 is in args2 not args1.

It's this that should be subtracted from 0x20 when converting to a right rotate.

Cc:
Signed-off-by: Huw Davies <>
Signed-off-by: Richard Henderson <>

f6aa2f7d 02/16/2014 01:20 am Richard Henderson

TCG: Fix 32-bit host allocation typo

The second half register of a 64-bit temp on a 32-bit host
was allocated with the wrong base_type.

The base_type of the second half register is never checked,
but for consistency it should be the same as the first half....

c1de788a 02/08/2014 04:46 pm Peter Maydell

tcg: Add TCGV_UNUSED_PTR, TCGV_IS_UNUSED_PTR, TCGV_EQUAL_PTR

We have macros for marking TCGv values as unused, checking if they
are unused and comparing them to each other. However these only exist
for TCGv_i32 and TCGv_i64; add them for TCGv_ptr as well....

c6830cdb 02/01/2014 11:45 am Richard Henderson

tcg/s390: Remove sigill_handler

Commit c9baa30f42a87f61627391698f63fa4d1566d9d8 failed to
delete all of the relevant code, leading to Werrors about
unused symbols.

Signed-off-by: Richard Henderson <>
Signed-off-by: Michael Tokarev <>

dc08f851 01/30/2014 09:02 pm Peter Maydell

Merge remote-tracking branch 'rth/tcg-movbe' into staging

  • rth/tcg-movbe:
    tcg/i386: cleanup useless #ifdef
    tcg/i386: use movbe instruction in qemu_ldst routines
    tcg/i386: add support for three-byte opcodes
    tcg/i386: remove hardcoded P_REXW value...
18d13fa2 01/30/2014 03:25 pm Alexander Graf

TCG: Fix I64-on-32bit-host temporaries

We have cache pools of temporaries that we can reuse later when they've
already been allocated before.

These cache pools differenciate between the target TCG variable type they
contain. So we have one pool for I32 and one pool for I64 variables....

2d23d5ed 01/26/2014 01:21 am Aurelien Jarno

tcg/i386: cleanup useless #ifdef

TCG_TARGET_HAS_movcond_i32 is always defined to 1 in tcg-target.h, so
remove the corresponding #ifdef #endif sequence, left from a previous
refactoring.

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

085bb5bb 01/26/2014 01:19 am Aurelien Jarno

tcg/i386: use movbe instruction in qemu_ldst routines

The movbe instruction has been added on some Intel Atom CPUs and on
recent Intel Haswell CPUs. It allows to load/store a value and at the
same time bswap it.

This patch detects the avaibility of this instruction and when available...

2a113775 01/26/2014 12:12 am Aurelien Jarno

tcg/i386: add support for three-byte opcodes

Add support for three-byte opcodes, starting with the 0x0f 0x38 prefix.
Use P_EXT38 as the new constant, and shift all other constants so that
P_EXT and P_EXT38 have neighbouring values.

Signed-off-by: Aurelien Jarno <>...

c9d78213 01/26/2014 12:12 am Aurelien Jarno

tcg/i386: remove hardcoded P_REXW value

P_REXW is defined has a constant at the beginning of i386/tcg-target.c,
but the corresponding bit is later used in a harcoded way, which defeat
the purpose of a constant.

Fix that by using a conditional expression operator instead of a shift....

8589467f 12/21/2013 05:41 pm Aurelien Jarno

tcg/i386: fix a comment

The comments apply to 8-bit stores, not 8-byte stores.

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

0ec9eabc 12/10/2013 07:23 pm Richard Henderson

tcg: Use bitmaps for free temporaries

We previously allocated 32-bits per temp for the next_free_temp entry.
We now allocate 4 bits per temp across the 4 bitmaps.

Using a linked list meant that if a translator is tweeked, resulting in
temps being freed in a different order, that would have follow-on effects...

c9baa30f 11/29/2013 08:45 pm Richard Henderson

tcg-s390: Use qemu_getauxval in query_facilities

No need to set up a SIGILL signal handler for detection anymore.

Remove a ton of sanity checks that must be true, given that we're
requiring a 64-bit build (the note about 31-bit KVM is satisfied
by configuring with TCI)....

41d9ea80 11/29/2013 08:45 pm Richard Henderson

tcg-arm: Use qemu_getauxval

Allow host detection on linux systems without glibc 2.16 or later.

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

cd629de1 11/29/2013 08:45 pm Richard Henderson

tcg-ppc64: Use qemu_getauxval

Allow host detection on linux systems without glibc 2.16 or later.

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

463230d8 11/18/2013 07:57 am Richard Henderson

tcg-ia64: Introduce tcg_opc_bswap64_i

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

db008a8d 11/18/2013 07:57 am Richard Henderson

tcg-ia64: Introduce tcg_opc_ext_i

Being able to "extend" from 64-bits (with a mov) simplifies
a few places where the conditional breaks the train of thought.

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

fa0cdb6c 11/18/2013 07:57 am Richard Henderson

tcg-ia64: Introduce tcg_opc_movi_a

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

3b9ccdcc 11/18/2013 07:57 am Richard Henderson

tcg-ia64: Introduce tcg_opc_mov_a

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

25c9c73b 11/18/2013 07:57 am Richard Henderson

tcg-ia64: Use A3 form of logical operations

We can and/or/xor/andcm small constants, saving one cycle.

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

f940fb08 11/18/2013 07:57 am Richard Henderson

tcg-ia64: Use SUB_A3 and ADDS_A4 for subtraction

We can subtract from more small constants that just 0 with one insn,
and we can add the negative for most small constants.

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

8642088a 11/18/2013 07:57 am Richard Henderson

tcg-ia64: Use ADDS for small addition

Avoids a wasted cycle loading up small constants.

Simplify the code assuming the tcg optimizer is going to work
and don't expect the first operand of the add to be constant.

Acked-by: Aurelien Jarno <>...

3c289cba 11/18/2013 07:57 am Richard Henderson

tcg-ia64: Avoid unnecessary stop bit in tcg_out_alu

When performing an operation with two input registers, we'd leave
the stop bit (and thus an extra cycle) that's only needed when one
or the other input is a constant.

Acked-by: Aurelien Jarno <>...

d15de15c 11/18/2013 07:57 am Richard Henderson

tcg-ia64: Move AREG0 to R32

Since the move away from the global areg0, we're no longer globally
reserving areg0. Which means our use of R7 clobbers a call-saved
register. Shift areg0 into the windowed registers. Indeed, choose
the incoming parameter register that it comes to us by....

6d264b38 11/18/2013 07:56 am Richard Henderson

tcg-ia64: Simplify brcond

There was a misconception that a stop bit is required between a compare
and the branch that uses the predicate set by the compare. This lead to
the usage of an extra bundle in which to perform the compare. The extra
bundle left room for constants to be loaded for use with the compare insn....

6f65c780 11/18/2013 07:56 am Richard Henderson

tcg-ia64: Handle constant calls

Using only indirect calls results in 3 bundles (one to load the
descriptor address), and 4 stop bits. By looking through the
descriptor to the constants, we can perform the call with 2
bundles and only 1 stop bit.

Acked-by: Aurelien Jarno <>...

5f7b1687 11/18/2013 07:56 am Richard Henderson

tcg-ia64: Use shortcuts for nop insns

There's no need to go through the full opcode-to-insn function call
to generate nops. This makes the source a bit more readable.

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

e3afa1c4 11/18/2013 07:56 am Richard Henderson

tcg-ia64: Use TCGMemOp within qemu_ldst routines

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

a485cff0 10/13/2013 02:19 am Richard Henderson

tcg-arm: Tidy variable naming convention in qemu_ld/st

s/addr_reg2/addrhi/
s/addr_reg/addrlo/
s/data_reg2/datahi/
s/data_reg/datalo/

Signed-off-by: Richard Henderson <>

15ecf6e3 10/13/2013 02:19 am Richard Henderson

tcg-arm: Convert to new ldst opcodes

Signed-off-by: Richard Henderson <>

091d5677 10/13/2013 02:19 am Richard Henderson

tcg-arm: Improve GUEST_BASE qemu_ld/st

If we pull the code to emit the actual load/store into a subroutine,
we can share the reg+reg addressing mode code between softmmu and
usermode. This lets us load GUEST_BASE into a temporary register
rather than attempting to add it piece-wise to the address....

f1a16dcd 10/13/2013 02:19 am Richard Henderson

tcg-ppc: Use TCGMemOp within qemu_ldst routines

Signed-off-by: Richard Henderson <>

a0585573 10/13/2013 02:19 am Richard Henderson

tcg-ppc64: Use TCGMemOp within qemu_ldst routines

Signed-off-by: Richard Henderson <>

92d0acda 10/13/2013 02:19 am Richard Henderson

tcg-ppc: Convert to le/be ldst helpers

Signed-off-by: Richard Henderson <>

e349a8d4 10/13/2013 02:19 am Richard Henderson

tcg-ppc64: Convert to le/be ldst helpers

Signed-off-by: Richard Henderson <>

5dd39160 10/13/2013 02:19 am Richard Henderson

tcg-ppc: Support new ldst opcodes

Signed-off-by: Richard Henderson <>

1768ec06 10/13/2013 02:19 am Richard Henderson

tcg-ppc64: Support new ldst opcodes

Signed-off-by: Richard Henderson <>

d257e0d7 10/13/2013 02:19 am Richard Henderson

tcg: Use TCGMemOp for TCGLabelQemuLdst.opc

Signed-off-by: Richard Henderson <>

37c5d0d5 10/13/2013 02:19 am Richard Henderson

tcg-i386: Use TCGMemOp within qemu_ldst routines

Step one in the transition, with constants passed down from tcg_out_op.

Signed-off-by: Richard Henderson <>

7352ee54 10/13/2013 02:19 am Richard Henderson

tcg-i386: Tidy softmmu routines

Pass two TCGReg to tcg_out_tlb_load, rather than idx+args.

Move ldst_optimization routines just below tcg_out_tlb_load to avoid
the need for forward declarations.

Use TCGReg enum in preference to int where apprpriate.

Signed-off-by: Richard Henderson <>

b3e2bc50 10/13/2013 02:19 am Richard Henderson

tcg-i386: Remove "cb" output restriction from qemu_st8 for i386

Once we form a combined qemu_st_i32 opcode, we won't be able to
have separate constraints based on size. This one is fairly easy
to work around, since eax is available as a scratch register....

8221a267 10/13/2013 02:19 am Richard Henderson

tcg-i386: Support new ldst opcodes

No support for helpers with non-default endianness yet,
but good enough to test the opcodes.

Signed-off-by: Richard Henderson <>

099fcf2e 10/13/2013 02:19 am Richard Henderson

tcg-arm: Use TCGMemOp within qemu_ldst routines

Signed-off-by: Richard Henderson <>

0315c51e 10/13/2013 02:19 am Richard Henderson

tcg-arm: Convert to le/be ldst helpers

Signed-off-by: Richard Henderson <>

f713d6ad 10/10/2013 11:19 pm Richard Henderson

tcg: Add qemu_ld_st_i32/64

Step two in the transition, adding the new ldst opcodes. Keep the old
opcodes around until all backends support the new opcodes.

Signed-off-by: Richard Henderson <>

867b3201 10/10/2013 11:19 pm Richard Henderson

exec: Add both big- and little-endian memory helpers

Step three in the transition: helpers not tied to the target
"default" endianness. To be used when the guest uses a memory
operation with non-default endianness.

Signed-off-by: Richard Henderson <>

6c5f4ead 10/10/2013 10:20 pm Richard Henderson

tcg: Add TCGMemOp

Signed-off-by: Richard Henderson <>

3cf246f0 10/10/2013 09:44 pm Richard Henderson

tcg: Add tcg-be-null.h

This is a no-op backend data implementation, for those targets that
are not currently using the load/store optimization path.

This is prepatory to always requiring these functions in all backends.

Signed-off-by: Richard Henderson <>

9ecefc84 10/10/2013 09:44 pm Richard Henderson

tcg: Add tcg-be-ldst.h

Move TCGLabelQemuLdst and related stuff out of tcg.h.

Signed-off-by: Richard Henderson <>

100b5e01 10/10/2013 09:44 pm Richard Henderson

tcg: Put target helper data into an array.

One call inside of a loop to tcg_register_helper instead of hundreds
of sequential calls.

Presumably more icache and branch prediction friendly; resulting binary
size mostly unchanged on x86_64, as we're trading 32-bit rip-relative...

4953ee62 10/10/2013 09:44 pm Richard Henderson

tcg: Add tcg-runtime.c helpers to all_helpers

For the few targets that actually use these, we'd not report
them symbolicly in the tcg opcode logs.

Signed-off-by: Richard Henderson <>

84fd9dd3 10/10/2013 09:44 pm Richard Henderson

tcg: Merge tcg_register_helper into tcg_context_init

Eliminates the repeated checks for having created
the s->helpers hash table.

Signed-off-by: Richard Henderson <>

023261ef 10/10/2013 09:44 pm Richard Henderson

tcg-aarch64: Update to helper_ret_*_mmu routines

A minimal update to use the new helpers with the return address argument.

Tested-by: Claudio Fontana <>
Reviewed-by: Claudio Fontana <>
Signed-off-by: Richard Henderson <>

5cd8f621 10/10/2013 09:43 pm Richard Henderson

tcg: Move helper registration into tcg_context_init

No longer needs to be done on a per-target basis.

Signed-off-by: Richard Henderson <>

6e085f72 10/10/2013 09:41 pm Richard Henderson

tcg: Use a GHashTable for tcg_find_helper

Slightly changes the interface, in that we now return name
instead of a TCGHelperInfo structure, which goes away.

Reviewed-by: Stefan Weil <>
Signed-off-by: Richard Henderson <>

7c57df0d 10/10/2013 09:41 pm Richard Henderson

tcg: Delete tcg_helper_get_name declaration

The function was deleted in 4dc81f2822187f4503d4bdb76785cafa5b28db0b.

Reviewed-by: Stefan Weil <>
Signed-off-by: Richard Henderson <>

802b5081 10/10/2013 09:31 pm Richard Henderson

tcg-hppa: Remove tcg backend

Signed-off-by: Richard Henderson <>

576e81be 10/09/2013 05:52 pm Anthony Liguori

Merge remote-tracking branch 'rth/tcg-arm-pull' into staging

  1. By Richard Henderson
  2. Via Richard Henderson
    • rth/tcg-arm-pull:
      tcg-arm: Move the tlb addend load earlier
      tcg-arm: Remove restriction on qemu_ld output register
      tcg-arm: Return register containing tlb addend...
ce079abb 10/09/2013 05:51 pm Anthony Liguori

Merge remote-tracking branch 'sweil/tci' into staging

  1. By Stefan Weil
  2. Via Stefan Weil
    • sweil/tci:
      misc: Use new rotate functions
      bitops: Add rotate functions (rol8, ror8, ...)
      tci: Add implementation of rotl_i64, rotr_i64

Message-id: ...

23bbc250 10/01/2013 08:20 pm Richard Henderson

tcg-arm: Use ldrd/strd for appropriate qemu_ld/st64

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

d9f4dde4 10/01/2013 08:20 pm Richard Henderson

tcg-arm: Rearrange slow-path qemu_ld/st

Use the new helper_ret_*_mmu routines. Use a conditional call
to arrange for a tail-call from the store path, and to load the
return address for the helper for the load path.

Signed-off-by: Richard Henderson <>

e5e2e4a7 10/01/2013 08:20 pm Richard Henderson

tcg-arm: Use strd for tcg_out_arg_reg64

Signed-off-by: Richard Henderson <>

f2488736 10/01/2013 08:20 pm Richard Henderson

tcg-arm: Use QEMU_BUILD_BUG_ON to verify constraints on tlb

One of the two constraints we already checked via #if, but
the tlb offset distance was only checked at runtime.

Signed-off-by: Richard Henderson <>

d0ebde22 10/01/2013 08:20 pm Richard Henderson

tcg-arm: Move load of tlb addend into tcg_out_tlb_read

This allows us to make more intelligent decisions about the relative
offsets of the tlb comparator and the addend, avoiding any need of
writeback addressing.

Signed-off-by: Richard Henderson <>

d3e440be 10/01/2013 08:20 pm Richard Henderson

tcg-arm: Return register containing tlb addend

Preparatory to rescheduling the tlb load, and changing said register.
Continues to use R1 for now.

Signed-off-by: Richard Henderson <>

66c2056f 10/01/2013 08:20 pm Richard Henderson

tcg-arm: Remove restriction on qemu_ld output register

The main intent of the patch is to allow the tlb addend register
to be changed, without tying that change to the constraint. But
the most common side-effect seems to be to enable usage of ldrd
with the r0,r1 pair....

ee06e230 10/01/2013 08:20 pm Richard Henderson

tcg-arm: Move the tlb addend load earlier

There are free scheduling slots between the sequence of
comparison instructions. This requires changing the
register in use to avoid conflict with those compares.

Signed-off-by: Richard Henderson <>

3df2b8fd 09/25/2013 10:23 pm Stefan Weil

misc: Use new rotate functions

Signed-off-by: Stefan Weil <>

d285bf78 09/25/2013 10:22 pm Stefan Weil

tci: Add implementation of rotl_i64, rotr_i64

It is used by qemu-ppc64 when running Debian's busybox-static.

Cc: qemu-stable <>
Signed-off-by: Stefan Weil <>
Reviewed-by: Richard Henderson <>

7f12d649 09/25/2013 05:46 pm Richard Henderson

tcg-ppc64: Implement CONFIG_QEMU_LDST_OPTIMIZATION

Signed-off-by: Richard Henderson <>

29b69198 09/25/2013 05:46 pm Richard Henderson

tcg-ppc64: More use of TAI and SAI helper macros

Finish conversion of all memory operations.

Signed-off-by: Richard Henderson <>

8327a470 09/25/2013 05:46 pm Richard Henderson

tcg-ppc64: Use TCG_REG_Rn constants

Instead of bare N, for clarity. The only (intentional) exception made
is for insns that encode R|0, i.e. when R0 encoded into the insn is
interpreted as zero not the contents of the register.

Signed-off-by: Richard Henderson <>

5e0f40cf 09/25/2013 05:46 pm Richard Henderson

tcg-ppc64: Use tcg_out64

Signed-off-by: Richard Henderson <>

f8b84129 09/25/2013 05:46 pm Richard Henderson

tcg-ppc64: Avoid code for nop move

While these are rare from code that's been through the optimizer,
it's not uncommon within the tcg backend.

Signed-off-by: Richard Henderson <>

ad94e1a9 09/25/2013 05:46 pm Richard Henderson

tcg-ppc64: Don't load the static chain from TCG

There are no helpers that require the static chain.

Signed-off-by: Richard Henderson <>

d40f3cb1 09/25/2013 05:46 pm Richard Henderson

tcg-ppc64: Fold constant call address into descriptor load

Eliminates one insn per call:

:  lis     r2,4165
: ori r2,r2,59616
: ld r0,0(r2)
: ld r0,-5920(r2)
: mtctr r0
-: ld r2,8(r2)
: ld r2,-5912(r2)
: bctrl

Signed-off-by: Richard Henderson <>

b0940da0 09/25/2013 05:46 pm Richard Henderson

tcg-ppc64: Look through a constant function descriptor

Especially in the user-only configurations, a direct branch into
the executable may be in range.

Signed-off-by: Richard Henderson <>

5e1702b0 09/25/2013 05:46 pm Richard Henderson

tcg-ppc64: Tidy register allocation order

Remove conditionalization from tcg_target_reg_alloc_order, relying on
reserved_regs to prevent register allocation that shouldn't happen.
So R11 is now present in reg_alloc_order for APPLE, but also now
reserved....

b18d5d2b 09/25/2013 05:46 pm Richard Henderson

tcg-ppc64: Handle long offsets better

Previously we'd only handle 16-bit offsets from memory operand without falling
back to indexed, but it's easy to use ADDIS to handle full 32-bit offsets.

This also lets us unify code that existed inline in tcg_out_op for handling...

fa94c3be 09/25/2013 05:46 pm Richard Henderson

tcg-ppc64: Implement tcg_register_jit

Signed-off-by: Richard Henderson <>

fedee3e7 09/25/2013 05:46 pm Richard Henderson

tcg-ppc64: Streamline tcg_out_tlb_read

Less conditional compilation. Merge an add insn with the indexed
memory load insn. Load the tlb addend earlier. Avoid the address
update memory form.

Fix a bug in not allowing large enough tlb offsets for some guests....

c7ca6a2b 09/25/2013 05:46 pm Richard Henderson

tcg-ppc64: Add _noaddr functions for emitting forward branches

... rather than open-coding this stuff through the file.

Signed-off-by: Richard Henderson <>

1d10cf98 09/25/2013 05:46 pm Richard Henderson

tcg-ppc: Cleanup tcg_out_qemu_ld/st_slow_path

Coding style fixes. Use TCGReg enumeration values instead of raw
numbers. Don't needlessly pull the whole TCGLabelQemuLdst struct
into local variables. Less conditional compilation.

No functional changes....

5b1c985b 09/25/2013 05:46 pm Richard Henderson

tcg-ppc: Use conditional branch and link to slow path

Saves one insn per slow path. Note that we can no longer use
a tail call into the store helper.

Signed-off-by: Richard Henderson <>

8f50c841 09/25/2013 05:46 pm Richard Henderson

tcg-ppc: Fix and cleanup tcg_out_tlb_check

The fix is that sparc has so many mmu modes that the last one overflowed
the 16-bit signed offset we assumed would fit. Handle this, and check
the new assumption at compile time.

Load the tlb addend earlier for the fast path....

541dd4ce 09/25/2013 05:46 pm Richard Henderson

tcg-ppc64: Reformat tcg-target.c

Whitespace and brace changes only.

Signed-off-by: Richard Henderson <>