mbox series

[for-4.1,v3,00/17] tcg/ppc: Add vector opcodes

Message ID 20190319172126.7502-1-richard.henderson@linaro.org
Headers show
Series tcg/ppc: Add vector opcodes | expand

Message

Richard Henderson March 19, 2019, 5:21 p.m. UTC
Changes since v2:
  * Several generic tcg patches to improve dup vs dupi vs dupm.

    In particular, if a global temp (like guest r10) is not in
    a host register, we should duplicate from memory instead of
    loading to an integer register, spilling to stack, loading
    to a vector register, and then duplicating.

  * I have more confidence that 32-bit ppc host should work
    this time around.  No testing on that front yet, but I've
    unified some code sequences with 64-bit ppc host.

  * Base altivec now supports V128 only.  Moved V64 support to
    Power7 (v2.06), which has 64-bit load/store.

  * Dropped support for 64-bit vector multiply using Power8.
    The expansion was too large compared to using integer regs.


r~


Richard Henderson (17):
  target/arm: Fill in .opc for cmtst_op
  tcg: Assert fixed_reg is read-only
  tcg: Return bool success from tcg_out_mov
  tcg: Support cross-class moves without instruction support
  tcg: Allow add_vec, sub_vec, neg_vec, not_vec to be expanded
  tcg: Promote tcg_out_{dup,dupi}_vec to backend interface
  tcg: Manually expand INDEX_op_dup_vec
  tcg: Add tcg_out_dupm_vec to the backend interface
  tcg/i386: Implement tcg_out_dupm_vec
  tcg/aarch64: Implement tcg_out_dupm_vec
  tcg: Add INDEX_op_dup_mem_vec
  tcg/ppc: Initial backend support for Altivec
  tcg/ppc: Support vector shift by immediate
  tcg/ppc: Support vector multiply
  tcg/ppc: Update vector support to v2.06
  tcg/ppc: Update vector support to v2.07
  tcg/ppc: Update vector support to v3.00

 tcg/ppc/tcg-target.h         |   36 +-
 tcg/ppc/tcg-target.opc.h     |   11 +
 tcg/tcg-op.h                 |    1 +
 tcg/tcg-opc.h                |    1 +
 target/arm/translate.c       |    4 +
 tcg/aarch64/tcg-target.inc.c |   70 ++-
 tcg/arm/tcg-target.inc.c     |    7 +-
 tcg/i386/tcg-target.inc.c    |   78 ++-
 tcg/mips/tcg-target.inc.c    |    3 +-
 tcg/ppc/tcg-target.inc.c     | 1077 +++++++++++++++++++++++++++++++---
 tcg/riscv/tcg-target.inc.c   |    5 +-
 tcg/s390/tcg-target.inc.c    |    3 +-
 tcg/sparc/tcg-target.inc.c   |    3 +-
 tcg/tcg-op-gvec.c            |   88 +--
 tcg/tcg-op-vec.c             |   60 +-
 tcg/tcg.c                    |  252 ++++++--
 tcg/tci/tcg-target.inc.c     |    3 +-
 17 files changed, 1482 insertions(+), 220 deletions(-)
 create mode 100644 tcg/ppc/tcg-target.opc.h

-- 
2.17.2

Comments

no-reply@patchew.org March 19, 2019, 5:40 p.m. UTC | #1
Patchew URL: https://patchew.org/QEMU/20190319172126.7502-1-richard.henderson@linaro.org/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Message-id: 20190319172126.7502-1-richard.henderson@linaro.org
Type: series
Subject: [Qemu-devel] [PATCH for-4.1 v3 00/17] tcg/ppc: Add vector opcodes

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
   9bc59ffd9e..62a172e6a7  master     -> master
 * [new tag]               patchew/20190319172126.7502-1-richard.henderson@linaro.org -> patchew/20190319172126.7502-1-richard.henderson@linaro.org
