Statistics
| Branch: | Revision:

root / target-ppc / translate.c @ fab7fe42

History | View | Annotate | Download (412 kB)

# Date Author Comment
587c51f7 03/05/2014 04:06 am Tom Musta

target-ppc: Add ISA 2.06 stbcx. and sthcx. Instructions

This patch adds the byte and halfword variants of the Store Conditional
instructions. A common macro is introduced and the existing implementations
of stwcx. and stdcx. are refactored to use this macro....

fab7fe42 03/05/2014 04:06 am Tom Musta

target-ppc: Add ISA2.06 Float to Integer Instructions

This patch adds the four floating point to integer conversion instructions
introduced by Power ISA V2.06:

- Floating Convert to Integer Word Unsigned (fctiwu)
- Floating Convert to Integer Word Unsigned with Round Toward...
a98eb9e9 03/05/2014 04:06 am Tom Musta

target-ppc: Add ISA 2.06 divwe[o] Instructions

This patch addes the signed Divide Word Extended instructions
which were introduced in Power ISA 2.06B.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>
Signed-off-by: Alexander Graf <>

5c77a786 03/05/2014 04:06 am Tom Musta

target-ppc: Add ISA2.06 lbarx, lharx Instructions

This patch adds the byte and halfword variants of the Load and
Reserve instructions. Since there is much commonality among
all forms of Load and Reserve, a macro is provided and the existing
implementations of lwarx and ldarx are refactoried to use this...

98d1eb27 03/05/2014 04:06 am Tom Musta

target-ppc: Add ISA2.06 divdeu[o] Instructions

This patch adds the Divide Doubleword Extended Unsigned
instructions. This instruction requires dividing a 128-bit
value by a 64 bit value. Since 128 bit integer division is
not supported in TCG, a helper is used. An architecture...

e44259b6 03/05/2014 04:06 am Tom Musta

target-ppc: Add ISA2.06 divde[o] Instructions

This patch adds the Divide Doubleword Extended instructions.
The implementation builds on the unsigned helper provided in
the previous patch.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>...

6a4fda33 03/05/2014 04:06 am Tom Musta

target-ppc: Add ISA 2.06 divweu[o] Instructions

This patch addes the Unsigned Divide Word Extended instructions
which were introduced in Power ISA 2.06B.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>
Signed-off-by: Alexander Graf <>

7ee19fb9 03/05/2014 04:06 am Tom Musta

target-ppc: Scalar Non-Signalling Conversions

This patch adds the non-signalling scalar conversion instructions:

- VSX Scalar Convert Single Precision to Double Precision
Non-Signalling (xscvspdpn)
- VSX Scalar Convert Double Precision to Single Precision...
86ba37ed 03/05/2014 04:06 am Tom Musta

target-ppc: Add ISA2.06 bpermd Instruction

This patch adds the Bit Permute Doubleword (bpermd) instruction,
which was introduced in Power ISA 2.06 as part of the base 64-bit
architecture.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>...

f5c0f7f9 03/05/2014 04:06 am Tom Musta

target-ppc: Move To/From VSR Instructions

This patch adds the Move To VSR instructions (mfvsrd, mfvsrwz)
and Move From VSR instructions (mtvsrd, mtvsrwa, mtvsrwz). These
instructions are unusual in that they are considered a floating
point instruction if the indexed VSR is in the first half of the...

097ec5d8 03/05/2014 04:06 am Tom Musta

target-ppc: Floating Merge Word Instructions

This patch adds the Floating Merge Even Word (fmrgew) and Floating
Merge Odd Word (fmrgow) instructions.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>
Signed-off-by: Alexander Graf <>

3d1140bf 03/05/2014 04:06 am Tom Musta

target-ppc: Scalar Round to Single Precision

This patch adds the VSX Scalar Round to Single Precision (xsrsp)
instruction.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>
Signed-off-by: Alexander Graf <>

968e76bc 03/05/2014 04:06 am Tom Musta

target-ppc: VSX Stage 4: add xsrsqrtesp

This patch adds the VSX Scalar Reciprocal Square Root Estimate
Single Precision (xsrsqrtesp) instruction.

The existing VSX_RSQRTE() macro is modified to support rounding
of the intermediate double-precision result to single precision....

f53f81e0 03/05/2014 04:06 am Tom Musta

target-ppc: VSX Stage 4: Add Scalar SP Fused Multiply-Adds

