| Branch: | Revision:

root / target-sh4 / op_helper.c @ feature-archipelago

History | View | Annotate | Download (14.5 kB)

# Date Author Comment
259186a7 03/12/2013 11:35 am Andreas Färber

cpu: Move halted and interrupt_request fields to CPUState

Both fields are used in VMState, thus need to be moved together.
Explicitly zero them on reset since they were located before

Pass PowerPCCPU to kvmppc_handle_halt().

Signed-off-by: Andreas Färber <>

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

exec: move include files to include/exec/

Signed-off-by: Paolo Bonzini <>

a8a826a3 12/16/2012 10:35 am Blue Swirl

exec: refactor cpu_restore_state

Refactor common code around calls to cpu_restore_state().

tb_find_pc() has now no external users, make it static.

Signed-off-by: Blue Swirl <>

ad8d25a1 09/21/2012 08:53 pm Aurelien Jarno

target-sh4: implement addv and subv using TCG

addv and subv helpers implementation is directly copied from the SH4
manual and looks quite complex. It is however possible to explain it
without branches, and is therefore possible to implement it with TCG.

10127400 09/21/2012 08:53 pm Aurelien Jarno

target-sh4: rework exceptions handling

Since commit fd4bab102 PC is restored in case of exception through code
retranslation. While it is clearly the thing to do in case it is not
not known if an helper is going to trigger an exception or not
(e.g. for load/store, FPU, etc.), it just make things slower when the...

ff2086fe 09/21/2012 08:53 pm Aurelien Jarno

target-sh4: use float32_muladd() to implement fmac

There is no need to add a SH4 specific pickNaNMulAdd() to softfloat as
SH4 is always returning a default NaN.

Signed-off-by: Aurelien Jarno <>

22b88fd7 09/21/2012 08:53 pm Aurelien Jarno

target-sh4: implement addc and subc using TCG

Now that setcond is available, the addc and subc can easily be
implemented using TCG.

Signed-off-by: Aurelien Jarno <>

485d0035 09/15/2012 08:44 pm Blue Swirl

target-sh4: switch to AREG0 free mode

Add an explicit CPUState parameter instead of relying on AREG0
and switch to AREG0 free mode.

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

20503968 04/14/2012 05:23 pm Blue Swirl

Use uintptr_t for various op related functions

Use uintptr_t instead of void * or unsigned long in
several op related functions, env->mem_io_pc and
GETPC macro.

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

73e5716c 03/14/2012 11:20 pm Andreas Färber

target-sh4: Don't overuse CPUState

Scripted conversion:
sed -i "s/CPUState/CPUSH4State/g" target-sh4/*.[hc]
sed -i "s/#define CPUSH4State/#define CPUState/" target-sh4/cpu.h

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

bccd9ec5 10/01/2011 12:31 pm Blue Swirl

softmmu_header: pass CPUState to tlb_fill

Pass CPUState pointer to tlb_fill() instead of architecture local
cpu_single_env hacks.

Signed-off-by: Blue Swirl <>

97b348e7 08/07/2011 12:32 pm Blue Swirl

Remove unused is_softmmu parameter from cpu_handle_mmu_fault

Parameter is_softmmu (and its evil mutant twin brother is_softmuu)
is not used in cpu_*_handle_mmu_fault() functions, remove them
and adjust callers.

Acked-by: Richard Henderson <>...

3e457172 07/30/2011 12:41 pm Blue Swirl

exec.h cleanup

Move softmmu_exec.h include directives from target-*/exec.h to
target-*/op_helper.c. Move also various other stuff only used in
op_helper.c there.

Define global env in dyngen-exec.h.

For i386, move wrappers for segment and FPU helpers from user-exec.c...

1162c041 06/26/2011 09:25 pm Blue Swirl

cpu_loop_exit: avoid using AREG0

Make cpu_loop_exit() take a parameter for CPUState instead of relying
on global env.

Signed-off-by: Blue Swirl <>

618ba8e6 04/20/2011 11:37 am Stefan Weil

Remove unused function parameter from cpu_restore_state

The previous patch removed the need for parameter puc.
Is is now unused, so remove it.

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

d6c424c5 04/12/2011 10:51 pm Aurelien Jarno

target-sh4: get rid of CPU_{Float,Double}U

SH4 is always using softfloat, so it's possible to have helpers directly
taking float32 or float64 value. This allow to get rid of conversions
through CPU_{Float,Double}U.

Signed-off-by: Aurelien Jarno <>

efac4154 03/04/2011 12:33 am Aurelien Jarno

target-sh4: move intr_at_halt out of cpu_halted()

All targets except SH4 have the same cpu_halted() routine, and it has
only one caller. It is therefore a good candidate for inlining.

The difference is the handling of the intr_at_halt, which is necessary...

b2d9eda5 01/16/2011 02:19 pm Aurelien Jarno

target-sh4: implement negc using TCG

Using setcond it's now possible to generate a relatively short negc
instruction in TCG.

Signed-off-by: Aurelien Jarno <>

26ac1ea5 01/14/2011 09:39 pm Aurelien Jarno

target-sh4: define FPSCR constants

Define FPSCR constants for all field and use them instead of hardcoded

Signed-off-by: Aurelien Jarno <>

a0d4ac33 01/14/2011 09:39 pm Aurelien Jarno

target-sh4: implement flush-to-zero

When the FPSCR.DN bit is set, the SH4 FPU treat denormalized numbers as
zero. Enable the corresponding softfloat option when this bit is set.

Signed-off-by: Aurelien Jarno <>

21829e9b 01/14/2011 09:39 pm Aurelien Jarno

target-sh4: implement FPU exceptions