Switched to a new branch 'test'
b3f85d6804 tcg/ppc: Update vector support to v3.00
d101220c5c tcg/ppc: Update vector support to v2.07
0e0e4d9828 tcg/ppc: Update vector support to v2.06
4f74948f7a tcg/ppc: Support vector multiply
3c5b8415c5 tcg/ppc: Support vector shift by immediate
f7cc7426cd tcg/ppc: Initial backend support for Altivec
65ff7b668b tcg: Add INDEX_op_dup_mem_vec
badd4b84af tcg/aarch64: Implement tcg_out_dupm_vec
7a06ac2a80 tcg/i386: Implement tcg_out_dupm_vec
024ba0bb76 tcg: Add tcg_out_dupm_vec to the backend interface
829ebc1bb4 tcg: Manually expand INDEX_op_dup_vec
74d1ac5ecc tcg: Promote tcg_out_{dup, dupi}_vec to backend interface
1e0bdeae9f tcg: Allow add_vec, sub_vec, neg_vec, not_vec to be expanded
4673251646 tcg: Support cross-class moves without instruction support
fb3eb52955 tcg: Return bool success from tcg_out_mov
a697173b71 tcg: Assert fixed_reg is read-only
bfd7e68436 target/arm: Fill in .opc for cmtst_op

=== OUTPUT BEGIN ===
1/17 Checking commit bfd7e68436ef (target/arm: Fill in .opc for cmtst_op)
2/17 Checking commit a697173b715a (tcg: Assert fixed_reg is read-only)
WARNING: Block comments use a leading /* on a separate line
#102: FILE: tcg/tcg.c:3529:
+            /* temp value is modified, so the value kept in memory is

WARNING: Block comments use * on subsequent lines
#103: FILE: tcg/tcg.c:3530:
+            /* temp value is modified, so the value kept in memory is
+               potentially not the same */

WARNING: Block comments use a trailing */ on a separate line
#103: FILE: tcg/tcg.c:3530:
+               potentially not the same */

total: 0 errors, 3 warnings, 140 lines checked

Patch 2/17 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
3/17 Checking commit fb3eb5295593 (tcg: Return bool success from tcg_out_mov)
4/17 Checking commit 4673251646b6 (tcg: Support cross-class moves without instruction support)
WARNING: Block comments use a leading /* on a separate line
#23: FILE: tcg/tcg.c:3372:
+                /* Cross register class move not supported.

WARNING: Block comments use * on subsequent lines
#24: FILE: tcg/tcg.c:3373:
+                /* Cross register class move not supported.
+                   Store the source register into the destination slot

WARNING: Block comments use a trailing */ on a separate line
#25: FILE: tcg/tcg.c:3374:
+                   and leave the destination temp as TEMP_VAL_MEM.  */

WARNING: Block comments use a leading /* on a separate line
#43: FILE: tcg/tcg.c:3485:
+                /* Cross register class move not supported.  Sync the

WARNING: Block comments use * on subsequent lines
#44: FILE: tcg/tcg.c:3486:
+                /* Cross register class move not supported.  Sync the
+                   temp back to its slot and load from there.  */

WARNING: Block comments use a trailing */ on a separate line
#44: FILE: tcg/tcg.c:3486:
+                   temp back to its slot and load from there.  */

WARNING: Block comments use a leading /* on a separate line
#56: FILE: tcg/tcg.c:3648:
+                        /* Cross register class move not supported.  Sync the

WARNING: Block comments use * on subsequent lines
#57: FILE: tcg/tcg.c:3649:
+                        /* Cross register class move not supported.  Sync the
+                           temp back to its slot and load from there.  */

WARNING: Block comments use a trailing */ on a separate line
#57: FILE: tcg/tcg.c:3649:
+                           temp back to its slot and load from there.  */

total: 0 errors, 9 warnings, 43 lines checked

