Statistics
| Branch: | Revision:

root @ dc1c13d9

# Date Author Comment
dc1c13d9 09/24/2012 04:15 pm Jeff Cody

block: remove keep_read_only flag from BlockDriverState struct

The keep_read_only flag is no longer used, in favor of the bdrv
flag BDRV_O_ALLOW_RDWR.

Signed-off-by: Jeff Cody <>
Signed-off-by: Kevin Wolf <>

3d1807ac 09/24/2012 04:15 pm Jeff Cody

block: purge s->aligned_buf and s->aligned_buf_size from raw-posix.c

The aligned_buf pointer and aligned_buf size are no longer used in
raw_posix.c, so remove all references to them.

Signed-off-by: Jeff Cody <>
Signed-off-by: Kevin Wolf <>

eeb6b45d 09/24/2012 04:15 pm Jeff Cody

block: raw-posix image file reopen

This is derived from the Supriya Kannery's reopen patches.

This contains the raw-posix driver changes for the bdrv_reopen_*
functions. All changes are staged into a temporary scratch buffer
during the prepare() stage, and copied over to the live structure...

01bdddb5 09/24/2012 04:15 pm Jeff Cody

block: raw image file reopen

These are the stubs for the file reopen drivers for the raw format.

There is currently nothing that needs to be done by the raw driver
in reopen.

Signed-off-by: Jeff Cody <>
Signed-off-by: Kevin Wolf <>

f9cb20f1 09/24/2012 04:15 pm Jeff Cody

block: qed image file reopen

These are the stubs for the file reopen drivers for the qed format.

There is currently nothing that needs to be done by the qed driver
in reopen.

Signed-off-by: Jeff Cody <>
Signed-off-by: Kevin Wolf <>

21d82ac9 09/24/2012 04:15 pm Jeff Cody

block: qcow2 image file reopen

These are the stubs for the file reopen drivers for the qcow2 format.

There is currently nothing that needs to be done by the qcow2 driver
in reopen.

Signed-off-by: Jeff Cody <>
Signed-off-by: Kevin Wolf <>

d177692e 09/24/2012 04:15 pm Jeff Cody

block: qcow image file reopen

These are the stubs for the file reopen drivers for the qcow format.

There is currently nothing that needs to be done by the qcow driver
in reopen.

Signed-off-by: Jeff Cody <>
Signed-off-by: Kevin Wolf <>

3897575f 09/24/2012 04:15 pm Jeff Cody

block: vmdk image file reopen

This patch supports reopen for VMDK image files. VMDK extents are added
to the existing reopen queue, so that the transactional model of reopen
is maintained with multiple image files.

Signed-off-by: Jeff Cody <>...

ecfe2bba 09/24/2012 04:15 pm Jeff Cody

block: vdi image file reopen

There is currently nothing that needs to be done for VDI reopen.

Signed-off-by: Jeff Cody <>
Signed-off-by: Kevin Wolf <>

3fe4b700 09/24/2012 04:15 pm Jeff Cody

block: vpc image file reopen

There is currently nothing that needs to be done for VPC image
file reopen.

Signed-off-by: Jeff Cody <>
Signed-off-by: Kevin Wolf <>

0bce597d 09/24/2012 04:15 pm Jeff Cody

block: convert bdrv_commit() to use bdrv_reopen()

Currently, bdrv_commit() reopens images r/w itself, via risky
_delete() and _open() calls. Use the new safe method for drive reopen.

Signed-off-by: Jeff Cody <>
Signed-off-by: Kevin Wolf <>

80dd1aae 09/24/2012 04:15 pm Kevin Shanahan

blockdev: preserve readonly and snapshot states across media changes

If readonly=on is given at device creation time, the ->readonly flag
needs to be set in the block driver state for this device so that
readonly-ness is preserved across media changes (qmp change command)....

be028adc 09/24/2012 04:15 pm Jeff Cody

block: correctly set the keep_read_only flag

I believe the bs->keep_read_only flag is supposed to reflect
the initial open state of the device. If the device is initially
opened R/O, then commit operations, or reopen operations changing
to R/W, are prohibited....

55b110f2 09/24/2012 04:15 pm Jeff Cody

block: make bdrv_set_enable_write_cache() modify open_flags

bdrv_set_enable_write_cache() sets the bs->enable_write_cache flag,
but without the flag recorded in bs->open_flags, then next time
a reopen() is performed the enable_write_cache setting may be
inadvertently lost....