FPU exception support where not implemented on SH4. Implement them by
clearing the softfloat exceptions flags before an FP instruction (the
SH4 FPU also clear them before an instruction), and calling a function
to update the FPSCR register after an FP instruction. This function...

af8c2bde 01/14/2011 09:39 pm Aurelien Jarno

target-sh4: add fipr instruction

Add the fipr FVm,FVn instruction, which computes the inner products of
a 4-dimensional single precision floating-point vector.

Signed-off-by: Aurelien Jarno <>

17075f10 01/14/2011 09:39 pm Aurelien Jarno

target-sh4: add ftrv instruction

Add the ftrv XMTRX,FVn instruction, which computes the 4-row x 4-column
matrix XMTRX by the 4-dimensional vector FVn.

Signed-off-by: Aurelien Jarno <>

fd4bab10 01/14/2011 09:39 pm Aurelien Jarno

target-sh4: optimize exceptions

As exception is not the normal path, don't bother saving PC, before
raising one, instead rely on code retranslation to get the CPU state.

Signed-off-by: Aurelien Jarno <>

43dc2a64 03/18/2010 08:41 pm Blue Swirl

Replace assert(0) with abort() or cpu_abort()

When building with -DNDEBUG, assert(0) will not stop execution
so it must not be used for abnormal termination.

Use cpu_abort() when in CPU context, abort() otherwise.

Signed-off-by: Blue Swirl <>

b9d38e95 09/21/2009 09:11 pm Blue Swirl

Fix Sparse warnings about using plain integer as NULL pointer

Signed-off-by: Blue Swirl <>

8167ee88 07/16/2009 11:47 pm Blue Swirl

Update to a hopefully more future proof FSF address

Signed-off-by: Blue Swirl <>

852d481f 04/02/2009 02:10 am edgar_igl

SH: Improve movca.l/ocbi emulation.

Author: Vladimir Prus <>

Fix movcal.l/ocbi emulation.
  • target-sh4/cpu.h (memory_content): New.
    (CPUSH4State): New fields movcal_backup and movcal_backup_tail.
  • target-sh4/helper.h (helper_movcal)...
5b7141a1 01/14/2009 11:02 pm aurel32

sh4: Add FMAC instruction support

Signed-off-by: Laurent Desnogues <>
Signed-off-by: Lionel Landwerlin <>
Signed-off-by: Aurelien Jarno <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

fad6cb1a 01/05/2009 12:05 am aurel32

Update FSF address in GPL/LGPL boilerplate

The attached patch updates the FSF address in the GPL/LGPL boilerplate
in most GPL/LGPLed files, and also in COPYING.LIB.

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

d8299bcc 12/08/2008 12:46 am aurel32

SH4: Implement FD bit

SH4 manual say that if a floating point instruction is executed while
FD bit in the status register is 1, an exception should be raised. QEMU
presently does not do that, so the kernel does not initialize FP state
for any thread, nor does it save/restore FP state. The most apparent...

9850d1e8 11/19/2008 08:00 pm aurel32

target-sh4: use CPU_Float/CPU_Double instead of ugly casts

Signed-off-by: Aurelien Jarno <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

a7812ae4 11/17/2008 04:43 pm pbrook

TCG variable type checking.

Signed-off-by: Paul Brook <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

f24f381b 09/15/2008 09:42 am aurel32

SH4: sleep instruction bug fix

fix a bug on 'sleep' instruction, which have caused halt of idle task.
As i386 'hlt' instruction does, it should save PC before sleep.

(Shin-ichiro KAWASAKI)

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

7fdf924f 09/02/2008 01:12 am aurel32

SH4: final conversion to TCG

Signed-off-by: Aurelien Jarno <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

cc4ba6a9 09/02/2008 01:11 am aurel32

SH4: convert floating-point ops to TCG

Signed-off-by: Aurelien Jarno <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

69d6275b 09/01/2008 04:09 pm aurel32

SH4: Convert remaining non-fp ops to TCG

Signed-off-by: Aurelien Jarno <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

390af821 08/31/2008 01:07 am aurel32

SH4: convert control/status register load/store to TCG

Signed-off-by: Aurelien Jarno <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

6f06939b 08/30/2008 04:55 pm aurel32

SH4: convert some more arithmetics ops to TCG

Signed-off-by: Aurelien Jarno <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

e6afc2f4 08/30/2008 02:01 am aurel32

SH4: convert a few helpers to TCG

Signed-off-by: Aurelien Jarno <>

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

9b7b85d2 05/25/2008 03:36 am pbrook

Fix off-by-one unwinding error.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

ea2b542a 05/09/2008 09:45 pm aurel32

SH4 MMU improvements

(Shin-ichiro KAWASAKI)

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

273af660 10/29/2007 04:39 pm ths

Adjust s390 addresses (the MSB is defined as "to be ignored").

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

6ebbf390 10/14/2007 10:07 am j_mayer

Replace is_user variable with mmu_idx in softmmu core,
allowing support of more than 2 mmu access modes.
Add backward compatibility is_user variable in targets code when needed.
Implement per target cpu_mmu_index function, avoiding duplicated code
and #ifdef TARGET_xxx in softmmu core functions....

5fafdf24 09/17/2007 12:08 am ths

find -type f | xargs sed -i 's/[\t ]$//g' # on most files

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

bfed01fc 06/03/2007 08:44 pm ths

Clean up of some target specifics in exec.c/cpu-exec.c.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

397e923f 06/17/2006 11:04 pm pbrook

Remove debug output.

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162

fdf9b3e8 04/28/2006 12:07 am bellard

sh4 target (Samuel Tardieu)

git-svn-id: svn:// c046a42c-6fe2-441c-8c8c-71466251a162