Statistics
| Branch: | Revision:

root / tcg / arm / tcg-target.c @ 7a3a0097

History | View | Annotate | Download (72.1 kB)

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

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 <>

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....

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 <>

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 <>

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 <>

a05b5b9b 09/02/2013 07:08 pm Richard Henderson

tcg: Change tcg_out_ld/st offset to intptr_t

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

e58eb534 09/02/2013 07:08 pm Richard Henderson

exec: Split softmmu_defs.h

The _cmmu helpers can be moved to exec-all.h. The helpers that are
used from TCG will shortly need access to tcg_target_long so move
their declarations into tcg.h.

This requires minor include adjustments to all TCG backends.
...

2ba7fae2 09/02/2013 07:08 pm Richard Henderson

tcg: Change relocation offsets to intptr_t

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

0caa91fe 07/09/2013 05:15 pm Richard Henderson

tcg-arm: Implement tcg_register_jit

Allows unwinding past the code_gen_buffer.

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

1e709f38 07/09/2013 05:15 pm Richard Henderson

tcg-arm: Use AT_PLATFORM to detect the host ISA

With this we can generate armv7 insns even when the OS compiles for a
lower common denominator. The macros are arranged so that when we do
compile for a given ISA, all of the runtime checks for that ISA are...

cb91021a 07/09/2013 05:15 pm Richard Henderson

tcg-arm: Simplify logic in detecting the ARM ISA in use

GCC 4.8 defines a handy __ARM_ARCH symbol that we can use, which
will make us nicely forward compatible with ARMv8 AArch32.

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

fb822738 07/09/2013 05:14 pm Richard Henderson

tcg-arm: Rename use_armv5_instructions to use_armvt5_instructions

As it really controls the availability of a thumb interworking
instruction on armv5t.

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

72e1ccfc 07/09/2013 05:14 pm Richard Henderson

tcg-arm: Make use of conditional availability of opcodes for divide

We can now detect and use divide instructions at runtime, rather than
having to restrict their availability to compile-time.

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

5e1108b3 07/09/2013 05:14 pm Richard Henderson

tcg-arm: Don't implement rem

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

56bbc2f9 06/05/2013 03:54 pm Richard Henderson

tcg: Remove redundant tcg_target_init checks

We've got a compile-time check for the condition in exec/cpu-defs.h.

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

c9e53a4c 05/03/2013 12:53 pm Richard Henderson

tcg-arm: Use movi32 in exit_tb

Avoid the mini constant pool for armv7, and avoid replicating
the test for pre-v7.

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

8ddaeb1b 05/03/2013 12:53 pm Richard Henderson

tcg-arm: Fix 64-bit tlb load for pre-v6

Found by inspection, since the effect of the bug was simply to
send all memory ops through the slow path.

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

cee87be8 04/27/2013 03:16 am Richard Henderson

tcg-arm: Split out tcg_out_tlb_read

Share code between qemu_ld and qemu_st to process the tlb.

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

702b33b1 04/27/2013 03:16 am Richard Henderson

tcg-arm: Improve scheduling of tcg_out_tlb_read

The schedule was fully serial, with no possibility for dual issue.
The old schedule had a minimal issue of 7 cycles; the new schedule
has a minimal issue of 5 cycles.

Signed-off-by: Richard Henderson <>

595b5397 04/27/2013 03:16 am Richard Henderson

tcg-arm: Delete the 'S' constraint

After the previous patch, 's' and 'S' are the same.

Signed-off-by: Richard Henderson <>

302fdde7 04/27/2013 03:16 am Richard Henderson

tcg-arm: Use movi32 + blx for calls on v7

Work better with branch predition when we have movw+movt,
as the size of the code is the same. Perhaps re-evaluate
when we have a proper constant pool.

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

df5e0ef7 04/27/2013 03:16 am Richard Henderson

tcg-arm: Convert to CONFIG_QEMU_LDST_OPTIMIZATION

Move the slow path out of line, as the TODO's mention.
This allows the fast path to be unconditional, which can
speed up the fast path as well, depending on the core.

Signed-off-by: Richard Henderson <>

96fbd7de 04/27/2013 03:16 am Richard Henderson

tcg-arm: Remove long jump from tcg_out_goto_label

Branches within a TB will always be within 16MB.

Signed-off-by: Richard Henderson <>

b6b24cb0 04/27/2013 03:16 am Richard Henderson

tcg-arm: Implement deposit for armv7

We have BFI and BFC available for implementing it.

Signed-off-by: Richard Henderson <>

0637c56c 04/27/2013 03:16 am Richard Henderson

tcg-arm: Implement division instructions

An armv7 extension implements division, present on Cortex A15.

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