e971aa12 09/24/2012 04:15 pm Jeff Cody

block: Framework for reopening files safely

This is based on Supriya Kannery's bdrv_reopen() patch series.

This provides a transactional method to reopen multiple
images files safely.

Image files are queue for reopen via bdrv_reopen_queue(), and the
reopen occurs when bdrv_reopen_multiple() is called. Changes are...

fc32a72d 09/24/2012 04:15 pm Jeff Cody

block: move aio initialization into a helper function

Move AIO initialization for raw-posix block driver into a helper function.

In addition to just code motion, the aio_ctx pointer is checked for NULL,
prior to calling laio_init(), to make sure laio_init() is only run once....

6a8dc042 09/24/2012 04:15 pm Jeff Cody

block: move open flag parsing in raw block drivers to helper functions

Code motion, to move parsing of open flags into a helper function.

Signed-off-by: Jeff Cody <>
Signed-off-by: Kevin Wolf <>

39c9fb95 09/24/2012 04:15 pm Jeff Cody

block: do not parse BDRV_O_CACHE_WB in block drivers

Block drivers should ignore BDRV_O_CACHE_WB in .bdrv_open flags,
and in the bs->open_flags.

This patch removes the code, leaving the behaviour behind as if
BDRV_O_CACHE_WB was set.

Signed-off-by: Jeff Cody <>...

9acc5a06 09/24/2012 04:15 pm Jeff Cody

block: use BDRV_O_NOCACHE instead of s->aligned_buf in raw-posix.c

Rather than check for a non-NULL aligned_buf to determine if
raw_aio_submit needs to check for alignment, check for the presence
of BDRV_O_NOCACHE in the bs->open_flags.

Signed-off-by: Jeff Cody <>...

d3e8f957 09/23/2012 08:09 pm Stefan Weil

w32: Add implementation of gmtime_r, localtime_r

Those functions are missing in MinGW.

Some versions of MinGW-w64 include defines for gmtime_r and localtime_r.
Older versions of these macros are buggy (they return a pointer to a
static variable), therefore we don't want them. Newer versions are...

93b65997 09/23/2012 12:34 am Stefan Weil

audio: Fix warning from static code analysis

smatch report:
audio/audio_template.h:416 AUD_open_out(18) warn:
variable dereferenced before check 'as' (see line 414)

Moving the ldebug statement after the statement which checks 'as'
fixes that warning.

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

04cbbdee 09/22/2012 08:59 pm Blue Swirl

Merge branch 'tcg-sparc' of git://repo.or.cz/qemu/rth

  • 'tcg-sparc' of git://repo.or.cz/qemu/rth:
    tcg-sparc: Preserve branch destinations during retranslation
    tcg-sparc: Fix and enable direct TB chaining.
    tcg-sparc: Add %g/%o registers to alloc_order...
4e273869 09/22/2012 08:59 pm Max Filippov

target-xtensa: implement FP1 group

These are comparison and conditional move opcodes.
See ISA, 4.3.10 for more details.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

ef04a846 09/22/2012 08:59 pm Max Filippov

target-xtensa: implement coprocessor context option

In case Coprocessor Context option is enabled CPENABLE SR bits control
whether access to coprocessors is allowed or would rise one of
CoprocessorXDisabled exceptions.

See ISA, 4.4.5 for more details.

FP is coprocessor 0....

66176802 09/22/2012 08:59 pm Max Filippov

softfloat: make float_muladd_negate_* flags independent

Flags passed into float{32,64}_muladd are treated as bits; assign
independent bits to float_muladd_negate_* to allow precise control over
what gets negated in float{32,64}_muladd.

Signed-off-by: Max Filippov <>...

213ff4e6 09/22/2012 08:59 pm Max Filippov

softfloat: add NO_SIGNALING_NANS

Architectures that don't have signaling NaNs can define
NO_SIGNALING_NANS, it will make float*_is_quiet_nan return 1 for any NaN
and float*_is_signaling_nan always return 0.

Signed-off-by: Max Filippov <>...

10f6ca03 09/22/2012 08:59 pm Max Filippov

target-xtensa: handle boolean option in overlays

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

b81fe822 09/22/2012 08:59 pm Max Filippov

target-xtensa: specialize softfloat NaN rules

NaN propagation rule: leftmost NaN in the expression gets propagated to
the result.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

dd519cbe 09/22/2012 08:59 pm Max Filippov

target-xtensa: add FP registers

There are 16 32-bit FP registers (f0 - f15), control and status user
registers (fcr, fsr).