Patch 4/17 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
5/17 Checking commit 1e0bdeae9fbb (tcg: Allow add_vec, sub_vec, neg_vec, not_vec to be expanded)
6/17 Checking commit 74d1ac5eccdc (tcg: Promote tcg_out_{dup, dupi}_vec to backend interface)
7/17 Checking commit 829ebc1bb408 (tcg: Manually expand INDEX_op_dup_vec)
8/17 Checking commit 024ba0bb766a (tcg: Add tcg_out_dupm_vec to the backend interface)
9/17 Checking commit 7a06ac2a80c6 (tcg/i386: Implement tcg_out_dupm_vec)
10/17 Checking commit badd4b84af08 (tcg/aarch64: Implement tcg_out_dupm_vec)
11/17 Checking commit 65ff7b668b00 (tcg: Add INDEX_op_dup_mem_vec)
WARNING: Block comments use a leading /* on a separate line
#95: FILE: tcg/tcg-op-gvec.c:400:
+        /* Recall that ARM SVE allows vector sizes that are not a

total: 0 errors, 1 warnings, 178 lines checked

Patch 11/17 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
12/17 Checking commit f7cc7426cdc3 (tcg/ppc: Initial backend support for Altivec)
ERROR: spaces required around that '|' (ctx:VxV)
#189: FILE: tcg/ppc/tcg-target.inc.c:327:
+#define VX4(opc)  (OPCD(4)|(opc))
                           ^

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#961: 
new file mode 100644

WARNING: Block comments use a leading /* on a separate line
#966: FILE: tcg/ppc/tcg-target.opc.h:1:
+/* Target-specific opcodes for host vector expansion.  These will be

WARNING: Block comments use * on subsequent lines
#967: FILE: tcg/ppc/tcg-target.opc.h:2:
+/* Target-specific opcodes for host vector expansion.  These will be
+   emitted by tcg_expand_vec_op.  For those familiar with GCC internals,

WARNING: Block comments use a trailing */ on a separate line
#968: FILE: tcg/ppc/tcg-target.opc.h:3:
+   consider these to be UNSPEC with names.  */

total: 1 errors, 4 warnings, 917 lines checked

Patch 12/17 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

13/17 Checking commit 3c5b8415c5f9 (tcg/ppc: Support vector shift by immediate)
14/17 Checking commit 4f74948f7a2c (tcg/ppc: Support vector multiply)
ERROR: code indent should never use tabs
#132: FILE: tcg/ppc/tcg-target.inc.c:3229:
+^Ibreak;$

total: 1 errors, 0 warnings, 185 lines checked

Patch 14/17 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

15/17 Checking commit 0e0e4d982853 (tcg/ppc: Update vector support to v2.06)
16/17 Checking commit d101220c5c0b (tcg/ppc: Update vector support to v2.07)
17/17 Checking commit b3f85d68046b (tcg/ppc: Update vector support to v3.00)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20190319172126.7502-1-richard.henderson@linaro.org/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Mark Cave-Ayland March 20, 2019, 7:34 p.m. UTC | #2
On 19/03/2019 17:21, Richard Henderson wrote:

> Changes since v2:

>   * Several generic tcg patches to improve dup vs dupi vs dupm.

> 

>     In particular, if a global temp (like guest r10) is not in

>     a host register, we should duplicate from memory instead of

>     loading to an integer register, spilling to stack, loading

>     to a vector register, and then duplicating.

> 

>   * I have more confidence that 32-bit ppc host should work

>     this time around.  No testing on that front yet, but I've

>     unified some code sequences with 64-bit ppc host.

> 

>   * Base altivec now supports V128 only.  Moved V64 support to

>     Power7 (v2.06), which has 64-bit load/store.

> 

>   * Dropped support for 64-bit vector multiply using Power8.

>     The expansion was too large compared to using integer regs.

> 

> 

> r~

> 

> 

> Richard Henderson (17):