4346457a 04/27/2013 03:16 am Richard Henderson

tcg-arm: Use TCG_REG_TMP name for the tcg temporary

Don't hard-code R8.

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

13dd6fb9 04/27/2013 03:16 am Richard Henderson

tcg-arm: Use R12 for the tcg temporary

R12 is call clobbered, while R8 is call saved. This change
gives tcg one more call saved register for real data.

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

34358a12 04/27/2013 03:16 am Richard Henderson

tcg-arm: Cleanup multiply subroutines

Make the code more readable by only having one copy of the magic
numbers, swapping registers as needed prior to that. Speed the
compiler by not applying the rd == rn avoidance for v6 or later.

Reviewed-by: Aurelien Jarno <>...

9feac1d7 04/27/2013 03:16 am Richard Henderson

tcg-arm: Cleanup most primitive load store subroutines

Use even more primitive helper functions to avoid lots of duplicated code.

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

a9a86ae9 04/27/2013 03:16 am Richard Henderson

tcg-arm: Handle negated constant arguments to and/sub

This greatly improves code generation for addition of small
negative constants.

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

d9fda575 04/27/2013 03:16 am Richard Henderson

tcg-arm: Allow constant first argument to sub

This allows the generation of RSB instructions.

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

5d53b4c9 04/27/2013 03:16 am Richard Henderson

tcg-arm: Use tcg_out_dat_rIN for compares

This allows us to emit CMN instructions.

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

2df3f1ee 04/27/2013 03:16 am Richard Henderson

tcg-arm: Handle constant arguments to add2/sub2

We get to re-use the _rIN and _rIK subroutines to handle the various
combinations of add vs sub. Fold the << 21 into the opcode enum values
so that we can explicitly add TO_CPSR as desired.

Reviewed-by: Aurelien Jarno <>...

e86e0f28 04/27/2013 03:16 am Richard Henderson

tcg-arm: Improve constant generation

Try fully rotated arguments to mov and mvn before trying movt
or full decomposition. Begin decomposition with mvn when it
looks like it'll help. Examples include

: mov r9, #0x00000fa0
: orr r9, r9, #0x000ee000...

19b62bf4 04/27/2013 03:16 am Richard Henderson

tcg-arm: Use bic to implement and with constant

This greatly improves the code we can produce for deposit
without armv7 support.

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

fc4d60ee 04/27/2013 02:19 am Richard Henderson

tcg-arm: Fix local stack frame

We were not allocating TCG_STATIC_CALL_ARGS_SIZE, so this meant that
any helper with more than 4 arguments would clobber the saved regs.
Realizing that we're supposed to have this memory pre-allocated means
we can clean up the tcg_out_arg functions, which were trying to do...

d693e147 02/23/2013 07:25 pm Richard Henderson

tcg-arm: Implement muls2_i32

We even had the encoding of smull already handy...

Cc: Andrzej Zaborowski <>
Signed-off-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

5256a720 01/19/2013 12:27 pm Peter Maydell

tcg/target-arm: Add missing parens to assertions

Silence a (legitimate) complaint about missing parentheses:

tcg/arm/tcg-target.c: In function ‘tcg_out_qemu_ld’:
tcg/arm/tcg-target.c:1148:5: error: suggest parentheses around
comparison in operand of ‘&’ [-Werror=parentheses]...

022c62cb 12/19/2012 09:31 am Paolo Bonzini

exec: move include files to include/exec/

Signed-off-by: Paolo Bonzini <>

d17bd1d8 11/24/2012 02:19 pm Aurelien Jarno

tcg/arm: fix TLB access in qemu-ld/st ops

The TCG arm backend considers likely that the offset to the TLB
entries does not exceed 12 bits for mem_index = 0. In practice this is
not true for at least the MIPS target.

The current patch fixes that by loading the bits 23-12 with a separate...

7aab08aa 11/24/2012 02:19 pm Aurelien Jarno

tcg/arm: fix cross-endian qemu_st16

The bswap16 TCG opcode assumes that the high bytes of the temp equal
to 0 before calling it. The ARM backend implementation takes this
assumption to slightly optimize the generated code.

The same implementation is called for implementing the cross-endian...

4a1d241e 10/17/2012 02:22 am Peter Maydell

tcg/arm: Implement movcond_i32

Implement movcond_i32 for ARM, as the sequence
mov dst, v2 (implicitly done by the tcg common code)
cmp c1, c2
movCC dst, v1

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

7fc645bf 10/17/2012 02:22 am Peter Maydell

tcg/arm: Factor out code to emit immediate or reg-reg op

The code to emit either an immediate cmp or a register cmp insn is
duplicated in several places; factor it out into its own function.

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

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....

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 <>...

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...

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....

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...

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...

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...

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 <>

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....

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 <>...

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 <>...