This patch adds the Single Precision VSX Scalar Fused Multiply-Add
instructions: xsmaddasp, xsmaddmsp, xssubasp, xssubmsp, xsnmaddasp,
xsnmaddmsp, xsnmsubasp, xsnmsubmsp.

The existing VSX_MADD() macro is modified to support rounding of the...

74698350 03/05/2014 04:06 am Tom Musta

target-ppc: VSX Stage 4: Add xscvsxdsp and xscvuxdsp

This patch adds the VSX Scalar Convert Unsigned Integer Doubleword
to Floating Point Format and Round to Single Precision (xscvuxdsp)
and VSX Scalar Convert Signed Integer Douglbeword to Floating Point...

67a33f37 03/05/2014 04:06 am Tom Musta

target-ppc: VSX Stage 4: Add xxleqv, xxlnand and xxlorc

This patchs adds the VSX Logical instructions that are new with
ISA V2.07:

- VSX Logical Equivalence (xxleqv)
- VSX Logical NAND (xxlnand)
- VSX Logical ORC (xxlorc)

Signed-off-by: Tom Musta <>...

b24d0b47 03/05/2014 04:06 am Tom Musta

target-ppc: VSX Stage 4: Add xsdivsp

This patch adds the VSX Scalar Divide Single Precision (xsdivsp)
instruction.

The existing VSX_DIV macro is modified to support rounding of the
intermediate double precision result to single precision.

Signed-off-by: Tom Musta <>...

2c0c52ae 03/05/2014 04:06 am Tom Musta

target-ppc: VSX Stage 4: Add xsresp

This patch adds the VSX Scalar Reciprocal Estimate Single Precision
(xsresp) instruction.

The existing VSX_RE macro is modified to support rounding of the
intermediate double precision result to single precision.

Signed-off-by: Tom Musta <>...

cea4e574 03/05/2014 04:06 am Tom Musta

target-ppc: VSX Stage 4: Add xssqrtsp

This patch adds the VSX Scalar Square Root Single Precision (xssqrtsp)
instruction.

The existing VSX_SQRT() macro is modified to support rounding of the
intermediate double-precision result to single-precision.

Signed-off-by: Tom Musta <>...

e16a626b 03/05/2014 04:06 am Tom Musta

target-ppc: VSX Stage 4: Add stxsiwx and stxsspx

This patch adds two store scalar instructions:

- Store VSX Scalar as Integer Word Indexed (stxsiwx)
- Store VSX Scalar Single-Precision Indexed (stxsspx)

Signed-off-by: Tom Musta <>...

3fd0aadf 03/05/2014 04:06 am Tom Musta

target-ppc: VSX Stage 4: Add xsaddsp and xssubsp

This patch adds the VSX Scalar Add Single-Precision (xsaddsp) and
VSX Scalar Subtract Single-Precision (xssubsp) instructions.

The existing VSX_ADD_SUB macro is modified to support the rounding
of the (intermediate) result to single-precision....

ab9408a2 03/05/2014 04:06 am Tom Musta

target-ppc: VSX Stage 4: Add xsmulsp

This patch adds the VSX Scalar Multiply Single-Precision (xsmulsp)
instruction.

The existing VSX_MUL macro is modified to support rounding of the
intermediate result to single precision.

Signed-off-by: Tom Musta <>...

e072fe79 03/05/2014 04:06 am Tom Musta

target-ppc: VSX Stage 4: Refactor lxsdx

This patch refactors the lxsdx generator. Resuable code is isolated
into a macro. The macro will be used in subsequent patches in this
series to implement other scalar load instructions.

Signed-off-by: Tom Musta <>...

cac7f0ba 03/05/2014 04:06 am Tom Musta

target-ppc: VSX Stage 4: Add lxsiwax, lxsiwzx and lxsspx

This patch adds the scalar load instructions introduced in ISA
V2.07:

- Load VSX Scalar as Integer Word Algebraic Indexd (lxsiwax)
- Load VSX Scalar as Integer Word and Zero Indexed (lxsiwzx)
- Load VSX Scalar Single-Precision Indexed (lxsspx)...
f026da78 03/05/2014 04:06 am Tom Musta

target-ppc: VSX Stage 4: Refactor stxsdx

This patch refactors the stxsdx instruction. Reusable code is
extracted into a macro which will be used in subsequent patches
in this series.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>...

