prep: Include devices for ppc64 as well

Allows running qemu-system-ppc64 -M prep for consistency.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Acked-by: Hervé Poussineau <hpoussineau@reactos.org>
prep: Add pc87312 Super I/O emulation

This provides floppy and IDE controllers as well as serial and parallel
ports. However, dynamic configuration of devices is not yet supported.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
[AF: QOM'ify, split out header, create CharDriverState if absent]
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
prep: Use pc87312 device instead of collection of random ISA devices

We can't however replace the built-in IDE controller, as the one in
pc87312 is only single-channel and can use only IRQ 14. Therefore the
pc87312's IDE function gets disabled via the config property.

PReP emulation also gains a parallel port emulation this way.

Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
[AF: Use TYPE_PC87312 constant, add to ppc64-softmmu and to MAINTAINERS]
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
target-s390: Disassemble more z10 and z196 opcodes

Also fix disassembly for COMPARE AND BRANCH.  The table must be
sorted by primary opcode, and several were out of place.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-s390: Fix disassembly of cpsdr

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-s390: Fix gdbstub

The real gdb protocol doesn't split out pc or cc as real registers.
Those are pseudos that are extracted as needed from the PSW.  Don't
modify env->cc_op during read -- that way lies heisenbugs.

Fill in the XXX for the fp registers.

Remove duplicated defines in cpu.h.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-s390: Add missing temp_free in gen_op_calc_cc

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-s390: Use TCG registers for FPR

At the same time, tidy other usages of tcg_gen_deposit_i64.
In some cases we can "type cast" rather than extend, and in
others we can allow tcg_gen_deposit_i64 itself to optimize
the HOST_LONG_BITS==32 case.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-s390: Register helpers

Which highlights a lot of cc helpers that no longer exist.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-s390: Fix SACF exit

DISAS_EXCP is exit via exception; we wanted DISAS_JUMP.
This matters when we start cleaning up the TB exit paths.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-s390: Fix BCR

There were are two exit paths for which we forgot to
copy s->cc_op back to the tcg register.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-s390: Tidy unconditional BRCL

Yes, we're about to rewrite all of this, but having this unconditional
jump recompute cc_op is a large source of "false diff errors" when
trying to examine before and after dumps.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-s390: Fix PSW_MASK handling

We were treating psw.mask as the 32-bit quantity it is in ESA mode.
In particular, the CC field was at the wrong place.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-s390: Add format based disassassmbly infrastructure

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-s390: Split out disas_jcc

Lots of duplicated code replaced with a couple of tables.  We no longer
attempt to manually invert the logic operation: the comments now match
the code.  In the fully general test, constant propagate (1 << (3 - cc))
into (8 >> cc).

The new function will be usable by non-branch insns as well.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-s390: Reorg exception handling

Make the user path more like the system path.  Prepare for more kinds
of runtime exceptions.  Rename ILC to ILEN to make it clear that we
want to pass around a full instruction length, rather than a "code"
that happens to be stored one bit left in a larger field.

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-s390: Convert ADD HALFWORD

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-s390: Implement SUBTRACT HALFWORD

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-s390: Implement ADD LOGICAL WITH SIGNED IMMEDIATE

Signed-off-by: Richard Henderson <rth@twiddle.net>
target-s390: Convert MULTIPLY HALFWORD, SINGLE

Signed-off-by: Richard Henderson <rth@twiddle.net>