On Tue, Mar 19, 2019 at 6:26 PM Richard Henderson < richard.hender...@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)