5177d2ca 03/05/2014 04:06 am Tom Musta

target-ppc: Add VSX ISA2.06 Integer Conversion Instructions

This patch adds the VSX Integer Conversion instructions defined by
V2.06 of the PowerPC ISA:

- xscvdpsxds, xscvdpsxws, xscvdpuxds, xscvdpuxws
- xvcvdpsxds, xvcvdpsxws, xvcvdpuxds, xvcvdpuxws...
88e33d08 03/05/2014 04:06 am Tom Musta

target-ppc: Add VSX Rounding Instructions

This patch adds the VSX Round to Floating Point Integer instructions:

- xsrdpi, xsrdpic, xsrdpim, xsrdpip, xsrdpiz
- xvrdpi, xvrdpic, xvrdpim, xvrdpip, xvrdpiz
- xvrspi, xvrspic, xvrspim, xvrspip, xvrspiz
...
959e9c9d 03/05/2014 04:06 am Tom Musta

target-ppc: Add VSX xmax/xmin Instructions

This patch adds the VSX floating point maximum and minimum
instructions:

- xsmaxdp, xvmaxdp, xvmaxsp
- xsmindp, xvmindp, xvminsp

Because of the Power ISA definitions of maximum and minimum
on various boundary cases, the standard softfloat comparison...

354a6dec 03/05/2014 04:06 am Tom Musta

target-ppc: Add VSX Vector Compare Instructions

This patch adds the VSX floating point compare vector instructions:

- xvcmpeqdp[.], xvcmpgedp[.], xvcmpgtdp[.]
- xvcmpeqsp[.], xvcmpgesp[.], xvcmpgtsp[.]

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>...

ed8ac568 03/05/2014 04:06 am Tom Musta

target-ppc: Add VSX Floating Point to Floating Point Conversion Instructions

This patch adds the VSX instructions that convert between floating
point formats: xscvdpsp, xscvspdp, xvcvdpsp, xvcvspdp.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>...

5cb151ac 03/05/2014 04:06 am Tom Musta

target-ppc: Add VSX ISA2.06 xtsqrt Instructions

This patch adds the VSX floating point test for software square
root instructions defined by V2.06 of the PowerPC ISA: xstsqrtdp,
xvtsqrtdp, xvtsqrtsp.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>...

595c6eef 03/05/2014 04:06 am Tom Musta

target-ppc: Add VSX ISA2.06 Multiply Add Instructions

This patch adds the VSX floating point multiply/add instructions
defined by V2.06 of the PowerPC ISA:

- xsmaddadp,  xvmaddadp,  xvmaddasp
- xsmaddmdp, xvmaddmdp, xvmaddmsp
- xsmsubadp, xvmsubadp, xvmsubasp...
4f17e9c7 03/05/2014 04:06 am Tom Musta

target-ppc: Add VSX xscmp*dp Instructions

This patch adds the VSX scalar floating point compare ordered
and unordered instructions.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>
Signed-off-by: Alexander Graf <>

2009227f 03/05/2014 04:06 am Tom Musta

target-ppc: Add VSX ISA2.06 xre Instructions

This patch adds the VSX floating point reciprocal estimate instructions
defined by V2.06 of the PowerPC ISA: xsredp, xvredp, xvresp.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>...

d32404fe 03/05/2014 04:06 am Tom Musta

target-ppc: Add VSX ISA2.06 xsqrt Instructions

This patch adds the VSX floating point square root instructions
defined by V2.06 of the PowerPC ISA: xssqrtdp, xvsqrtdp, xvsqrtsp.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>...

d3f9df8f 03/05/2014 04:06 am Tom Musta

target-ppc: Add VSX ISA2.06 xrsqrte Instructions

This patch adds the VSX floating point reciprocal square root
estimate instructions defined by V2.06 of the PowerPC ISA: xsrsqrtedp,
xvrsqrtedp, xvrsqrtesp.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>...

bc80838f 03/05/2014 04:06 am Tom Musta

target-ppc: Add VSX ISA2.06 xtdiv Instructions

This patch adds the VSX floating point test for software divide
instructions defined by V2.06 of the PowerPC ISA: xstdivdp, xvtdivdp,
and xvtdivsp.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>...

ee6e02c0 03/05/2014 04:06 am Tom Musta

target-ppc: Add VSX ISA2.06 xadd/xsub Instructions