614f104d 06/26/2011 09:25 pm Blue Swirl

Delegate setup of TCG temporaries to targets

Delegate TCG temp_buf setup to targets, so that they can use a stack
frame later instead.

Signed-off-by: Blue Swirl <>

cea5f9a2 06/26/2011 09:25 pm Blue Swirl

cpu-exec.c: avoid AREG0 use

Make functions take a parameter for CPUState instead of relying
on global env. Pass CPUState pointer to TCG prologue, which moves
it to AREG0.

Thanks to Peter Maydell and Laurent Desnogues for the ARM prologue
change.

Revert the hacks to avoid AREG0 use on Sparc hosts....

24e838b7 03/24/2011 04:27 am Peter Maydell

tcg/arm: Support host code being compiled for Thumb

Although the TCG generated code is always in ARM mode, it is possible
that the host code was compiled by gcc in Thumb mode (this is often the
default for Linux distributions targeting ARM v7 only). Handle this...

56779034 01/12/2011 01:06 am Aurelien Jarno

tcg arm/mips/ia64: add a comment about retranslation and caches

Add a comment about cache coherency and retranslation, so that people
developping new targets based on existing ones are warned of the issue.

Acked-by: Edgar E. Iglesias <>...

0f11f25a 01/10/2011 08:30 am Aurelien Jarno

tcg/arm: improve constant loading

Improve constant loading in two ways:
- On all ARM versions, it's possible to load 0xffffff00 = 0x100 using
the mvn rd, #0. Fix the conditions.
On <= ARMv6 versions, where movw and movt are not available, load the
constants using mov and orr with rotations depending on the constant...

9a3abc21 01/08/2011 05:41 pm Aurelien Jarno

tcg/arm: fix qemu_st64 for big endian targets

Due to a typo, qemu_st64 doesn't properly byteswap the 32-bit low word of
a 64 bit word before saving it. This patch fixes that.

Acked-by: Andrzej Zaborowski <>
Signed-off-by: Aurelien Jarno <>

c69806ab 01/08/2011 05:39 pm Aurelien Jarno

tcg/arm: fix branch target change during code retranslation

QEMU uses code retranslation to restore the CPU state when an exception
happens. For it to work the retranslation must not modify the generated
code. This is what is currently implemented in ARM TCG....

e4d58b41 06/09/2010 12:18 pm Richard Henderson

tcg: Make some tcg-target.c routines static.

Both tcg_target_init and tcg_target_qemu_prologue
are unused outside of tcg.c.

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

3b6dac34 06/09/2010 12:18 pm Richard Henderson

tcg: Add TYPE parameter to tcg_out_mov.

Mirror tcg_out_movi in having a TYPE parameter. This allows x86_64
to perform the move at the proper width, which may elide a REX prefix.

Introduce a TCG_TYPE_REG enumerator to represent the "native width"
of the host register, and to distinguish the usage from "pointer data"...

e23886a9 04/25/2010 06:46 am Aurelien Jarno

tcg/arm: fix condition in zero/sign extension functions

Signed-off-by: Aurelien Jarno <>

7e0d9562 04/19/2010 08:03 am Aurelien Jarno

tcg/arm: remove conditional argument for qemu_ld/st

While it make sense to pass a conditional argument to tcg_out_*()
functions as the ARM architecture allows that, it doesn't make sense
for qemu_ld/st functions. These functions use comparison instructions...

e854b6d3 04/19/2010 08:03 am Aurelien Jarno

tcg/arm: use ext* ops in qemu_ld

Signed-off-by: Aurelien Jarno <>

67dcab73 04/19/2010 08:03 am Aurelien Jarno

tcg/arm: bswap arguments in qemu_ld/st if needed

On big endian targets, data arguments of qemu_ld/st ops have to be
byte swapped. Two temporary registers are needed for qemu_st to do
the bswap. r0 and r1 are used in system mode, do the same in user
mode, which implies reworking the constraints....

2633a2d0 04/19/2010 08:03 am Aurelien Jarno

tcg/arm: remove useless register tests in qemu_ld/st

addr_reg, data_reg and data_reg2 can't be register r0 or r1 du to the
constraints. Don't check if they equals these registers.

Signed-off-by: Aurelien Jarno <>

bf5675ef 04/19/2010 08:03 am Aurelien Jarno

tcg/arm: fix argument alignment in qemu_st64

64-bit arguments should be aligned on an even register as specified
by the "Procedure Call Standard for the ARM Architecture".

Signed-off-by: Aurelien Jarno <>

914ccf51 04/19/2010 08:03 am Aurelien Jarno