>   target/arm: Fill in .opc for cmtst_op

>   tcg: Assert fixed_reg is read-only

>   tcg: Return bool success from tcg_out_mov

>   tcg: Support cross-class moves without instruction support

>   tcg: Allow add_vec, sub_vec, neg_vec, not_vec to be expanded

>   tcg: Promote tcg_out_{dup,dupi}_vec to backend interface

>   tcg: Manually expand INDEX_op_dup_vec

>   tcg: Add tcg_out_dupm_vec to the backend interface

>   tcg/i386: Implement tcg_out_dupm_vec

>   tcg/aarch64: Implement tcg_out_dupm_vec

>   tcg: Add INDEX_op_dup_mem_vec

>   tcg/ppc: Initial backend support for Altivec

>   tcg/ppc: Support vector shift by immediate

>   tcg/ppc: Support vector multiply

>   tcg/ppc: Update vector support to v2.06

>   tcg/ppc: Update vector support to v2.07

>   tcg/ppc: Update vector support to v3.00

> 

>  tcg/ppc/tcg-target.h         |   36 +-

>  tcg/ppc/tcg-target.opc.h     |   11 +

>  tcg/tcg-op.h                 |    1 +

>  tcg/tcg-opc.h                |    1 +

>  target/arm/translate.c       |    4 +

>  tcg/aarch64/tcg-target.inc.c |   70 ++-

>  tcg/arm/tcg-target.inc.c     |    7 +-

>  tcg/i386/tcg-target.inc.c    |   78 ++-

>  tcg/mips/tcg-target.inc.c    |    3 +-

>  tcg/ppc/tcg-target.inc.c     | 1077 +++++++++++++++++++++++++++++++---

>  tcg/riscv/tcg-target.inc.c   |    5 +-

>  tcg/s390/tcg-target.inc.c    |    3 +-

>  tcg/sparc/tcg-target.inc.c   |    3 +-

>  tcg/tcg-op-gvec.c            |   88 +--

>  tcg/tcg-op-vec.c             |   60 +-

>  tcg/tcg.c                    |  252 ++++++--

>  tcg/tci/tcg-target.inc.c     |    3 +-

>  17 files changed, 1482 insertions(+), 220 deletions(-)

>  create mode 100644 tcg/ppc/tcg-target.opc.h


I've given this a quick spin on my MacOS images on a G4, and a basic boot to
userspace under qemu-system-ppc for MacOS 9 and MacOS X don't show anything obvious
so far.

Lightly-Tested-By: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

(It's a bit tricky to test much as something odd is going on with performance here -
the emulator seems disproportionately slow during IO given the speed of the G4 CPU).


ATB,

Mark.
Howard Spoelstra March 23, 2019, 9:10 a.m. UTC | #3
On Tue, Mar 19, 2019 at 6:26 PM Richard Henderson <
richard.henderson@linaro.org> wrote:

> Changes since v2:

>   * Several generic tcg patches to improve dup vs dupi vs dupm.

>

>     In particular, if a global temp (like guest r10) is not in

>     a host register, we should duplicate from memory instead of

>     loading to an integer register, spilling to stack, loading

>     to a vector register, and then duplicating.

>

>   * I have more confidence that 32-bit ppc host should work

>     this time around.  No testing on that front yet, but I've

>     unified some code sequences with 64-bit ppc host.

>

>   * Base altivec now supports V128 only.  Moved V64 support to

>     Power7 (v2.06), which has 64-bit load/store.

>

>   * Dropped support for 64-bit vector multiply using Power8.

>     The expansion was too large compared to using integer regs.

>

>

> r~

>

>

> Richard Henderson (17):

>   target/arm: Fill in .opc for cmtst_op

>   tcg: Assert fixed_reg is read-only

>   tcg: Return bool success from tcg_out_mov

>   tcg: Support cross-class moves without instruction support