This patch adds the floating point addition and subtraction
instructions defined by V2.06 of the PowerPC ISA: xssubdp,
xvsubdp and xvsubsp.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>...

5e591d88 03/05/2014 04:06 am Tom Musta

target-ppc: Add VSX ISA2.06 xmul Instructions

This patch adds the VSX floating point multiply instructions defined
by V2.06 of the PowerPC ISA: xsmuldp, xvmuldp, xvmulsp.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>...

4b98eeef 03/05/2014 04:06 am Tom Musta

target-ppc: Add VSX ISA2.06 xdiv Instructions

This patch adds the VSX floating point divide instructions defined
by V2.06 of the PowerPC ISA: xsdivdp, xvdivdp, xvdivsp.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>...

3c3cbbdc 03/05/2014 04:06 am Tom Musta

target-ppc: General Support for VSX Helpers

This patch adds general support that will be used by the VSX helper
routines:

- a union describing the various VSR subfields.
- access routines to get and set VSRs
- VSX decoders
- a general routine to generate a handler that invokes a VSX...
ca480de6 03/05/2014 04:06 am Anton Blanchard

target-ppc: dump DAR and DSISR

The DAR and DSISR can be very useful when debugging issues, so add
them to ppc_cpu_dump_state. We had another bug in this area: all
of the v2.06 MMU types were missing.

Signed-off-by: Anton Blanchard <>
Signed-off-by: Alexander Graf <>

f976b09e 12/22/2013 08:15 pm Alexander Graf

PPC: Fix compilation with TCG debug

The recent VSX patches broken compilation of QEMU when configurated
with --enable-debug, as it was treating "target long" TCG variables
as "i64" which is not true for 32bit targets.

This patch fixes all the places that the compiler has found to use...

acc42968 12/20/2013 02:58 am Tom Musta

Add xxsldwi

This patch adds the VSX Shift Left Double by Word Immediate
(xxsldwi) instruction.

Signed-off-by: Tom Musta <>
Signed-off-by: Alexander Graf <>

76c15fe0 12/20/2013 02:58 am Tom Musta

Add xxspltw

This patch adds the VSX Splat Word (xxsplatw) instruction.

This is the first instruction to use the UIM immediate field
and consequently a decoder is also added.

V2: reworked implementation per Richard Henderson's comments.

Signed-off-by: Tom Musta <>...

551e3ef7 12/20/2013 02:58 am Tom Musta

Add xxsel

This patch adds the VSX Select (xxsel) instruction.

The xxsel instruction has four VSR operands. Thus the xC
instruction decoder is added.

The xxsel instruction is massively overloaded in the opcode
table since only bits 26 and 27 are opcode bits. This...

79ca8a6a 12/20/2013 02:58 am Tom Musta

Add Power7 VSX Logical Instructions

This patch adds the VSX logical instructions that are defined
by the Version 2.06 Power ISA (aka Power7):

- xxland
- xxlandc
- xxlor
- xxlxor
- xxlnor

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>...

ce577d2e 12/20/2013 02:58 am Tom Musta

Add xxmrgh/xxmrgl

This patch adds the VSX Merge High Word and VSX Merge Low Word
instructions.