tcg/arm: optimize register allocation order

The beginning of the register allocation order list on the TCG arm
target matches the list of clobbered registers. This means that when an
helper is called, there is almost always clobbered registers that have
to be spilled....

c66b5c2c 04/19/2010 08:03 am Aurelien Jarno

tcg/arm: don't try to load constants using pc

There is statistically almost 0 chances to use this code, so
remove it.

Signed-off-by: Aurelien Jarno <>

8f7f749f 04/19/2010 08:03 am Aurelien Jarno

tcg/arm: sxtb and sxth are available starting with ARMv6

Signed-off-by: Aurelien Jarno <>

23401b58 04/19/2010 08:03 am Aurelien Jarno

tcg/arm: use the blx instruction when possible

Signed-off-by: Aurelien Jarno <>

293579e5 04/19/2010 08:03 am Aurelien Jarno

tcg/arm: add rotation ops

Signed-off-by: Aurelien Jarno <>

9517094f 04/19/2010 08:03 am Aurelien Jarno

tcg/arm: add ext16u op

Add an ext16u op, either using the uxth instruction on ARMv6+ or two
shifts on previous ARM versions. In both cases the result use the same
number or less instructions than the pure TCG version.

Also move all sign extension code to separate functions, so that they...

244b1e81 04/19/2010 08:03 am Aurelien Jarno

tcg/arm: add bswap ops

Add an bswap16 and bswap32 ops, either using the rev and rev16
instructions on ARMv6+ or shifts and logical operations on previous
ARM versions. In both cases the result use less instructions than
the pure TCG version.

These ops are also needed by the qemu_ld/st functions....

39221a82 04/19/2010 08:02 am Aurelien Jarno

tcg/arm: remove SAVE_LR code

There is no need to save the LR register (r14) before a call to a
subroutine. According to the "Procedure Call Standard for the ARM
Architecture", it is the job of the callee to save this register.
Moreover, this register is already saved in the prologue/epilogue....

e4a7d5e8 04/19/2010 08:02 am Aurelien Jarno

tcg/arm: explicitely list clobbered/reserved regs

Instead of writing very compact code, declare all registers that are
clobbered or reserved one by one. This makes the code easier to read.

Also declare all the 16 registers to TCG, and mark pc as reserved....

f694a27e 04/19/2010 08:02 am Aurelien Jarno

tcg/arm: remove store signed functions

Store signed functions doesn't make sense, and are not used. Remove
them.

Signed-off-by: Aurelien Jarno <>

c8d80cef 04/19/2010 08:02 am Aurelien Jarno

tcg/arm: replace integer values by registers enum

The TCG ARM backends uses integer values to refer to both immediate
values and register number. This makes the code difficult to read.

The patch below replaces all (if I haven't miss any ;-) integer values...

ac34fb5c 04/19/2010 08:02 am Aurelien Jarno

tcg/arm: add variables to define the allowed instructions set

Use a set of variables to define the allowed ARM instructions, depending
on the ARM_ARCH_* GCC defines.

Signed-off-by: Aurelien Jarno <>

1584c845 03/28/2010 05:39 pm Stefan Weil

tcg/arm: Replace qemu_ld32u (left over from previous commit)

Commit 86feb1c860dc38e9c89e787c5210e8191800385e
did not change all occurrences of INDEX_op_qemu_ld32u
for tcg/arm.

Please note that I could not test this patch
(I have currently no arm system available)....

86feb1c8 03/27/2010 12:01 am Richard Henderson

tcg: Disambiguate qemu_ld32u with 32-bit and 64-bit outputs.

Some targets (e.g. Alpha and MIPS64) need to keep 32-bit operands
sign-extended in 64-bit registers (regardless of the "real" sign
of the operand). For that, we need to be able to distinguish
between a 32-bit load with a 32-bit result and a 32-bit load with...

a9751609 03/26/2010 10:28 pm Richard Henderson

tcg: Name the opcode enumeration.

Give the enumeration formed from tcg-opc.h a name: TCGOpcode.
Use that enumeration type instead of "int" whereever appropriate.

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

9e97d8e9 03/20/2010 01:27 pm Aurelien Jarno

tcg/arm: don't save/restore r7 in prologue/epilogue

There is no need to save r7, it is used to store the address
of the env structure and is not modified by GCC.

Signed-off-by: Aurelien Jarno <>

26c5d372 03/20/2010 01:10 pm Aurelien Jarno

tcg/arm: fix load/store definitions for 32-bit targets

Signed-off-by: Aurelien Jarno <>

2b71cd72 03/14/2010 11:04 pm Aurelien Jarno

tcg/arm: use helpers for divu/remu

Signed-off-by: Aurelien Jarno <>