See ISA, 4.3.10 for more details.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

9ed7ae12 09/22/2012 08:59 pm Max Filippov

target-xtensa: implement LSCX and LSCI groups

These are load/store instructions for FP registers with immediate or
register index and optional base post-update.
See ISA, 4.3.10 for more details.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

0b6df838 09/22/2012 08:59 pm Max Filippov

target-xtensa: implement FP0 arithmetic

These are FP arithmetic opcodes.
See ISA, 4.3.10 for more details.

Signed-off-by: Max Filippov <>
Signed-off-by: Blue Swirl <>

b7ee8c6a 09/22/2012 08:59 pm Max Filippov

target-xtensa: implement FP0 conversions

These are FP to integer and integer to FP conversion opcodes.
See ISA, 4.3.10 for more details.

Note that ISA description for utrunc.s is currently incorrect and will
be fixed in future revisions.

Signed-off-by: Max Filippov <>...

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

23f3ff26 09/22/2012 06:16 pm malc

tcg/ppc32: Implement movcond32

Thanks to Richard Henderson

Signed-off-by: malc <>

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

tcg/mips

b18212c6 09/22/2012 05:52 pm Stefan Weil

tcg/i386: Add shortcuts for registers used in L constraint

While 64 bit hosts use the first three registers which are also used
as function input parameters, 32 bit hosts use TCG_REG_EAX and
TCG_REG_EDX which are not used in parameter passing.

After defining new register macros for the registers used in L...

d73685e3 09/22/2012 05:52 pm Stefan Weil

tcg/i386: Remove unused registers from tcg_target_call_iarg_regs

32 bit x86 hosts don't need registers for helper function arguments
because they use the default stack based calling convention.

Removing the registers allows simpler code for function
tcg_target_get_call_iarg_regs_count....

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

f0da3757 09/22/2012 04:10 pm Richard Henderson

tcg-hppa: Implement movcond

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

9bacf414 09/22/2012 04:10 pm Max Filippov

tcg/README: document tcg_gen_goto_tb restrictions

See
http://lists.nongnu.org/archive/html/qemu-devel/2012-09/msg03196.html
for the whole story.

Signed-off-by: Max Filippov <>
Signed-off-by: Aurelien Jarno <>

1b7621ad 09/22/2012 04:10 pm Stefan Weil

w64: Fix TCG helper functions with 5 arguments

TCG uses 6 registers for function arguments on 64 bit Linux hosts,
but only 4 registers on W64 hosts.

Commit 2999a0b20074a7e4a58f56572bb1436749368f59 increased the number
of arguments for some important helper functions from 4 to 5...

e590d4e6 09/22/2012 04:10 pm Aurelien Jarno

tcg/optimize: rework copy progagation

The copy propagation pass tries to keep track what is a copy of what
and what has copy of what, and in addition it keep a circular list of
of all the copies. Unfortunately this doesn't fully work: a mov from
a temp which has a state "COPY" changed it into a state "HAS_COPY"....

1ff8c541 09/22/2012 04:10 pm Aurelien Jarno

tcg/optimize: do copy propagation for all operations

It is possible to due copy propagation for all operations, even the one
that have side effects or clobber arguments (it only concerns input
arguments). That said, the call operation should be handled differently...

0aba1c73 09/22/2012 04:10 pm Aurelien Jarno

tcg/optimize: optimize "op r, a, a => mov r, a"

Now that we can easily detect all copies, we can optimize the
"op r, a, a => mov r, a" case a bit more.

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

3c94193e 09/22/2012 04:10 pm Aurelien Jarno

tcg/optimize: optimize "op r, a, a => movi r, 0"

Now that it's possible to detect copies, we can optimize the case
the "op r, a, a => movi r, 0". This helps in the computation of
overflow flags when one of the two args is 0.

Reviewed-by: Richard Henderson <>...

b336ceb6 09/22/2012 04:10 pm Aurelien Jarno

tcg/optimize: further optimize brcond/movcond/setcond

When both argument of brcond/movcond/setcond are the same or when one
of the two values is a constant equal to zero, it's possible to do
further optimizations.

Reviewed-by: Richard Henderson <>...

c2b0e2fe 09/22/2012 04:10 pm Aurelien Jarno

tcg/optimize: prefer the "op a, a, b" form for commutative ops

The "op a, a, b" form is better handled on non-RISC host than the "op
a, b, a" form, so swap the arguments to this form when possible, and
when b is not a constant.