V2: Now implemented using deposit (per Richard Henderson's comment)

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>...

be574920 12/20/2013 02:58 am Tom Musta

Add VSX Vector Move Instructions

This patch adds the vector move instructions:

- xvabsdp - Vector Absolute Value Double-Precision
- xvnabsdp - Vector Negative Absolute Value Double-Precision
- xvnegdp - Vector Negate Double-Precision
- xvcpsgndp - Vector Copy Sign Double-Precision...
df020ce0 12/20/2013 02:58 am Tom Musta

Add VSX Scalar Move Instructions

This patch adds the VSX scalar move instructions:

- xsabsdp (Scalar Absolute Value Double-Precision)
- xsnabspd (Scalar Negative Absolute Value Double-Precision)
- xsnegdp (Scalar Negate Double-Precision)
- xscpsgndp (Scalar Copy Sign Double-Precision)...
86e61ce3 12/20/2013 02:57 am Tom Musta

Add stxvw4x

This patch adds the Store VSX Vector Word*4 Indexed (stxvw4x)
instruction.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>
Reviewed-by: Paolo Bonzini <>
Signed-off-by: Alexander Graf <>

9231ba9e 12/20/2013 02:57 am Tom Musta

Add stxsdx

This patch adds the Store VSX Scalar Doubleword Indexed (stxsdx)
instruction.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>
Reviewed-by: Paolo Bonzini <>
Signed-off-by: Alexander Graf <>

897e61d1 12/20/2013 02:57 am Tom Musta

Add lxvw4x

This patch adds the Load VSX Vector Word*4 Indexed (lxvw4x)
instruction.

V2: changed to use deposit_i64 per Richard Henderson's review.

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

ca03b467 12/20/2013 02:57 am Tom Musta

Add lxvdsx

This patch adds the Load VSX Vector Doubleword & Splat Indexed
(lxvdsx) instruction.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>
Reviewed-by: Paolo Bonzini <>
Signed-off-by: Alexander Graf <>

fa1832d7 12/20/2013 02:57 am Tom Musta

Add lxsdx

This patch adds the Load VSX Scalar Doubleowrd Indexed (lxsdx)
instruction.

The lower 8 bytes of the target register are undefined; this
implementation leaves those bytes unaltered.

Signed-off-by: Tom Musta <>
Reviewed-by: Richard Henderson <>...

cd73f2c9 12/20/2013 02:57 am Tom Musta

Add xxpermdi

This patch adds the xxpermdi instruction. The instruction
uses bits 22, 23, 29 and 30 for non-opcode fields (DM, AX
and BX). This results in overloading of the opcode table
with aliases, which can be seen in the GEN_XX3FORM_DM
macro.

Signed-off-by: Tom Musta <>...

fbed2478 12/20/2013 02:57 am Tom Musta

Add stxvd2x

This patch adds the stxvd2x instruction.

Signed-off-by: Tom Musta <>
Signed-off-by: Anton Blanchard <>
Signed-off-by: Alexander Graf <>

304af367 12/20/2013 02:57 am Tom Musta

Add lxvd2x

This patch adds the lxvd2x instruction.

Signed-off-by: Tom Musta <>
Signed-off-by: Anton Blanchard <>
Signed-off-by: Alexander Graf <>

472b24ce 12/20/2013 02:57 am Tom Musta

Add VSR to Global Registers

This patch adds VSX VSRs to the the list of global register indices.
More specifically, it adds the lower halves of the first 32 VSRs to
the list of global register indices. The upper halves of the first
32 VSRs are already defined via cpu_fpr[]. And the second 32 VSRs...

f9fc6d81 12/20/2013 02:57 am Tom Musta

Add VSX Instruction Decoders

This patch adds decoders for the VSX fields XT, XS, XA, XB and
DM. The first four are split fields and a general helper for
these types of fields is also added.

Signed-off-by: Tom Musta <>
Signed-off-by: Anton Blanchard <>...

1f29871c 12/20/2013 02:57 am Tom Musta

Add MSR VSX and Associated Exception

This patch adds support for the VSX bit of the PowerPC Machine
State Register (MSR) as well as the corresponding VSX Unavailable
exception.

The VSX bit is added to the defined bits masks of the Power7 and
Power8 CPU models....

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

97577fd4 09/20/2013 01:37 pm James Hogan

cpu: Move cpu state syncs up into cpu_dump_state()

The x86 and ppc targets call cpu_synchronize_state() from their
*_cpu_dump_state() callbacks to ensure that up to date state is dumped
when KVM is enabled (for example when a KVM internal error occurs).
...

545825d4 09/03/2013 02:35 am Aurelien Jarno

Merge branch 'tcg-next' of git://github.com/rth7680/qemu

  • 'tcg-next' of git://github.com/rth7680/qemu: (29 commits)
    tcg-i386: Make use of zero-extended memory helper routines
    tcg: Introduce zero and sign-extended versions of load helpers
    exec: Split softmmu_defs.h...
8cfd0495 09/02/2013 07:08 pm Richard Henderson

tcg: Change tcg_gen_exit_tb argument to uintptr_t

And update all users.

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

779f6590 09/02/2013 11:06 am Aurelien Jarno

target-ppc: fix bit extraction for FPBF and FPL

Bit extraction for the FP BF and L field of the MTFSFI and MTFSF
instructions is wrong and doesn't match the reference manual (which
explain the bit number in big endian format). It has been broken in
commit 7d08d85645def18eac2a9d672c1868a35e0bcf79....

ed2803da 07/23/2013 03:41 am Andreas Färber