>   tcg: Allow add_vec, sub_vec, neg_vec, not_vec to be expanded

>   tcg: Promote tcg_out_{dup,dupi}_vec to backend interface

>   tcg: Manually expand INDEX_op_dup_vec

>   tcg: Add tcg_out_dupm_vec to the backend interface

>   tcg/i386: Implement tcg_out_dupm_vec

>   tcg/aarch64: Implement tcg_out_dupm_vec

>   tcg: Add INDEX_op_dup_mem_vec

>   tcg/ppc: Initial backend support for Altivec

>   tcg/ppc: Support vector shift by immediate

>   tcg/ppc: Support vector multiply

>   tcg/ppc: Update vector support to v2.06

>   tcg/ppc: Update vector support to v2.07

>   tcg/ppc: Update vector support to v3.00

>

>  tcg/ppc/tcg-target.h         |   36 +-

>  tcg/ppc/tcg-target.opc.h     |   11 +

>  tcg/tcg-op.h                 |    1 +

>  tcg/tcg-opc.h                |    1 +

>  target/arm/translate.c       |    4 +

>  tcg/aarch64/tcg-target.inc.c |   70 ++-

>  tcg/arm/tcg-target.inc.c     |    7 +-

>  tcg/i386/tcg-target.inc.c    |   78 ++-

>  tcg/mips/tcg-target.inc.c    |    3 +-

>  tcg/ppc/tcg-target.inc.c     | 1077 +++++++++++++++++++++++++++++++---

>  tcg/riscv/tcg-target.inc.c   |    5 +-

>  tcg/s390/tcg-target.inc.c    |    3 +-

>  tcg/sparc/tcg-target.inc.c   |    3 +-

>  tcg/tcg-op-gvec.c            |   88 +--

>  tcg/tcg-op-vec.c             |   60 +-

>  tcg/tcg.c                    |  252 ++++++--

>  tcg/tci/tcg-target.inc.c     |    3 +-

>  17 files changed, 1482 insertions(+), 220 deletions(-)

>  create mode 100644 tcg/ppc/tcg-target.opc.h

>

> --

> 2.17.2

>

>

Hi,

I applied this series to master on a G5 and a G4, both with Lubuntu. The
qemu-system-ppc and qemu-system-ppc64 builds fail to run on both. Below is
the gdb output from running a debug-enabled qemu-system-ppc on the G5.

Best,
Howard

hsp@hsp-G5-Lubuntu:~/qemu-master$ gdb --args ./qemu-system-ppc-debug  -L
pc-bios -boot d -m 512 -M mac99,via=pmu -drive
file=/home/hsp/mac-images/10.3.iso,format=raw,media=cdrom
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./qemu-system-ppc-debug...done.
(gdb) run
Starting program: /home/hsp/qemu-master/qemu-system-ppc-debug -L pc-bios
-boot d -m 512 -M mac99,via=pmu -drive
file=/home/hsp/mac-images/10.3.iso,format=raw,media=cdrom
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/powerpc-linux-gnu/libthread_db.so.1".
[New Thread 0xf7fa5f20 (LWP 25373)]
qemu-system-ppc-debug: /home/hsp/src/qemu-master/tcg/tcg.c:2201:
process_op_defs: Assertion `tdefs != ((void *)0)' failed.

Thread 1 "qemu-system-ppc" received signal SIGABRT, Aborted.
0x0eb73194 in __GI_raise (sig=sig@entry=6) at
../sysdeps/unix/sysv/linux/raise.c:54
54    ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt full
#0  0x0eb73194 in __GI_raise (sig=sig@entry=6) at
../sysdeps/unix/sysv/linux/raise.c:54
        r4 = 25369
        r7 = 246887608
        r12 = 0
        arg2 = 25369
        r5 = 6
        r8 = 61490
        r10 = 0
        arg3 = 6
        r0 = 250
        r3 = 0
        r6 = 16384
        r9 = 0
        r11 = 0
        arg1 = 0
        sc_err = <optimized out>
        sc_ret = <optimized out>
        pd = 0xf7fa8000
        pid = 0
        selftid = 25369
#1  0x0eb74ef4 in __GI_abort () at abort.c:89
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0x0, sa_sigaction =
0x0}, sa_mask = {__val = {0,
              4294957648, 32, 0, 0, 0, 0, 0, 0, 4160391448, 248113228,
4160391472, 248129648, 248112944,
              4294967295, 283897088, 248111456, 1124116252, 671089698, 0
<repeats 13 times>}},
          sa_flags = 277973508, sa_restorer = 0xecdab10 <_IO_2_1_stderr_>}
        sigs = {__val = {32, 0 <repeats 31 times>}}
#2  0x0eb6a414 in __assert_fail_base (fmt=<optimized out>,
    assertion=assertion@entry=0x10917850 "tdefs != ((void *)0)",
    file=file@entry=0x1090fd98 "/home/hsp/src/qemu-master/tcg/tcg.c",
line=line@entry=2201,
    function=function@entry=0x10918a04 <__PRETTY_FUNCTION__.36379>
"process_op_defs") at assert.c:92
        str = 0x10ebed00 "\020든\016ͦ\\tem-ppc-debug:
/home/hsp/src/qemu-master/tcg/tcg.c:2201: process_op_defs: Assertion `tdefs
!= ((void *)0)' failed.\n"
        total = 4096