This reduces the number of generated instructions by a tiny bit....

fba3161f 09/22/2012 04:10 pm Aurelien Jarno

tcg: remove #ifdef #endif around TCGOpcode tests

Commit 25c4d9cc changed all TCGOpcode enums to be available, so we don't
need to #ifdef #endif the one that are available only on some targets.
This makes the code easier to read.

Reviewed-by: Richard Henderson <>...

7ef55fc9 09/22/2012 04:10 pm Aurelien Jarno

tcg/optimize: add constant folding for deposit

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

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

48b56ce1 09/22/2012 04:10 pm Aurelien Jarno

tcg/optimize: remove TCG_TEMP_ANY

TCG_TEMP_ANY has no different meaning than TCG_TEMP_UNDEF, so use
the later instead.

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

b80bb016 09/22/2012 04:10 pm Aurelien Jarno

tcg/optimize: check types in copy propagation

The copy propagation doesn't check the types of the temps during copy
propagation. However TCG is using the mov_i32 for the i64 to i32
conversion and thus the two are not equivalent.

With this patch tcg_opt_gen_mov() doesn't consider two temps of...

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

f4bf0b91 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Preserve branch destinations during retranslation

Signed-off-by: Richard Henderson <>

26adfb75 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Add %g/%o registers to alloc_order

Signed-off-by: Richard Henderson <>

5bbd2cae 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Fix and enable direct TB chaining.

Signed-off-by: Richard Henderson <>

4c3204cb 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Clean up cruft stemming from attempts to use global registers.

Don't use -ffixed-gN. Don't link statically. Don't save/restore
AREG0 around calls. Don't allocate space on the stack for AREG0 save.

Signed-off-by: Richard Henderson <>

1fd95946 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Mask shift immediates to avoid illegal insns.

The xtensa-test image generates a sra_i32 with count 0x40.
Whether this is accident of tcg constant propagation or
originating directly from the instruction stream is immaterial.

Signed-off-by: Richard Henderson <>

375816f8 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Use defines for temporaries.

And change from %i4/%i5 to %g1/%o7 to remove a v8plus fixme.

Signed-off-by: Richard Henderson <>

c6f7e4fb 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Support GUEST_BASE.

Signed-off-by: Richard Henderson <>

0c554161 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Change AREG0 in generated code to %i0.

We can now move the TCG variable from %g56 to a call-preserved
windowed register.

Signed-off-by: Richard Henderson <>

a0ce341a 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Fix qemu_ld/st to handle 32-bit host.

At the same time, split out the tlb load logic to a new function.
Fixes the cases of two data registers and two address registers.
Fixes the signature of, and adds missing, qemu_ld/st opcodes.

Signed-off-by: Richard Henderson <>

d5dd696f 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Don't MAP_FIXED on top of the program

The address we pick in sparc64.ld is also 0x60000000, so doing a fixed map
on top of that is guaranteed to blow up. Choosing 0x40000000 is exactly
right for the max of code_gen_buffer_size set below.

No need to ever use MAP_FIXED. While getting our desired address helps...

9b9c37c3 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Assume v9 cpu always, i.e. force v8plus in 32-bit mode.

Current code doesn't actually work in 32-bit mode at all. Since
no one really noticed, drop the complication of v7 and v8 cpus.
Eliminate the --sparc_cpu configure option and standardize macro...

62724cc5 09/21/2012 11:02 pm Richard Henderson

linux-user: Use memcpy in get_user/put_user.

When host and target have differing alignment rules, using a cast
and direct memory operation can result in SIGBUS. Use memcpy instead,
which the compiler will happily optimize when alignment is satisfied.

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

3ee60ad4 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Hack in qemu_ld/st64 for 32-bit.

Not actually implemented, but at least we avoid the tcg assert at startup.

Signed-off-by: Richard Henderson <>

a221ae3f 09/21/2012 11:02 pm Richard Henderson

tcg-sparc: Fix ADDX opcode.

Signed-off-by: Richard Henderson <>

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

Merge branch 'usb.65' of git://git.kraxel.org/qemu

  • 'usb.65' of git://git.kraxel.org/qemu:
    uhci: Don't queue up packets after one with the SPD flag set
    usb-redir: Revert usb-redir part of commit 93bfef4c
    usb-redir: Add chardev open / close debug logging...
e55f523d 09/21/2012 08:53 pm Richard Henderson

tcg-hppa: Fix broken load/store helpers