cpu: Move singlestep_enabled field from CPU_COMMON to CPUState

Prepares for changing cpu_single_step() argument to CPUState.

Acked-by: Michael Walle <> (for lm32)
Signed-off-by: Andreas Färber <>

213fe1f5 07/09/2013 10:33 pm Andreas Färber

target-ppc: Change gen_intermediate_code_internal() argument to PowerPCCPU

Also use bool type while at it.

Prepares for moving singlestep_enabled field to CPUState.

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

cb446eca 06/28/2013 02:25 pm Andreas Färber

kvm: Change cpu_synchronize_state() argument to CPUState

Change Monitor::mon_cpu to CPUState as well.

Reviewed-by: liguang <>
Acked-by: Paolo Bonzini <>
Signed-off-by: Andreas Färber <>

878096ee 06/28/2013 02:25 pm Andreas Färber

cpu: Turn cpu_dump_{state,statistics}() into CPUState hooks

Make cpustats monitor command available unconditionally.

Prepares for changing kvm_handle_internal_error() and kvm_cpu_exec()
arguments to CPUState.

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

36f48d9c 05/08/2013 09:23 pm Alexander Graf

PPC: Depend behavior of cmp instructions only on instruction encoding

When running an L=1 cmp instruction on a 64bit PPC CPU with SF off, it
still behaves identical to what it does when SF is on. Remove the implicit
difference in the code.

Also, on most 32bit CPUs we should always treat the compare as 32bit...

554ecc57 05/08/2013 09:23 pm Alexander Graf

PPC: Fix rldcl

The implementation for rldcl tried to always fetch its
parameters from the opcode, even though the opcode was
already passed in in decoded and different forms.

Use the parameters instead, fixing rldcl.

Reported-by: Torbjorn Granlund <>...

c05541ee 05/06/2013 06:22 pm Anton Blanchard

target-ppc: Fix invalid SPR read/write warnings

Invalid and privileged SPR warnings currently print the wrong
address. While fixing that, also make it clear that we are
printing both the decimal and hexadecimal SPR number.

Before:

Trying to read invalid spr 896 380 at 0000000000000714...
909eedb7 04/27/2013 01:37 am Aurelien Jarno

target-ppc: slightly optimize lfiwax

Signed-off-by: Aurelien Jarno <>

199f830d 04/27/2013 12:02 am Aurelien Jarno

target-ppc: emulate lfiwax instruction

Needed for Power ISA version 2.05 compliance.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>
[agraf: fix tcg debug error]
Signed-off-by: Alexander Graf <>

05050ee8 04/27/2013 12:02 am Aurelien Jarno

target-ppc: emulate load doubleword pair instructions

Needed for Power ISA version 2.05 compliance. The check for odd register
pairs is done using the invalid bits.

Signed-off-by: Aurelien Jarno <>
Signed-off-by: Alexander Graf <>

44bc0c4d 04/27/2013 12:02 am Aurelien Jarno

target-ppc: emulate store doubleword pair instructions

Needed for Power ISA version 2.05 compliance. The check for odd register
pairs is done using the invalid bits.

Signed-off-by: Aurelien Jarno <>
Signed-off-by: Alexander Graf <>

7d08d856 04/27/2013 12:02 am Aurelien Jarno

target-ppc: add support for extended mtfsf/mtfsfi forms

Power ISA 2.05 adds support for extended mtfsf/mtfsfi form, with a new
W field to select the upper part of the FPCSR register.

For that the helper is changed to handle 64-bit input values and mask with...

bf45a2e6 04/27/2013 12:02 am Aurelien Jarno

target-ppc: optimize fabs, fnabs, fneg

fabs, fnabs and fneg are just flipping the bit sign of an FP register,
this can be implemented in TCG instead of using softfloat.

Signed-off-by: Aurelien Jarno <>
Signed-off-by: Alexander Graf <>

fcfda20f 04/27/2013 12:02 am Aurelien Jarno

target-ppc: emulate cmpb instruction

Needed for Power ISA version 2.05 compliance.

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

725bcec2 04/27/2013 12:02 am Aurelien Jarno

target-ppc: emulate prtyw and prtyd instructions

Needed for Power ISA version 2.05 compliance.

Reviewed-by: Richard Henderson <>
Signed-off-by: Aurelien Jarno <>
[agraf: fix 32-bit host compile, simplify code]
Signed-off-by: Alexander Graf <>