#3  0x0eb6a4d4 in __GI___assert_fail (assertion=0x10917850 "tdefs != ((void
*)0)",
    file=0x1090fd98 "/home/hsp/src/qemu-master/tcg/tcg.c", line=2201,
    function=0x10918a04 <__PRETTY_FUNCTION__.36379> "process_op_defs") at
assert.c:101
No locals.
---Type <return> to continue, or q <return> to quit---
#4  0x1002d638 in process_op_defs (s=0x10d9f5e8 <tcg_init_ctx>)
    at /home/hsp/src/qemu-master/tcg/tcg.c:2201
        def = 0x10c81c0c <tcg_op_defs+3312>
        type = TCG_TYPE_I32
        i = 2
        tdefs = 0x0
        nb_args = 3
        op = INDEX_op_dup2_vec
        __PRETTY_FUNCTION__ = "process_op_defs"
#5  0x1002a56c in tcg_context_init (s=0x10d9f5e8 <tcg_init_ctx>)
    at /home/hsp/src/qemu-master/tcg/tcg.c:957
        op = 178
        total_args = 468
        n = 3
        i = 922
        def = 0x10c81fb4 <tcg_op_defs+4248>
        args_ct = 0x10ec7c38
        sorted_args = 0x10ebecf8
        ts = 0x7b21a3
        __PRETTY_FUNCTION__ = "tcg_context_init"
#6  0x1010c394 in cpu_gen_init () at
/home/hsp/src/qemu-master/accel/tcg/translate-all.c:237
No locals.
#7  0x1010decc in tcg_exec_init (tb_size=0) at
/home/hsp/src/qemu-master/accel/tcg/translate-all.c:1145
No locals.
#8  0x100dd5bc in tcg_init (ms=0x10e68200) at
/home/hsp/src/qemu-master/accel/tcg/tcg-all.c:66
No locals.
#9  0x100d3b94 in accel_init_machine (acc=0x10e16a18, ms=0x10e68200)
    at /home/hsp/src/qemu-master/accel/accel.c:63
        oc = 0x10e16a18
        cname = 0x10dc58d0 "tcg-accel"
        accel = 0x10ec4cb8
        __func__ = "accel_init_machine"
        ret = 283208216
#10 0x100d3d5c in configure_accelerator (ms=0x10e68200,
    progname=0xffffe353 "/home/hsp/qemu-master/qemu-system-ppc-debug")
    at /home/hsp/src/qemu-master/accel/accel.c:114
        accel = 0x10928bb0 "tcg"
        accel_list = 0x10ec44f0
