Statistics
| Branch: | Revision:

root / tcg / mips / tcg-target.c @ a8aec295

History | View | Annotate | Download (54 kB)

# Date Author Comment
174d4d21 04/01/2013 07:49 pm Aurelien Jarno

tcg/mips: Implement muls2_i32

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

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

exec: move include files to include/exec/

Signed-off-by: Paolo Bonzini <>

3585317f 10/30/2012 01:34 am Aurelien Jarno

tcg/mips: use MUL instead of MULT on MIPS32 and above

MIPS32 and later instruction sets have a multiplication instruction
directly operating on GPRs. It only produces a 32-bit result but
it is exactly what is needed by QEMU.

Reviewed-by: Richard Henderson <>...

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

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

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

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

tcg/mips

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

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

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

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

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

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

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

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

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

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

d43ffce1 01/08/2011 05:41 pm Aurelien Jarno

tcg/mips: fix branch target change during code retranslation

TCG on MIPS was trying to avoid changing the branch offset, but didn't
due to a stupid typo. Fix it.

Signed-off-by: Aurelien Jarno <>

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

60bf84cf 04/14/2010 01:59 am Stefan Weil

tcp/mips: Change TCG_AREG0 (fp -> s0)

Register fp (frame pointer) is a bad choice for compilations
without optimisation, because the compiler makes heavy use
of this register (so the resulting code crashes).

Register s0 had been used for TCG_AREG1 in earlier releases,...

ba0d89bb 04/05/2010 04:16 pm Aurelien Jarno

tcg/mips: fix 64-bit linux-user on big endian MIPS

Signed-off-by: Aurelien Jarno <>

116348de 04/05/2010 04:16 pm Aurelien Jarno

tcg/mips: use seb/seh instructions on MIPS32R2

Signed-off-by: Aurelien Jarno <>

355b1943 04/05/2010 02:28 am Paul Brook

Split TLB addend and target_phys_addr_t

Historically the qemu tlb "addend" field was used for both RAM and IO accesses,
so needed to be able to hold both host addresses (unsigned long) and guest
physical addresses (target_phys_addr_t). However since the introduction of...

6d8ff4d8 03/29/2010 03:09 am Aurelien Jarno

tcg/mips: fix branch offset during retranslation

Branch offsets should only be overwritten during relocation, to support
partial retranslation.

Signed-off-by: Aurelien Jarno <>

cc01cc8e 03/27/2010 06:31 pm Aurelien Jarno

tcg-mips: add guest base support

Signed-off-by: Aurelien Jarno <>

489722cf 03/27/2010 05:50 pm Aurelien Jarno

tcg/mips: implement the not_i32 op the same way as gcc

Signed-off-by: Aurelien Jarno <>

2b79487a 03/27/2010 05:32 pm Aurelien Jarno

tcg-mips: implement nor

Signed-off-by: Aurelien Jarno <>

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

8a56e840 03/26/2010 10:29 pm Richard Henderson

tcg: Use TCGCond where appropriate.

Use the TCGCond enumeration type in the brcond and setcond
related prototypes in tcg-op.h and each code generator.

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

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

cca1af8c 02/09/2010 11:54 pm Aurelien Jarno

tcg/mips: fix crash in tcg_out_qemu_ld()

The address register is overriden when it corresponds to v0 and the fast
path is taken, which leads to a crash. Fix that by using the a0 register
instead.

Signed-off-by: Aurelien Jarno <>

434254aa 02/09/2010 02:01 am Aurelien Jarno

tcg/mips: implement setcond2

Signed-off-by: Aurelien Jarno <>

4cb26382 02/08/2010 05:37 pm Aurelien Jarno

tcg/mips: implement setcond

Signed-off-by: Aurelien Jarno <>

afa05235 12/01/2009 02:06 am Aurelien Jarno

tcg: initial mips support

Based on a patch from Arnaud Patard (Rtp) <>

A few words about design choices:
  • Two registers, at and t0, are reserved for TCG internal use. They are
    useful for bswap and 64-bit ops.
  • Most ops supports a constant argument with value 0, which is actually...