f0332888 04/27/2013 12:02 am Aurelien Jarno

target-ppc: emulate fcpsgn instruction

Needed for Power ISA version 2.05 compliance.

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

8e7a6db9 04/27/2013 12:02 am Aurelien Jarno

target-ppc: fix nego and subf*o instructions

The overflow computation of nego and subf*o instructions has been broken
in commit ffe30937. Contrary to other targets, the instruction is subtract
from an not subtract on PowerPC.

This patch fixes the issue by using the correct argument in the xor...

752d634e 04/27/2013 12:02 am Richard Henderson

target-ppc: Fix narrow-mode add/sub carry output

Broken in b5a73f8d8a57e940f9bbeb399a9e47897522ee9a, the carry itself was
fixed in 79482e5ab38a05ca8869040b0d8b8f451f16ff62. But we still need to
produce the full 64-bit addition.

Simplify the conditions at the top of the functions for when we need a...

79482e5a 03/22/2013 04:28 pm Richard Henderson

target-ppc: Fix add and subf carry generation in narrow mode

The set of computations used in b5a73f8d8a57e940f9bbeb399a9e47897522ee9a
are only valid if the current word size == target_long size. This failed
to take ppc64 in 32-bit (narrow) mode into account....

e0c8f9ce 03/22/2013 04:28 pm Richard Henderson

target-ppc: Use NARROW_MODE macro for branches

Removing conditional compilation in the process.

Signed-off-by: Richard Henderson <>
Signed-off-by: Alexander Graf <>

02765534 03/22/2013 04:28 pm Richard Henderson

target-ppc: Use NARROW_MODE macro for comparisons

Removing conditional compilation in the process.

Signed-off-by: Richard Henderson <>
Signed-off-by: Alexander Graf <>

c791fe84 03/22/2013 04:28 pm Richard Henderson

target-ppc: Use NARROW_MODE macro for addresses

Removing conditional compilation in the process.

Signed-off-by: Richard Henderson <>
Signed-off-by: Alexander Graf <>

9ca3f7f3 03/22/2013 04:28 pm Richard Henderson

target-ppc: Use NARROW_MODE macro for tlbie

Removing conditional compilation in the process.

Signed-off-by: Richard Henderson <>
Signed-off-by: Alexander Graf <>

9baea4a3 03/22/2013 04:28 pm David Gibson

target-ppc: Remove vestigial PowerPC 620 support

The PowerPC 620 was the very first 64-bit PowerPC implementation, but
hardly anyone ever actually used the chips. qemu notionally supports the
620, but since we don't actually have code to implement the segment table,...

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

Pass PowerPCCPU to kvmppc_handle_halt().

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

806f352d 03/03/2013 04:29 pm Peter Maydell

gen-icount.h: Rename gen_icount_start/end to gen_tb_start/end

The gen_icount_start/end functions are now somewhat misnamed since they
are useful for generic "start/end of TB" code, used for more than just
icount. Rename them to gen_tb_start/end.

Signed-off-by: Peter Maydell <>...

08f4a0f7 02/25/2013 10:32 pm Richard Henderson

target-ppc: Fix SUBFE carry

While ~T0+T1+CF = T1-T0+CF-1 is true for the low 32-bits,
it does not produce the correct carry-out to bit 33. Do
exactly what the manual says.

Cc: Alexander Graf <>
Signed-off-by: Richard Henderson <>...

2fdcb629 02/23/2013 07:25 pm Richard Henderson

target-ppc: Use setcond in gen_op_cmp

Which means that callers need not copy data into local tmps.

Cc: Alexander Graf <>
Signed-off-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

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

target-ppc: Compute addition overflow without branches

Cc: Alexander Graf <>
Signed-off-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

146de60d 02/23/2013 07:25 pm Richard Henderson

target-ppc: Compute addition carry with setcond

Cc: Alexander Graf <>
Signed-off-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

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

target-ppc: Use add2 for carry generation

Cc: Alexander Graf <>
Signed-off-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

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

target-ppc: Implement neg in terms of subf

Cc: Alexander Graf <>
Signed-off-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

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

target-ppc: Compute arithmetic shift carry without branches

Cc: Alexander Graf <>
Signed-off-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>

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

target-ppc: Compute mullwo without branches

Cc: Alexander Graf <>
Signed-off-by: Richard Henderson <>
Signed-off-by: Blue Swirl <>