---Type <return> to continue, or q <return> to quit---
        tmp = 0x10ec44f0
        ret = 0
        accel_initialised = false
        init_failed = false
        acc = 0x10e16a18
#11 0x10301a48 in main (argc=11, argv=0xffffe144, envp=0xffffe174) at
vl.c:4300
        i = 1
        snapshot = 0
        linux_boot = 715
        initrd_filename = 0x10c87e58 <vfio_pci_dev_properties+296> ""
        kernel_filename = 0xf7fc90cc <do_lookup_x+796> "\201a"
        kernel_cmdline = 0x10 <error: Cannot access memory at address 0x10>
        boot_order = 0x0
        boot_once = 0x0
        ds = 0x1090a64c <__libc_csu_init+140>
        opts = 0x10dfab30
        machine_opts = 0x10dfab30
        icount_opts = 0x0
        accel_opts = 0x0
        olist = 0x10cdfac4 <qemu_machine_opts>
        optind = 11
        optarg = 0xffffe3b1
"file=/home/hsp/mac-images/10.3.iso,format=raw,media=cdrom"
        loadvm = 0x0
        machine_class = 0x10e3d400
        cpu_model = 0x0
        vga_model = 0x0
        qtest_chrdev = 0x0
        qtest_log = 0x0
        incoming = 0x0
        userconfig = true
        nographic = false
        display_remote = 0
        log_mask = 0x0
        log_file = 0x0
        trace_file = 0x0
        maxram_size = 536870912
        ram_slots = 0
        vmstate_dump_file = 0x0
---Type <return> to continue, or q <return> to quit---
        main_loop_err = 0x0
        err = 0x0
        list_data_dirs = false
        dir = 0x0
        dirs = 0x10e69770
        bdo_queue = {sqh_first = 0x0, sqh_last = 0xffffdec4}
        __func__ = "main"
(gdb)
Richard Henderson March 23, 2019, 3:16 p.m. UTC | #4
On 3/23/19 2:10 AM, Howard Spoelstra wrote:
> I applied this series to master on a G5 and a G4, both with Lubuntu. The

> qemu-system-ppc and qemu-system-ppc64 builds fail to run on both. Below is the

> gdb output from running a debug-enabled qemu-system-ppc on the G5.

...
> #4  0x1002d638 in process_op_defs (s=0x10d9f5e8 <tcg_init_ctx>)

>     at /home/hsp/src/qemu-master/tcg/tcg.c:2201

>         def = 0x10c81c0c <tcg_op_defs+3312>

>         type = TCG_TYPE_I32

>         i = 2

>         tdefs = 0x0

>         nb_args = 3

>         op = INDEX_op_dup2_vec

>         __PRETTY_FUNCTION__ = "process_op_defs"


Bah.  Missing initialization for an opcode only used by 32-bit host.
Will fix shortly.


r~
Richard Henderson March 23, 2019, 7:48 p.m. UTC | #5
On 3/23/19 2:10 AM, Howard Spoelstra wrote:
> I applied this series to master on a G5 and a G4, both with Lubuntu. The

> qemu-system-ppc and qemu-system-ppc64 builds fail to run on both. Below is the

> gdb output from running a debug-enabled qemu-system-ppc on the G5.



Please try the following, which should fix that assert.
I have also updated by branch:

  https://github.com/rth7680/qemu/tree/tcg-ppc-vsx


r~

---
>From ca448a66e2596131aa7a30a16230676d3ef77b9c Mon Sep 17 00:00:00 2001

From: Richard Henderson <richard.henderson@linaro.org>

Date: Sat, 23 Mar 2019 19:40:05 +0000
Subject: [PATCH] tcg/ppc: Support vector dup2