The CONFIG_TCG_PASS_AREG0 code for calling ld/st helpers
was not respecting the ABI requirement for 64-bit values
being aligned in registers.

Mirror the ARM port in use of helper functions to marshal
arguments into the correct registers....

57e289de 09/21/2012 08:53 pm Richard Henderson

target-alpha: Use movcond

For proper cmov insns, as well as the non-goto-tb case
of conditional branch.

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

d0a16297 09/21/2012 08:53 pm Richard Henderson

tcg-i386: Implement movcond

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

fa01a208 09/21/2012 08:53 pm Richard Henderson

tcg: Optimize movcond for constant comparisons

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

5d8f5363 09/21/2012 08:53 pm Richard Henderson

tcg: Optimize two-address commutative operations

While swapping constants to the second operand, swap
sources matching destinations to the first operand.

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

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

gdbstub/sh4: fix build with USE_SOFTFLOAT_STRUCT_TYPES

We have to use different type to access float values when
USE_SOFTFLOAT_STRUCT_TYPES is defined.

Rework SH4 version of cpu_gdb_{read,write}_register() using
a single case, and fixing the coding style. Use ldll_p() and...

fe7e1d3e 09/21/2012 08:53 pm Richard Henderson

tcg: Fix !USE_DIRECT_JUMP

Commit 6375e09e changed the type of TranslationBlock.tb_next,
but failed to change the type of TCGContext.tb_next.

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

c08d9ee3 09/21/2012 08:53 pm Richard Henderson

tcg-hppa: Fix brcond2 and setcond2

Neither of these functions were performing double-word
compares properly.

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

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

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

target-sh4: optimize xtrct

The register being 32 bit long, after a shift to the right by 16 bits,
the upper 16 bit are already cleared. There is no need to call ext16u
to clear them.

Signed-off-by: Aurelien Jarno <>

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

target-sh4: optimize swap.w

It's possible swap the two 16-bit words of a 32-bit register using a
rotation. If the TCG target doesn't implement rotation, the replacement
code is similar to the previously implemented code.

Signed-off-by: Aurelien Jarno <>

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

target-sh4: remove gen_clr_t() and gen_set_t()

gen_clr_t() and gen_set_t() have very few callers and can be remplaced
by a single line. Remove them.

Signed-off-by: Aurelien Jarno <>

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

7a64244f 09/21/2012 08:53 pm Aurelien Jarno

target-sh4: cleanup DisasContext

We should avoid accessing env at translation stage, except of course for
static values like the supported features.

Remove variables copied from env in DisasContext and use the TB flags
instead.

Signed-off-by: Aurelien Jarno <>

080df491 09/21/2012 08:53 pm Aurelien Jarno

target-sh4: remove useless code

Almost dead code.

Signed-off-by: Aurelien Jarno <>

ffc5ea09 09/21/2012 08:53 pm Richard Henderson

tcg: Introduce movcond

Implemented with setcond if the target does not provide
the optional opcode.

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

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

target-sh4: mark a few helpers const and pure

Signed-off-by: Aurelien Jarno <>

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

f9cb5045 09/21/2012 02:07 am Max Filippov

target-xtensa: fix extui shift amount

extui opcode only uses lowermost op1 bit for sa4.

Reported-by: malc <>
Signed-off-by: Max Filippov <>
Cc: qemu-stable <>
Signed-off-by: malc <>

c26032b2 09/21/2012 02:07 am Max Filippov

target-xtensa: don't emit extra tcg_gen_goto_tb

Unconditional gen_check_loop_end at the end of disas_xtensa_insn
can emit tcg_gen_goto_tb with slot id already used in the TB (e.g. when
TB ends at LEND with a branch).

Signed-off-by: Max Filippov <>...

a2550660 09/19/2012 10:53 pm Aurelien Jarno

tcg/optimize: fix end of basic block detection

Commit e31b0a7c050711884ad570fe73df806520953618 fixed copy propagation on
32-bit host by restricting the copy between different types. This was the
wrong fix.

The real problem is that the all temps states should be reset at the end...

bd277fa1 09/19/2012 10:40 pm Richard Henderson

target-mips: Implement Loongson Multimedia Instructions

Implements all of the COP2 instructions except for the S<cond>
family of comparisons. The documentation is unclear for those.

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

fb7729e2 09/19/2012 10:40 pm Richard Henderson

target-mips: Always evaluate debugging macro arguments

this will prevent some of the compilation errors with debugging
enabled from creeping back in.

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