This is only used for 32-bit hosts.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 tcg/ppc/tcg-target.inc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.inc.c
index 4373989..00106f3 100644
--- a/tcg/ppc/tcg-target.inc.c
+++ b/tcg/ppc/tcg-target.inc.c
@@ -3114,6 +3114,14 @@ static void tcg_out_vec_op
         }
         break;

+    case INDEX_op_dup2_vec:
+        assert(TCG_TARGET_REG_BITS == 32);
+        /* With inputs a1 = xLxx, a2 = xHxx  */
+        tcg_out32(s, VMRGHW | VRT(a0) | VRA(a2) | VRB(a1));  /* a0  = xxHL */
+        tcg_out_vsldoi(s, TCG_VEC_TMP1, a0, a0, 8);          /* tmp = HLxx */
+        tcg_out_vsldoi(s, a0, a0, TCG_VEC_TMP1, 8);          /* a0  = HLHL */
+        return;
+
     case INDEX_op_ppc_mrgh_vec:
         insn = mrgh_op[vece];
         break;
@@ -3492,6 +3500,7 @@ static const TCGTargetOpDef *tcg_target_op_def
     case INDEX_op_ppc_mulou_vec:
     case INDEX_op_ppc_pkum_vec:
     case INDEX_op_ppc_rotl_vec:
+    case INDEX_op_dup2_vec:
         return &v_v_v;
     case INDEX_op_not_vec:
     case INDEX_op_dup_vec:
-- 
1.8.3.1
Howard Spoelstra March 23, 2019, 10:13 p.m. UTC | #6
On Sat, Mar 23, 2019 at 8:48 PM Richard Henderson <
richard.henderson@linaro.org> wrote:

> On 3/23/19 2:10 AM, Howard Spoelstra wrote:

> > I applied this series to master on a G5 and a G4, both with Lubuntu. The

> > qemu-system-ppc and qemu-system-ppc64 builds fail to run on both. Below

> is the

> > gdb output from running a debug-enabled qemu-system-ppc on the G5.

>

>

> Please try the following, which should fix that assert.

> I have also updated by branch:

>

>   https://github.com/rth7680/qemu/tree/tcg-ppc-vsx

>

>

Hi,

I compiled from your branch. On the G5 qemu-system-ppc hangs after a while.
It seems I cannot get a bt.

hsp@hsp-G5-Lubuntu:~/qemu-tcg-vsx$ gdb --args ./qemu-system-ppc -L pc-bios
-boot d -m 512 -M mac99,via=pmu -netdev user,id=network01 -device
sungem,netdev=network01  -drive
file=/home/hsp/mac-images/10.3.iso,format=raw,media=cdrom -prom-env
"boot-args=-v"
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "powerpc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./qemu-system-ppc...done.
(gdb) run
Starting program: /home/hsp/qemu-tcg-vsx/qemu-system-ppc -L pc-bios -boot d
-m 512 -M mac99,via=pmu -netdev user,id=network01 -device
sungem,netdev=network01 -drive
file=/home/hsp/mac-images/10.3.iso,format=raw,media=cdrom -prom-env
boot-args=-v
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/powerpc-linux-gnu/libthread_db.so.1".
[New Thread 0xf7fa5f20 (LWP 13372)]
[New Thread 0xf5451f20 (LWP 13373)]
[New Thread 0xd376ff20 (LWP 13374)]
[New Thread 0xd2dfef20 (LWP 13375)]
[New Thread 0xd0ffef20 (LWP 13381)]
[Thread 0xd0ffef20 (LWP 13381) exited]
[New Thread 0xd0ffef20 (LWP 13398)]
[Thread 0xd0ffef20 (LWP 13398) exited]
[New Thread 0xd0ffef20 (LWP 13399)]
[Thread 0xd0ffef20 (LWP 13399) exited]
thread_get_info_callback: cannot get thread info: generic error
(gdb) bt
Selected thread is running.
(gdb)