mbox series

[RFC,v4,00/29] Hexagon patch series

Message ID 1601314138-9930-1-git-send-email-tsimpson@quicinc.com
Headers show
Series Hexagon patch series | expand

Message

Taylor Simpson Sept. 28, 2020, 5:28 p.m. UTC
This series adds support for the Hexagon processor with Linux user support

See patch 02/34 Hexagon README for detailed information.

Once the series is applied, the Hexagon port will pass "make check-tcg".
The series also includes Hexagon-specific tests in tcg/tests/hexagon.

The series is also available at https://github.com/quic/qemu on branch
small_series_v4.

We have a parallel effort to make the Hexagon Linux toolchain publically
available.

*** Known checkpatch issues ***

The following are known checkpatch errors in the series
    target/hexagon/reg_fields.h         Complex macro
    target/hexagon/attribs.h            Complex macro
    target/hexagon/decode.c             Complex macro
    target/hexagon/q6v_decode.c         Macro needs do - while
    target/hexagon/printinsn.c          Macro needs do - while
    target/hexagon/gen_semantics.c      Suspicious ; after while (0)
    target/hexagon/gen_dectree_import.c Complex macro
    target/hexagon/gen_dectree_import.c Suspicious ; after while (0)
    target/hexagon/opcodes.c            Complex macro
    target/hexagon/iclass.h             Complex macro
    configure.sh                        Line over 90 characters
    scripts/qemu-binfmt-conf.sh         Line over 90 characters

The following are known checkpatch warnings in the series
    target/hexagon/fma_emu.c            Comments inside macro definition
    target/hexagon/gen_tcg_funcs.py     Line over 80 characters
    scripts/qemu-binfmt-conf.sh         Line over 80 characters

*** Changes in v4 ***
Convert target/hexagon/Makefile.objs to meson.build

Address portions of feedback from Richard Henderson.  Here is the table
of items from Richard's review.
Patch   Item                                                 Blocker Status
        Use qemu softfloat                                   Yes
        Use qemu decodetree.py                               No
Several Use const when appropriate                           Yes
Several Remove anything after g_assert_not_reached           Yes     DONE
Several Fix log_store32/64 add/remove/add in patch series    Yes     DONE
Several Follow naming guidelines for structs and enums       Yes
4       Move decls to cpu-param.h                            Yes     DONE
4       Remove CONFIG_USER_ONLY ifdef's                      Yes     DONE
4       Remove DEBUG_HEXAGON                                 Yes     Partially
4       Remove stack pointer modification hack               Yes     DONE
4       Add property x-lldb-compat to control output         Yes     DONE
6       Include instruction and raw bytes in disassembly     Yes
7       Use DEF_HELPER_FLAGS                                 No
07, 26  Endianness of merge_bytes                            Yes
7       Fix overlap test                                     Yes
7       Remove HELPER(debug_value)/HELPER(debug_value_i64)   Yes     DONE
9       Include "qemu/osdep.h" instead of <stdint.h>         Yes     DONE
Several Stick with stdint.h types except in imported files   Yes     DONE
11      Remove description from reg field definitions        Yes     DONE
13      Move regmap.h into decode.c                          Yes     DONE
14, 27  Use bit mask instead of strings in decoding          No
14      Add comments to decoder                              Yes
16      Use qemu/int128.h                                    No
17      Squash patches dealing with imported files           Yes     DONE
24      Use qemu/bitops.h for instruction attributes         No
24      Fix initialization of opcode_short_semantics         Yes     DONE
24      Change if (p == NULL) { g_assert_not_reached(); }
        to assert(p != NULL)                                 No      DONE
25      Expand DECL/READ/WRITE/FREE macros in generator      Yes     DONE
26      Rewrite fINSERT*, fEXTRACT*, f?XTN macros            Yes     DONE
26      Investigate fRND macro                               No      DONE
26      Change REG = REG to (VOID)REG to suppress warning    Yes     DONE
27      Remove multiple includes of imported/iclass.def      Yes     DONE
28      Move genptr_helpers.h into genptr.c                  Yes     DONE
28      Remove unneeded temps                                No      DONE
28      Use tcg_gen_deposit_tl and tcg_gen_extract_tl
        when dealing with p3_0                               No      DONE
29      Size opcode_genptr[] properly and initialize
        with [TAG] = generate_##TAG                          Yes     DONE
30      Don't generate helpers for overridden instructions   Yes     DONE
        Don't include "gen_tcg.h" in helper.h                Yes     DONE
31      Use bitmask for ctx->reg_log instead of an array     Yes
31      Use tcg_gen_extract_i32 for gen_slot_cancelled_check Yes     DONE
31      Properly deal with reading instructions across
        a page boundary and too many instructions before
        finding end-of-packet                                Yes     DONE
31      Don't set PC at the beginning of every packet        No
31      Don't set slot_cancelled unless needed               No
31      Don't set hex_pred_written unless needed             No
31      Change cancelled variable to not local               Yes     DONE
31      Remove unnecessary temp                              Yes     DONE
31      Let tcg_gen_addi_tl check for zero                   Yes     DONE
31      Move gen_exec_counters to end of TB                  No
31      Move end of TB handling to hexagon_tr_tb_stop        Yes     DONE
        Generate two lists for TCG functions instead of
        the DEF_TCG_FUNC macro                               Yes     DONE


*** Changes in v3 ***
Remove substantial portions of the code to facilitate review
- Plan to submit subsequent patches
- Hexagon Vector eXtensions (HVX)
- Circular and bit-reverse addressiong
- Add/sub-with-carry
- Unused insn_t and pkt_t fields
- Unused instruction attributes
- All TCG overrides except instructions with multiple definitions
- Unused macros
- Unused reg fields
- COUNT_HEX_HELPERS
Use Laurent's gensyscall.sh script to generate linux-user/hexagon/syscall_nr.h
Handle mem_noshuf
Remove "RsV = RsV" per review feedback
Simplify include file structure
Add directed tests in <qemu>/tests/tcg/hexagon
Change fWRAP_* macros to fGEN_TCG_*

*** Changes in v2 ***
- Use scripts/git.orderfile
- Create a README with the code overview in patch 0001
- Change #define's in hex_regs.h to an enum
- Replace hard coded disassembly buffer length (1028) with #define
- Move Hexagon architecture types patch earlier in series
- Replace #include standard header files with #include "qemu/osdep.h"
- Prefix all header file #ifndef's with HEXAGON_
- Update python version to python3
- #include "tcg/tcg.h" in genptr_helpers.h
- Change target/hexagon/Makefile.objs to support out-of-tree build
- Updated copyright to include year 2020
- Bug fixes
    Fix some problems with HEX_DEBUG output
    Fix bug in circular addressing
- Optimizations to reduce the amount of TCG code generated
    Change pred_written from an array to a bit mask

Taylor Simpson (29):
  Hexagon Update MAINTAINERS file
  Hexagon (target/hexagon) README
  Hexagon (include/elf.h) ELF machine definition
  Hexagon (target/hexagon) scalar core definition
  Hexagon (disas) disassembler
  Hexagon (target/hexagon) register names
  Hexagon (target/hexagon) scalar core helpers
  Hexagon (target/hexagon) GDB Stub
  Hexagon (target/hexagon) architecture types
  Hexagon (target/hexagon) instruction and packet types
  Hexagon (target/hexagon) register fields
  Hexagon (target/hexagon) instruction attributes
  Hexagon (target/hexagon) instruction/packet decode
  Hexagon (target/hexagon) instruction printing
  Hexagon (target/hexagon) utility functions
  Hexagon (target/hexagon/imported) arch import
  Hexagon (target/hexagon) generator phase 1 - C preprocessor for
    semantics
  Hexagon (target/hexagon) generator phase 2 - generate header files
  Hexagon (target/hexagon) generator phase 3 - C preprocessor for decode
    tree
  Hexagon (target/hexagon) generater phase 4 - decode tree
  Hexagon (target/hexagon) opcode data structures
  Hexagon (target/hexagon) macros
  Hexagon (target/hexagon) instruction classes
  Hexagon (target/hexagon) TCG generation
  Hexagon (target/hexagon) TCG for instructions with multiple
    definitions
  Hexagon (target/hexagon) translation
  Hexagon (linux-user/hexagon) Linux user emulation
  Hexagon (tests/tcg/hexagon) TCG tests
  Hexagon build infrastructure

 configure                                  |    6 +
 default-configs/hexagon-linux-user.mak     |    1 +
 meson.build                                |    1 +
 include/disas/dis-asm.h                    |    1 +
 include/elf.h                              |    2 +
 linux-user/hexagon/sockbits.h              |   18 +
 linux-user/hexagon/syscall_nr.h            |  343 +++++
 linux-user/hexagon/target_cpu.h            |   44 +
 linux-user/hexagon/target_elf.h            |   40 +
 linux-user/hexagon/target_fcntl.h          |   18 +
 linux-user/hexagon/target_signal.h         |   34 +
 linux-user/hexagon/target_structs.h        |   46 +
 linux-user/hexagon/target_syscall.h        |   36 +
 linux-user/hexagon/termbits.h              |   18 +
 linux-user/qemu.h                          |    2 +
 linux-user/syscall_defs.h                  |   33 +
 target/hexagon/arch.h                      |   42 +
 target/hexagon/attribs.h                   |   32 +
 target/hexagon/attribs_def.h               |   98 ++
 target/hexagon/conv_emu.h                  |   50 +
 target/hexagon/cpu-param.h                 |   29 +
 target/hexagon/cpu.h                       |  159 +++
 target/hexagon/cpu_bits.h                  |   34 +
 target/hexagon/decode.h                    |   39 +
 target/hexagon/fma_emu.h                   |   27 +
 target/hexagon/gen_tcg.h                   |  198 +++
 target/hexagon/genptr.h                    |   25 +
 target/hexagon/helper.h                    |   31 +
 target/hexagon/hex_arch_types.h            |   43 +
 target/hexagon/hex_regs.h                  |   83 ++
 target/hexagon/iclass.h                    |   40 +
 target/hexagon/insn.h                      |   74 +
 target/hexagon/internal.h                  |   39 +
 target/hexagon/macros.h                    |  654 +++++++++
 target/hexagon/opcodes.h                   |   66 +
 target/hexagon/printinsn.h                 |   26 +
 target/hexagon/reg_fields.h                |   36 +
 target/hexagon/reg_fields_def.h            |   41 +
 target/hexagon/translate.h                 |   89 ++
 disas/hexagon.c                            |   62 +
 linux-user/elfload.c                       |   16 +
 linux-user/hexagon/cpu_loop.c              |   99 ++
 linux-user/hexagon/signal.c                |  276 ++++
 target/hexagon/arch.c                      |  354 +++++
 target/hexagon/conv_emu.c                  |  369 +++++
 target/hexagon/cpu.c                       |  314 +++++
 target/hexagon/decode.c                    |  606 ++++++++
 target/hexagon/fma_emu.c                   |  777 ++++++++++
 target/hexagon/gdbstub.c                   |   47 +
 target/hexagon/gen_dectree_import.c        |  191 +++
 target/hexagon/gen_semantics.c             |   88 ++
 target/hexagon/genptr.c                    |  234 +++
 target/hexagon/iclass.c                    |   80 ++
 target/hexagon/op_helper.c                 |  381 +++++
 target/hexagon/opcodes.c                   |  199 +++
 target/hexagon/printinsn.c                 |   91 ++
 target/hexagon/q6v_decode.c                |  373 +++++
 target/hexagon/reg_fields.c                |   28 +
 target/hexagon/translate.c                 |  678 +++++++++
 tests/tcg/hexagon/atomics.c                |  122 ++
 tests/tcg/hexagon/clrtnew.c                |   56 +
 tests/tcg/hexagon/dual_stores.c            |   60 +
 tests/tcg/hexagon/exec_counters.c          |   57 +
 tests/tcg/hexagon/mem_noshuf.c             |  291 ++++
 tests/tcg/hexagon/misc.c                   |  293 ++++
 tests/tcg/hexagon/preg_alias.c             |  106 ++
 tests/tcg/hexagon/pthread_cancel.c         |   43 +
 tests/tcg/hexagon/sfminmax.c               |   62 +
 MAINTAINERS                                |    8 +
 disas/meson.build                          |    1 +
 linux-user/hexagon/meson.build             |   22 +
 linux-user/meson.build                     |    1 +
 scripts/gensyscalls.sh                     |    3 +-
 scripts/qemu-binfmt-conf.sh                |    6 +-
 target/hexagon/README                      |  236 ++++
 target/hexagon/dectree.py                  |  352 +++++
 target/hexagon/gen_helper_funcs.py         |  229 +++
 target/hexagon/gen_helper_protos.py        |  158 +++
 target/hexagon/gen_op_attribs.py           |   46 +
 target/hexagon/gen_op_regs.py              |  119 ++
 target/hexagon/gen_opcodes_def.py          |   43 +
 target/hexagon/gen_printinsn.py            |  185 +++
 target/hexagon/gen_shortcode.py            |   71 +
 target/hexagon/gen_tcg_func_table.py       |   66 +
 target/hexagon/gen_tcg_funcs.py            |  543 +++++++
 target/hexagon/hex_common.py               |  216 +++
 target/hexagon/imported/allidefs.def       |   30 +
 target/hexagon/imported/alu.idef           | 1259 +++++++++++++++++
 target/hexagon/imported/branch.idef        |  328 +++++
 target/hexagon/imported/compare.idef       |  621 ++++++++
 target/hexagon/imported/encode.def         |  125 ++
 target/hexagon/imported/encode_pp.def      | 2110 ++++++++++++++++++++++++++++
 target/hexagon/imported/encode_subinsn.def |  150 ++
 target/hexagon/imported/float.idef         |  313 +++++
 target/hexagon/imported/iclass.def         |   52 +
 target/hexagon/imported/ldst.idef          |  286 ++++
 target/hexagon/imported/macros.def         | 1529 ++++++++++++++++++++
 target/hexagon/imported/mpy.idef           | 1212 ++++++++++++++++
 target/hexagon/imported/shift.idef         | 1067 ++++++++++++++
 target/hexagon/imported/subinsns.idef      |  152 ++
 target/hexagon/imported/system.idef        |   69 +
 target/hexagon/meson.build                 |  178 +++
 target/meson.build                         |    1 +
 tests/tcg/configure.sh                     |    4 +-
 tests/tcg/hexagon/Makefile.target          |   49 +
 tests/tcg/hexagon/first.S                  |   57 +
 tests/tcg/hexagon/float_convs.ref          |  748 ++++++++++
 tests/tcg/hexagon/float_madds.ref          |  768 ++++++++++
 108 files changed, 22361 insertions(+), 3 deletions(-)
 create mode 100644 default-configs/hexagon-linux-user.mak
 create mode 100644 linux-user/hexagon/sockbits.h
 create mode 100644 linux-user/hexagon/syscall_nr.h
 create mode 100644 linux-user/hexagon/target_cpu.h
 create mode 100644 linux-user/hexagon/target_elf.h
 create mode 100644 linux-user/hexagon/target_fcntl.h
 create mode 100644 linux-user/hexagon/target_signal.h
 create mode 100644 linux-user/hexagon/target_structs.h
 create mode 100644 linux-user/hexagon/target_syscall.h
 create mode 100644 linux-user/hexagon/termbits.h
 create mode 100644 target/hexagon/arch.h
 create mode 100644 target/hexagon/attribs.h
 create mode 100644 target/hexagon/attribs_def.h
 create mode 100644 target/hexagon/conv_emu.h
 create mode 100644 target/hexagon/cpu-param.h
 create mode 100644 target/hexagon/cpu.h
 create mode 100644 target/hexagon/cpu_bits.h
 create mode 100644 target/hexagon/decode.h
 create mode 100644 target/hexagon/fma_emu.h
 create mode 100644 target/hexagon/gen_tcg.h
 create mode 100644 target/hexagon/genptr.h
 create mode 100644 target/hexagon/helper.h
 create mode 100644 target/hexagon/hex_arch_types.h
 create mode 100644 target/hexagon/hex_regs.h
 create mode 100644 target/hexagon/iclass.h
 create mode 100644 target/hexagon/insn.h
 create mode 100644 target/hexagon/internal.h
 create mode 100644 target/hexagon/macros.h
 create mode 100644 target/hexagon/opcodes.h
 create mode 100644 target/hexagon/printinsn.h
 create mode 100644 target/hexagon/reg_fields.h
 create mode 100644 target/hexagon/reg_fields_def.h
 create mode 100644 target/hexagon/translate.h
 create mode 100644 disas/hexagon.c
 create mode 100644 linux-user/hexagon/cpu_loop.c
 create mode 100644 linux-user/hexagon/signal.c
 create mode 100644 target/hexagon/arch.c
 create mode 100644 target/hexagon/conv_emu.c
 create mode 100644 target/hexagon/cpu.c
 create mode 100644 target/hexagon/decode.c
 create mode 100644 target/hexagon/fma_emu.c
 create mode 100644 target/hexagon/gdbstub.c
 create mode 100644 target/hexagon/gen_dectree_import.c
 create mode 100644 target/hexagon/gen_semantics.c
 create mode 100644 target/hexagon/genptr.c
 create mode 100644 target/hexagon/iclass.c
 create mode 100644 target/hexagon/op_helper.c
 create mode 100644 target/hexagon/opcodes.c
 create mode 100644 target/hexagon/printinsn.c
 create mode 100644 target/hexagon/q6v_decode.c
 create mode 100644 target/hexagon/reg_fields.c
 create mode 100644 target/hexagon/translate.c
 create mode 100644 tests/tcg/hexagon/atomics.c
 create mode 100644 tests/tcg/hexagon/clrtnew.c
 create mode 100644 tests/tcg/hexagon/dual_stores.c
 create mode 100644 tests/tcg/hexagon/exec_counters.c
 create mode 100644 tests/tcg/hexagon/mem_noshuf.c
 create mode 100644 tests/tcg/hexagon/misc.c
 create mode 100644 tests/tcg/hexagon/preg_alias.c
 create mode 100644 tests/tcg/hexagon/pthread_cancel.c
 create mode 100644 tests/tcg/hexagon/sfminmax.c
 create mode 100644 linux-user/hexagon/meson.build
 create mode 100644 target/hexagon/README
 create mode 100755 target/hexagon/dectree.py
 create mode 100755 target/hexagon/gen_helper_funcs.py
 create mode 100755 target/hexagon/gen_helper_protos.py
 create mode 100755 target/hexagon/gen_op_attribs.py
 create mode 100755 target/hexagon/gen_op_regs.py
 create mode 100755 target/hexagon/gen_opcodes_def.py
 create mode 100755 target/hexagon/gen_printinsn.py
 create mode 100755 target/hexagon/gen_shortcode.py
 create mode 100755 target/hexagon/gen_tcg_func_table.py
 create mode 100755 target/hexagon/gen_tcg_funcs.py
 create mode 100755 target/hexagon/hex_common.py
 create mode 100644 target/hexagon/imported/allidefs.def
 create mode 100644 target/hexagon/imported/alu.idef
 create mode 100644 target/hexagon/imported/branch.idef
 create mode 100644 target/hexagon/imported/compare.idef
 create mode 100644 target/hexagon/imported/encode.def
 create mode 100644 target/hexagon/imported/encode_pp.def
 create mode 100644 target/hexagon/imported/encode_subinsn.def
 create mode 100644 target/hexagon/imported/float.idef
 create mode 100644 target/hexagon/imported/iclass.def
 create mode 100644 target/hexagon/imported/ldst.idef
 create mode 100755 target/hexagon/imported/macros.def
 create mode 100644 target/hexagon/imported/mpy.idef
 create mode 100644 target/hexagon/imported/shift.idef
 create mode 100644 target/hexagon/imported/subinsns.idef
 create mode 100644 target/hexagon/imported/system.idef
 create mode 100644 target/hexagon/meson.build
 create mode 100644 tests/tcg/hexagon/Makefile.target
 create mode 100644 tests/tcg/hexagon/first.S
 create mode 100644 tests/tcg/hexagon/float_convs.ref
 create mode 100644 tests/tcg/hexagon/float_madds.ref

Comments

no-reply@patchew.org Sept. 29, 2020, 1:12 a.m. UTC | #1
Patchew URL: https://patchew.org/QEMU/1601314138-9930-1-git-send-email-tsimpson@quicinc.com/



Hi,

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

Type: series
Message-id: 1601314138-9930-1-git-send-email-tsimpson@quicinc.com
Subject: [RFC PATCH v4 00/29] Hexagon patch series

=== 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
Switched to a new branch 'test'
07b7654 Hexagon build infrastructure
010f970 Hexagon (tests/tcg/hexagon) TCG tests
6d5cc34 Hexagon (linux-user/hexagon) Linux user emulation
2cc6884 Hexagon (target/hexagon) translation
78dc364 Hexagon (target/hexagon) TCG for instructions with multiple definitions
7da73c1 Hexagon (target/hexagon) TCG generation
2667588 Hexagon (target/hexagon) instruction classes
6447bfd Hexagon (target/hexagon) macros
09a6ee0 Hexagon (target/hexagon) opcode data structures
0a72ce4 Hexagon (target/hexagon) generater phase 4 - decode tree
e10510a Hexagon (target/hexagon) generator phase 3 - C preprocessor for decode tree
e13fc67 Hexagon (target/hexagon) generator phase 2 - generate header files
c51b8ef Hexagon (target/hexagon) generator phase 1 - C preprocessor for semantics
8e3991c Hexagon (target/hexagon/imported) arch import
aaa7fdf Hexagon (target/hexagon) utility functions
e10964e Hexagon (target/hexagon) instruction printing
78eb919 Hexagon (target/hexagon) instruction/packet decode
71da9a7 Hexagon (target/hexagon) instruction attributes
14de848 Hexagon (target/hexagon) register fields
e51e071 Hexagon (target/hexagon) instruction and packet types
7aa4ff5 Hexagon (target/hexagon) architecture types
cd303dc Hexagon (target/hexagon) GDB Stub
acb70e2 Hexagon (target/hexagon) scalar core helpers
c5c476c Hexagon (target/hexagon) register names
dcf7c0c Hexagon (disas) disassembler
6564db7 Hexagon (target/hexagon) scalar core definition
a5ea831 Hexagon (include/elf.h) ELF machine definition
73fa471 Hexagon (target/hexagon) README
83d6242 Hexagon Update MAINTAINERS file

=== OUTPUT BEGIN ===
1/29 Checking commit 83d6242ea963 (Hexagon Update MAINTAINERS file)
2/29 Checking commit 73fa4715a018 (Hexagon (target/hexagon) README)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#13: 
new file mode 100644

total: 0 errors, 1 warnings, 236 lines checked

Patch 2/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
3/29 Checking commit a5ea8316fe44 (Hexagon (include/elf.h) ELF machine definition)
4/29 Checking commit 6564db7eff40 (Hexagon (target/hexagon) scalar core definition)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#13: 
new file mode 100644

total: 0 errors, 1 warnings, 570 lines checked

Patch 4/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
5/29 Checking commit dcf7c0cbc41a (Hexagon (disas) disassembler)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#15: 
new file mode 100644

total: 0 errors, 1 warnings, 76 lines checked

Patch 5/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
6/29 Checking commit c5c476c4cb67 (Hexagon (target/hexagon) register names)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#12: 
new file mode 100644

total: 0 errors, 1 warnings, 83 lines checked

Patch 6/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
7/29 Checking commit acb70e2f6042 (Hexagon (target/hexagon) scalar core helpers)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#14: 
new file mode 100644

total: 0 errors, 1 warnings, 412 lines checked

Patch 7/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
8/29 Checking commit cd303dc889e2 (Hexagon (target/hexagon) GDB Stub)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#27: 
new file mode 100644

total: 0 errors, 1 warnings, 64 lines checked

Patch 8/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
9/29 Checking commit 7aa4ff557b75 (Hexagon (target/hexagon) architecture types)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#13: 
new file mode 100644

total: 0 errors, 1 warnings, 43 lines checked

Patch 9/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
10/29 Checking commit e51e0716fa19 (Hexagon (target/hexagon) instruction and packet types)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#14: 
new file mode 100644

total: 0 errors, 1 warnings, 74 lines checked

Patch 10/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11/29 Checking commit 14de84860eaa (Hexagon (target/hexagon) register fields)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#13: 
new file mode 100644

ERROR: Macros with complex values should be enclosed in parenthesis
#80: FILE: target/hexagon/reg_fields.h:29:
+#define DEF_REG_FIELD(TAG, START, WIDTH) \
+    TAG,

total: 1 errors, 1 warnings, 105 lines checked

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

12/29 Checking commit 71da9a7c0527 (Hexagon (target/hexagon) instruction attributes)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#11: 
new file mode 100644

ERROR: Macros with complex values should be enclosed in parenthesis
#37: FILE: target/hexagon/attribs.h:22:
+#define DEF_ATTRIB(NAME, ...) A_##NAME,

total: 1 errors, 1 warnings, 130 lines checked

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

13/29 Checking commit 78eb9192e26e (Hexagon (target/hexagon) instruction/packet decode)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#22: 
new file mode 100644

ERROR: Macros with complex values should be enclosed in parenthesis
#133: FILE: target/hexagon/decode.c:107:
+#define DECODE_SEPARATOR_BITS(START, WIDTH) NULL, START, WIDTH

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#734: FILE: target/hexagon/q6v_decode.c:51:
+#define DECODE_OPINFO(TAG, BEH) \
+    case TAG: \
+        { BEH  } \
+        break; \
+

total: 2 errors, 1 warnings, 1018 lines checked

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

14/29 Checking commit e10964e7afdd (Hexagon (target/hexagon) instruction printing)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#11: 
new file mode 100644

ERROR: Macros with multiple statements should be enclosed in a do - while loop
#58: FILE: target/hexagon/printinsn.c:43:
+#define DEF_PRINTINFO(TAG, FMT, ...) \
+    case TAG: \
+        snprintf(buf, n, FMT, __VA_ARGS__);\
+        break;

total: 1 errors, 1 warnings, 117 lines checked

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

15/29 Checking commit aaa7fdf81e1f (Hexagon (target/hexagon) utility functions)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#13: 
new file mode 100644

WARNING: Block comments use a leading /* on a separate line
#1325: FILE: target/hexagon/fma_emu.c:469:
+        /* result zero */ \

WARNING: Block comments use a leading /* on a separate line
#1333: FILE: target/hexagon/fma_emu.c:477:
+    /* Normalize right */ \

WARNING: Block comments use a leading /* on a separate line
#1334: FILE: target/hexagon/fma_emu.c:478:
+    /* We want MANTBITS bits of mantissa plus the leading one. */ \

WARNING: Block comments use a leading /* on a separate line
#1335: FILE: target/hexagon/fma_emu.c:479:
+    /* That means that we want MANTBITS+1 bits, or 0x000000000000FF_FFFF */ \

WARNING: Block comments use a leading /* on a separate line
#1336: FILE: target/hexagon/fma_emu.c:480:
+    /* So we need to normalize right while the high word is non-zero and \

WARNING: Block comments should align the * on each line
#1337: FILE: target/hexagon/fma_emu.c:481:
+    /* So we need to normalize right while the high word is non-zero and \
+    * while the low word is nonzero when masked with 0xffe0_0000_0000_0000 */ \

WARNING: Block comments use a leading /* on a separate line
#1341: FILE: target/hexagon/fma_emu.c:485:
+    /* \

WARNING: Block comments use a leading /* on a separate line
#1351: FILE: target/hexagon/fma_emu.c:495:
+    /* \

WARNING: Block comments use a leading /* on a separate line
#1358: FILE: target/hexagon/fma_emu.c:502:
+        /* \

WARNING: Block comments use a leading /* on a separate line
#1367: FILE: target/hexagon/fma_emu.c:511:
+    /* OK, we're relatively canonical... now we need to round */ \

WARNING: Block comments use a leading /* on a separate line
#1372: FILE: target/hexagon/fma_emu.c:516:
+            /* Chop and we're done */ \

WARNING: Block comments use a leading /* on a separate line
#1386: FILE: target/hexagon/fma_emu.c:530:
+                /* round up if guard is 1, down if guard is zero */ \

WARNING: Block comments use a leading /* on a separate line
#1389: FILE: target/hexagon/fma_emu.c:533:
+                /* exactly .5, round up if odd */ \

WARNING: Block comments use a leading /* on a separate line
#1395: FILE: target/hexagon/fma_emu.c:539:
+    /* \

WARNING: Block comments use a leading /* on a separate line
#1404: FILE: target/hexagon/fma_emu.c:548:
+    /* Overflow? */ \

WARNING: Block comments use a leading /* on a separate line
#1406: FILE: target/hexagon/fma_emu.c:550:
+        /* Yep, inf result */ \

WARNING: Block comments use a leading /* on a separate line
#1428: FILE: target/hexagon/fma_emu.c:572:
+    /* Underflow? */ \

WARNING: Block comments use a leading /* on a separate line
#1430: FILE: target/hexagon/fma_emu.c:574:
+        /* Leading one means: No, we're normal. So, we should be done... */ \

total: 0 errors, 19 warnings, 1619 lines checked

Patch 15/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
16/29 Checking commit 8e3991cea132 (Hexagon (target/hexagon/imported) arch import)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#28: 
new file mode 100644

total: 0 errors, 1 warnings, 9251 lines checked

Patch 16/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
17/29 Checking commit c51b8efd689a (Hexagon (target/hexagon) generator phase 1 - C preprocessor for semantics)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#17: 
new file mode 100644

ERROR: suspicious ; after while (0)
#82: FILE: target/hexagon/gen_semantics.c:61:
+    } while (0);

total: 1 errors, 1 warnings, 88 lines checked

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

18/29 Checking commit e13fc6785aa7 (Hexagon (target/hexagon) generator phase 2 - generate header files)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#32: 
new file mode 100755

WARNING: line over 80 characters
#1051: FILE: target/hexagon/gen_tcg_funcs.py:50:
+        f.write("        tcg_gen_mov_tl(hex_new_value[%s + 1], hex_gpr[%s + 1]);\n" % \

WARNING: line over 80 characters
#1130: FILE: target/hexagon/gen_tcg_funcs.py:129:
+            f.write("    TCGv %s%sN = hex_new_pred_value[insn->regno[%d]];\n" % \

WARNING: line over 80 characters
#1215: FILE: target/hexagon/gen_tcg_funcs.py:214:
+            f.write("                                 hex_gpr[%s%sN + 1]);\n" % \

WARNING: line over 80 characters
#1236: FILE: target/hexagon/gen_tcg_funcs.py:235:
+            f.write("                                     hex_gpr[%s%sN + 1]);\n" % \

WARNING: line over 80 characters
#1240: FILE: target/hexagon/gen_tcg_funcs.py:239:
+            f.write("        tcg_gen_concat_i32_i64(%s%sV, hex_gpr[%s%sN],\n" % \

WARNING: line over 80 characters
#1242: FILE: target/hexagon/gen_tcg_funcs.py:241:
+            f.write("                                     hex_gpr[%s%sN + 1]);\n" % \

WARNING: line over 80 characters
#1251: FILE: target/hexagon/gen_tcg_funcs.py:250:
+            f.write("        tcg_gen_mov_tl(%s%sV, hex_gpr[%s%sN + HEX_REG_SA0]);\n" % \

WARNING: line over 80 characters
#1311: FILE: target/hexagon/gen_tcg_funcs.py:310:
+        f.write("    gen_log_predicated_reg_write_pair(%s%sN, %s%sV, insn->slot);\n" % \

WARNING: line over 80 characters
#1355: FILE: target/hexagon/gen_tcg_funcs.py:354:
+            f.write("        gen_log_reg_write(%s%sN + HEX_REG_SA0 + 1, val32);\n" % \

WARNING: line over 80 characters
#1358: FILE: target/hexagon/gen_tcg_funcs.py:357:
+            f.write("        ctx_log_reg_write(ctx, %s%sN + HEX_REG_SA0 + 1);\n" % \

WARNING: line over 80 characters
#1361: FILE: target/hexagon/gen_tcg_funcs.py:360:
+            f.write("        gen_log_reg_write_pair(%s%sN + HEX_REG_SA0, %s%sV);\n" % \

WARNING: line over 80 characters
#1365: FILE: target/hexagon/gen_tcg_funcs.py:364:
+            f.write("        ctx_log_reg_write(ctx, %s%sN + HEX_REG_SA0 + 1);\n" % \

WARNING: line over 80 characters
#1374: FILE: target/hexagon/gen_tcg_funcs.py:373:
+            f.write("        gen_log_reg_write(%s%sN + HEX_REG_SA0, %s%sV);\n" % \

total: 0 errors, 14 warnings, 1676 lines checked

Patch 18/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
19/29 Checking commit e10510a91bcd (Hexagon (target/hexagon) generator phase 3 - C preprocessor for decode tree)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#15: 
new file mode 100644

ERROR: Macros with complex values should be enclosed in parenthesis
#76: FILE: target/hexagon/gen_dectree_import.c:57:
+#define REGINFO(TAG, REGINFO, RREGS, WREGS) RREGS,

ERROR: Macros with complex values should be enclosed in parenthesis
#85: FILE: target/hexagon/gen_dectree_import.c:66:
+#define REGINFO(TAG, REGINFO, RREGS, WREGS) WREGS,

ERROR: suspicious ; after while (0)
#182: FILE: target/hexagon/gen_dectree_import.c:163:
+    } while (0);

total: 3 errors, 1 warnings, 191 lines checked

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

20/29 Checking commit 0a72ce4c7218 (Hexagon (target/hexagon) generater phase 4 - decode tree)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#13: 
new file mode 100755

total: 0 errors, 1 warnings, 352 lines checked

Patch 20/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
21/29 Checking commit 09a6ee0edd8d (Hexagon (target/hexagon) opcode data structures)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#11: 
new file mode 100644

ERROR: Macros with complex values should be enclosed in parenthesis
#56: FILE: target/hexagon/opcodes.c:41:
+#define REGINFO(TAG, REGINFO, RREGS, WREGS) REGINFO,

ERROR: Macros with complex values should be enclosed in parenthesis
#66: FILE: target/hexagon/opcodes.c:51:
+#define REGINFO(TAG, REGINFO, RREGS, WREGS) RREGS,

ERROR: Macros with complex values should be enclosed in parenthesis
#76: FILE: target/hexagon/opcodes.c:61:
+#define REGINFO(TAG, REGINFO, RREGS, WREGS) WREGS,

ERROR: Macros with complex values should be enclosed in parenthesis
#84: FILE: target/hexagon/opcodes.c:69:
+#define DEF_SHORTCODE(TAG, SHORTCODE)              [TAG] = #SHORTCODE,

ERROR: Macros with complex values should be enclosed in parenthesis
#180: FILE: target/hexagon/opcodes.c:165:
+#define ATTRIBS(...) , ## __VA_ARGS__, 0

total: 5 errors, 1 warnings, 265 lines checked

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

22/29 Checking commit 6447bfd79ac7 (Hexagon (target/hexagon) macros)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#14: 
new file mode 100644

total: 0 errors, 1 warnings, 654 lines checked

Patch 22/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
23/29 Checking commit 2667588652d9 (Hexagon (target/hexagon) instruction classes)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#13: 
new file mode 100644

ERROR: Macros with complex values should be enclosed in parenthesis
#130: FILE: target/hexagon/iclass.h:27:
+#define DEF_PP_ICLASS32(TYPE, SLOTS, UNITS)    ICLASS_FROM_TYPE(TYPE),

ERROR: Macros with complex values should be enclosed in parenthesis
#131: FILE: target/hexagon/iclass.h:28:
+#define DEF_EE_ICLASS32(TYPE, SLOTS, UNITS)    ICLASS_FROM_TYPE(TYPE),

total: 2 errors, 1 warnings, 172 lines checked

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

24/29 Checking commit 7da73c149bf2 (Hexagon (target/hexagon) TCG generation)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#13: 
new file mode 100644

total: 0 errors, 1 warnings, 259 lines checked

Patch 24/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
25/29 Checking commit 78dc36465e5d (Hexagon (target/hexagon) TCG for instructions with multiple definitions)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#14: 
new file mode 100644

total: 0 errors, 1 warnings, 198 lines checked

Patch 25/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
26/29 Checking commit 2cc688488079 (Hexagon (target/hexagon) translation)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#17: 
new file mode 100644

total: 0 errors, 1 warnings, 767 lines checked

Patch 26/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
27/29 Checking commit 6d5cc34654af (Hexagon (linux-user/hexagon) Linux user emulation)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#42: 
new file mode 100644

total: 0 errors, 1 warnings, 1089 lines checked

Patch 27/29 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
28/29 Checking commit 010f970dbd94 (Hexagon (tests/tcg/hexagon) TCG tests)
ERROR: line over 90 characters
#32: FILE: tests/tcg/configure.sh:99:
+    alpha|cris|hexagon|hppa|i386|lm32|microblaze|microblazeel|m68k|openrisc|riscv64|s390x|sh4|sparc64)

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

total: 1 errors, 1 warnings, 2728 lines checked

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

29/29 Checking commit 07b76543a655 (Hexagon build infrastructure)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#39: 
new file mode 100644

WARNING: line over 80 characters
#74: FILE: scripts/qemu-binfmt-conf.sh:139:
+hexagon_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xa4\x00'

ERROR: line over 90 characters
#75: FILE: scripts/qemu-binfmt-conf.sh:140:
+hexagon_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'

total: 1 errors, 2 warnings, 223 lines checked

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

=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/1601314138-9930-1-git-send-email-tsimpson@quicinc.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
no-reply@patchew.org Sept. 29, 2020, 1:21 a.m. UTC | #2
Patchew URL: https://patchew.org/QEMU/1601314138-9930-1-git-send-email-tsimpson@quicinc.com/



Hi,

This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===

Host machine cpu: x86_64
Target machine cpu family: x86
Target machine cpu: x86_64
../src/meson.build:10: WARNING: Module unstable-keyval has no backwards or forwards compatibility and might not exist in future releases.
Program sh found: YES
Program python3 found: YES (/usr/bin/python3)
Configuring ninjatool using configuration
---
FileNotFoundError: [Errno 2] No such file or directory: '@INPUT@'
Compiling C object tests/libtestqapi.a.p/meson-generated_.._test-qapi-introspect.c.obj
Compiling C object tests/libtestqapi.a.p/meson-generated_.._test-qapi-types-sub-sub-module.c.obj
make: *** [Makefile.ninja:785: target/hexagon/semantics_generated.pyinc.stamp] Error 1
make: *** Waiting for unfinished jobs....
Running Sphinx v2.2.2
Running Sphinx v2.2.2
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--rm', '--label', 'com.qemu.instance.uuid=f3436adee502475b808e3143e318eadc', '-u', '1001', '--security-opt', 'seccomp=unconfined', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-pqn71064/src/docker-src.2020-09-28-21.13.22.10231:/var/tmp/qemu:z,ro', 'qemu/fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=f3436adee502475b808e3143e318eadc
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-pqn71064/src'
make: *** [docker-run-test-mingw@fedora] Error 2

real    7m38.875s
user    0m20.964s


The full log is available at
http://patchew.org/logs/1601314138-9930-1-git-send-email-tsimpson@quicinc.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Philippe Mathieu-Daudé Sept. 29, 2020, 12:22 p.m. UTC | #3
Hi Taylor,

On 9/28/20 7:28 PM, Taylor Simpson wrote:
> This series adds support for the Hexagon processor with Linux user support
> 
> See patch 02/34 Hexagon README for detailed information.
> 
> Once the series is applied, the Hexagon port will pass "make check-tcg".
> The series also includes Hexagon-specific tests in tcg/tests/hexagon.
> 
> The series is also available at https://github.com/quic/qemu on branch
> small_series_v4.
> 
> We have a parallel effort to make the Hexagon Linux toolchain publically
> available.
> 
> *** Known checkpatch issues ***
> 
> The following are known checkpatch errors in the series
>     target/hexagon/reg_fields.h         Complex macro
>     target/hexagon/attribs.h            Complex macro
>     target/hexagon/decode.c             Complex macro
>     target/hexagon/q6v_decode.c         Macro needs do - while
>     target/hexagon/printinsn.c          Macro needs do - while
>     target/hexagon/gen_semantics.c      Suspicious ; after while (0)
>     target/hexagon/gen_dectree_import.c Complex macro
>     target/hexagon/gen_dectree_import.c Suspicious ; after while (0)
>     target/hexagon/opcodes.c            Complex macro
>     target/hexagon/iclass.h             Complex macro
>     configure.sh                        Line over 90 characters
>     scripts/qemu-binfmt-conf.sh         Line over 90 characters
> 
> The following are known checkpatch warnings in the series
>     target/hexagon/fma_emu.c            Comments inside macro definition
>     target/hexagon/gen_tcg_funcs.py     Line over 80 characters
>     scripts/qemu-binfmt-conf.sh         Line over 80 characters

Using '../configure' '--target-list=hexagon-linux-user' '--disable-docs'
'--disable-tools' on Fedora 32 I am getting:

In file included from target/hexagon/op_helper.c:24:
target/hexagon/helper_funcs_generated.h: In function ‘helper_S2_vspliceib’:
target/hexagon/helper_funcs_generated.h:9669:50: error: ‘*’ in boolean
context, suggest ‘&&’ instead [-Werror=int-in-bool-context]
 9669 |     { RddV = fASHIFTL(RttV,uiV*8,8_8) | fZXTN(uiV*8,64,RssV); }
target/hexagon/macros.h:234:28: note: in definition of macro ‘fZXTN’
  234 | #define fZXTN(N, M, VAL) ((N) ? extract64((VAL), 0, (N)) : 0LL)
      |                            ^
target/hexagon/helper_funcs_generated.h: In function ‘helper_S2_vsplicerb’:
target/hexagon/helper_funcs_generated.h:9677:58: error: ‘*’ in boolean
context, suggest ‘&&’ instead [-Werror=int-in-bool-context]
 9677 |     { RddV = fASHIFTL(RttV,(PuV&7)*8,8_8) |
fZXTN((PuV&7)*8,64,RssV); }
target/hexagon/macros.h:234:28: note: in definition of macro ‘fZXTN’
  234 | #define fZXTN(N, M, VAL) ((N) ? extract64((VAL), 0, (N)) : 0LL)
      |                            ^
cc1: all warnings being treated as errors
make: *** [Makefile.ninja:633:
libqemu-hexagon-linux-user.fa.p/target_hexagon_op_helper.c.o] Error 1

target/hexagon/decode.c:45:31: error: ‘DECODE_REGISTER_V__16’ defined
but not used [-Werror=unused-const-variable=]
   45 |     static const unsigned int DECODE_REGISTER_##NAME[ELEMENTS] = \
      |                               ^~~~~~~~~~~~~~~~
target/hexagon/decode.c:55:1: note: in expansion of macro ‘DEF_REGMAP’
   55 | DEF_REGMAP(V__16, 16, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22,
24, 26, 28, 30)
      | ^~~~~~~~~~
target/hexagon/decode.c:45:31: error: ‘DECODE_REGISTER_V__8’ defined but
not used [-Werror=unused-const-variable=]
   45 |     static const unsigned int DECODE_REGISTER_##NAME[ELEMENTS] = \
      |                               ^~~~~~~~~~~~~~~~
target/hexagon/decode.c:54:1: note: in expansion of macro ‘DEF_REGMAP’
   54 | DEF_REGMAP(V__8,  8,  0, 4, 8, 12, 16, 20, 24, 28)
      | ^~~~~~~~~~
target/hexagon/decode.c:45:31: error: ‘DECODE_REGISTER_R_8’ defined but
not used [-Werror=unused-const-variable=]
   45 |     static const unsigned int DECODE_REGISTER_##NAME[ELEMENTS] = \
      |                               ^~~~~~~~~~~~~~~~
target/hexagon/decode.c:53:1: note: in expansion of macro ‘DEF_REGMAP’
   53 | DEF_REGMAP(R_8,   8,  0, 1, 2, 3, 4, 5, 6, 7)
      | ^~~~~~~~~~
target/hexagon/decode.c:45:31: error: ‘DECODE_REGISTER_R_8S’ defined but
not used [-Werror=unused-const-variable=]
   45 |     static const unsigned int DECODE_REGISTER_##NAME[ELEMENTS] = \
      |                               ^~~~~~~~~~~~~~~~
target/hexagon/decode.c:52:1: note: in expansion of macro ‘DEF_REGMAP’
   52 | DEF_REGMAP(R_8S,  8,  0, 1, 2, 3, 16, 17, 18, 19)
      | ^~~~~~~~~~
target/hexagon/decode.c:45:31: error: ‘DECODE_REGISTER_R_4’ defined but
not used [-Werror=unused-const-variable=]
   45 |     static const unsigned int DECODE_REGISTER_##NAME[ELEMENTS] = \
      |                               ^~~~~~~~~~~~~~~~
target/hexagon/decode.c:51:1: note: in expansion of macro ‘DEF_REGMAP’
   51 | DEF_REGMAP(R_4,   4,  0, 1, 2, 3)
      | ^~~~~~~~~~
target/hexagon/decode.c:45:31: error: ‘DECODE_REGISTER_R__4’ defined but
not used [-Werror=unused-const-variable=]
   45 |     static const unsigned int DECODE_REGISTER_##NAME[ELEMENTS] = \
      |                               ^~~~~~~~~~~~~~~~
target/hexagon/decode.c:50:1: note: in expansion of macro ‘DEF_REGMAP’
   50 | DEF_REGMAP(R__4,  4,  0, 2, 4, 6)
      | ^~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile.ninja:638:
libqemu-hexagon-linux-user.fa.p/target_hexagon_decode.c.o] Error 1

$ gcc --version
gcc (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1)

Regards,

Phil.
Taylor Simpson Sept. 29, 2020, 3:53 p.m. UTC | #4
> -----Original Message-----
> From: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> On
> Behalf Of Philippe Mathieu-Daudé
> Sent: Tuesday, September 29, 2020 6:22 AM
> To: Taylor Simpson <tsimpson@quicinc.com>; qemu-devel@nongnu.org
> Cc: ale@rev.ng; riku.voipio@iki.fi; richard.henderson@linaro.org;
> laurent@vivier.eu; aleksandar.m.mail@gmail.com
> Subject: Re: [RFC PATCH v4 00/29] Hexagon patch series
>
> cc1: all warnings being treated as errors
> make: *** [Makefile.ninja:638:
> libqemu-hexagon-linux-user.fa.p/target_hexagon_decode.c.o] Error 1
>
> $ gcc --version
> gcc (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1)
>

Thanks for all your feedback.  I really appreciate it and will make the changes you mentioned.

I'm using an older GCC that doesn't have these errors.  Is this the version of GCC that is recommended (mandated?) for building qemu?


PS  You were right about Richard recommending const.  It's already on my TODO list from his review 😉

Thanks,
Taylor
Philippe Mathieu-Daudé Sept. 29, 2020, 5:01 p.m. UTC | #5
On 9/29/20 5:53 PM, Taylor Simpson wrote:
>> -----Original Message-----
>> From: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> On
>> Behalf Of Philippe Mathieu-Daudé
>> Sent: Tuesday, September 29, 2020 6:22 AM
>> To: Taylor Simpson <tsimpson@quicinc.com>; qemu-devel@nongnu.org
>> Cc: ale@rev.ng; riku.voipio@iki.fi; richard.henderson@linaro.org;
>> laurent@vivier.eu; aleksandar.m.mail@gmail.com
>> Subject: Re: [RFC PATCH v4 00/29] Hexagon patch series
>>
>> cc1: all warnings being treated as errors
>> make: *** [Makefile.ninja:638:
>> libqemu-hexagon-linux-user.fa.p/target_hexagon_decode.c.o] Error 1
>>
>> $ gcc --version
>> gcc (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1)
>>
> 
> Thanks for all your feedback.  I really appreciate it and will make the changes you mentioned.

No problem, I also appreciate the effort you did to address all
of the previous issues :)

> 
> I'm using an older GCC that doesn't have these errors.  Is this the version of GCC that is recommended (mandated?) for building qemu?

QEMU aims to support the 2 latest releases of supported distributions.
From time to time a brave developer look at the different versions
packaged and make some cleanup in the code base. It used to be tedious,
now that repology.org exists it is a bit easier.

The last effort is from Thomas, see commit efc6c070aca:

    The supported distributions use the following version
    of GCC:

          RHEL-7: 4.8.5
          Debian (Stretch): 6.3.0
          Debian (Jessie): 4.8.4
          OpenBSD (ports): 4.9.4
          FreeBSD (ports): 8.2.0
          OpenSUSE Leap 15: 7.3.1
          Ubuntu (Xenial): 5.3.1
          macOS (Homebrew): 8.2.0

    So we can safely assume GCC 4.8 these days.

This is the "mandated" compiler version.


QEMU has some CI jobs, see:
https://wiki.qemu.org/Testing/CI

You can use most of them by opening GitLab and Travis/Cirrus
(for GitHub, which you already use).

GitLab will become our "gating CI" soon, so your series is
expected to pass all the GitLab jobs. IIRC running the tests
is as easy as register and push your branch to your account.

> 
> PS  You were right about Richard recommending const.  It's already on my TODO list from his review 😉
> 

=)

Regards,

Phil.

> Thanks,
> Taylor
>
Taylor Simpson Sept. 29, 2020, 8:11 p.m. UTC | #6
> -----Original Message-----
> From: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> On
> Behalf Of Philippe Mathieu-Daudé
> Sent: Tuesday, September 29, 2020 11:02 AM
> To: Taylor Simpson <tsimpson@quicinc.com>; qemu-devel@nongnu.org
> Cc: ale@rev.ng; riku.voipio@iki.fi; richard.henderson@linaro.org;
> laurent@vivier.eu; aleksandar.m.mail@gmail.com
> Subject: Re: [RFC PATCH v4 00/29] Hexagon patch series
>
> QEMU aims to support the 2 latest releases of supported distributions.
> From time to time a brave developer look at the different versions
> packaged and make some cleanup in the code base. It used to be tedious,
> now that repology.org exists it is a bit easier.
>
> The last effort is from Thomas, see commit efc6c070aca:
>
>     The supported distributions use the following version
>     of GCC:
>
>           RHEL-7: 4.8.5
>           Debian (Stretch): 6.3.0
>           Debian (Jessie): 4.8.4
>           OpenBSD (ports): 4.9.4
>           FreeBSD (ports): 8.2.0
>           OpenSUSE Leap 15: 7.3.1
>           Ubuntu (Xenial): 5.3.1
>           macOS (Homebrew): 8.2.0
>
>     So we can safely assume GCC 4.8 these days.
>
> This is the "mandated" compiler version.

Ouch!  4.8 is old enough that it doesn't support C11 _Generic which I am using.  That needs at least GCC 4.9.

Here are a couple of examples.  As you can see, _Generic is used to dispatch to slightly different TCG generation functions depending on the type of the operands.  I will scratch my head and figure out a different way to do this.

#define MEM_STORE1_FUNC(X) \
    _Generic((X), int : gen_store1i, TCGv_i32 : gen_store1)
#define MEM_STORE1(VA, DATA, SLOT) \
    MEM_STORE1_FUNC(DATA)(cpu_env, VA, DATA, ctx, SLOT)

#define GETBYTE_FUNC(X) \
    _Generic((X), TCGv_i32 : gen_get_byte, TCGv_i64 : gen_get_byte_i64)
#define fGETBYTE(N, SRC) GETBYTE_FUNC(SRC)(BYTE, N, SRC, true)
#define fGETUBYTE(N, SRC) GETBYTE_FUNC(SRC)(BYTE, N, SRC, false)


FWIW, I have been using 5.5.

The errors you saw started around 7.5 and are easy to fix.


Taylor
Philippe Mathieu-Daudé Sept. 29, 2020, 8:41 p.m. UTC | #7
Cc'ing Eric/Thomas...

On 9/29/20 10:11 PM, Taylor Simpson wrote:
>> -----Original Message-----
>> From: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> On
>> Behalf Of Philippe Mathieu-Daudé
>> Sent: Tuesday, September 29, 2020 11:02 AM
>> To: Taylor Simpson <tsimpson@quicinc.com>; qemu-devel@nongnu.org
>> Cc: ale@rev.ng; riku.voipio@iki.fi; richard.henderson@linaro.org;
>> laurent@vivier.eu; aleksandar.m.mail@gmail.com
>> Subject: Re: [RFC PATCH v4 00/29] Hexagon patch series
>>
>> QEMU aims to support the 2 latest releases of supported distributions.
>> From time to time a brave developer look at the different versions
>> packaged and make some cleanup in the code base. It used to be tedious,
>> now that repology.org exists it is a bit easier.
>>
>> The last effort is from Thomas, see commit efc6c070aca:
>>
>>     The supported distributions use the following version
>>     of GCC:
>>
>>           RHEL-7: 4.8.5
>>           Debian (Stretch): 6.3.0
>>           Debian (Jessie): 4.8.4
>>           OpenBSD (ports): 4.9.4
>>           FreeBSD (ports): 8.2.0
>>           OpenSUSE Leap 15: 7.3.1
>>           Ubuntu (Xenial): 5.3.1
>>           macOS (Homebrew): 8.2.0
>>
>>     So we can safely assume GCC 4.8 these days.
>>
>> This is the "mandated" compiler version.
> 
> Ouch!  4.8 is old enough that it doesn't support C11 _Generic which I am using.  That needs at least GCC 4.9.
> 
> Here are a couple of examples.  As you can see, _Generic is used to dispatch to slightly different TCG generation functions depending on the type of the operands.  I will scratch my head and figure out a different way to do this.
> 
> #define MEM_STORE1_FUNC(X) \
>     _Generic((X), int : gen_store1i, TCGv_i32 : gen_store1)
> #define MEM_STORE1(VA, DATA, SLOT) \
>     MEM_STORE1_FUNC(DATA)(cpu_env, VA, DATA, ctx, SLOT)
> 
> #define GETBYTE_FUNC(X) \
>     _Generic((X), TCGv_i32 : gen_get_byte, TCGv_i64 : gen_get_byte_i64)
> #define fGETBYTE(N, SRC) GETBYTE_FUNC(SRC)(BYTE, N, SRC, true)
> #define fGETUBYTE(N, SRC) GETBYTE_FUNC(SRC)(BYTE, N, SRC, false)
> 
> 
> FWIW, I have been using 5.5.
> 
> The errors you saw started around 7.5 and are easy to fix.
> 
> 
> Taylor
>
Eric Blake Sept. 29, 2020, 9:28 p.m. UTC | #8
On 9/29/20 3:11 PM, Taylor Simpson wrote:

> Ouch!  4.8 is old enough that it doesn't support C11 _Generic which I am using.  That needs at least GCC 4.9.
> 
> Here are a couple of examples.  As you can see, _Generic is used to dispatch to slightly different TCG generation functions depending on the type of the operands.  I will scratch my head and figure out a different way to do this.
> 
> #define MEM_STORE1_FUNC(X) \
>     _Generic((X), int : gen_store1i, TCGv_i32 : gen_store1)
> #define MEM_STORE1(VA, DATA, SLOT) \
>     MEM_STORE1_FUNC(DATA)(cpu_env, VA, DATA, ctx, SLOT)

See if you can use __builtin_choose_expr() instead.  Look at
include/osdep/atomic.h which defines typeof_strip_qual() without
_Generic.  linux-user/qemu.h __put_user_e() is also an example of what
appears to be a poor-man's replacement to _Generic.
Taylor Simpson Sept. 29, 2020, 10:16 p.m. UTC | #9
> -----Original Message-----
> From: Eric Blake <eblake@redhat.com>
> Sent: Tuesday, September 29, 2020 3:29 PM
> To: Taylor Simpson <tsimpson@quicinc.com>; Philippe Mathieu-Daudé
> <f4bug@amsat.org>; qemu-devel@nongnu.org
> Cc: ale@rev.ng; riku.voipio@iki.fi; richard.henderson@linaro.org;
> laurent@vivier.eu; aleksandar.m.mail@gmail.com
> Subject: Re: [RFC PATCH v4 00/29] Hexagon patch series
>
> On 9/29/20 3:11 PM, Taylor Simpson wrote:
>
> > Ouch!  4.8 is old enough that it doesn't support C11 _Generic which I am
> using.  That needs at least GCC 4.9.
> >
> > Here are a couple of examples.  As you can see, _Generic is used to
> dispatch to slightly different TCG generation functions depending on the
> type of the operands.  I will scratch my head and figure out a different way to
> do this.
> >
> > #define MEM_STORE1_FUNC(X) \
> >     _Generic((X), int : gen_store1i, TCGv_i32 : gen_store1)
> > #define MEM_STORE1(VA, DATA, SLOT) \
> >     MEM_STORE1_FUNC(DATA)(cpu_env, VA, DATA, ctx, SLOT)
>
> See if you can use __builtin_choose_expr() instead.  Look at
> include/osdep/atomic.h which defines typeof_strip_qual() without
> _Generic.  linux-user/qemu.h __put_user_e() is also an example of what
> appears to be a poor-man's replacement to _Generic.

Thanks!  It's a pretty straightforward translation for my use cases

#define MEM_STORE1_FUNC(X) \
    __builtin_choose_expr(__builtin_types_compatible_p(typeof(X), int), \
        gen_store1i, \
        gen_store1)
#define MEM_STORE1(VA, DATA, SLOT) \
    MEM_STORE1_FUNC(DATA)(cpu_env, VA, DATA, ctx, SLOT)


Taylor
Brad Smith Sept. 30, 2020, 4:08 a.m. UTC | #10
On 9/29/2020 1:01 PM, Philippe Mathieu-Daudé wrote:
> On 9/29/20 5:53 PM, Taylor Simpson wrote:
>>> -----Original Message-----
>>> From: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> On
>>> Behalf Of Philippe Mathieu-Daudé
>>> Sent: Tuesday, September 29, 2020 6:22 AM
>>> To: Taylor Simpson <tsimpson@quicinc.com>; qemu-devel@nongnu.org
>>> Cc: ale@rev.ng; riku.voipio@iki.fi; richard.henderson@linaro.org;
>>> laurent@vivier.eu; aleksandar.m.mail@gmail.com
>>> Subject: Re: [RFC PATCH v4 00/29] Hexagon patch series
>>>
>>> cc1: all warnings being treated as errors
>>> make: *** [Makefile.ninja:638:
>>> libqemu-hexagon-linux-user.fa.p/target_hexagon_decode.c.o] Error 1
>>>
>>> $ gcc --version
>>> gcc (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1)
>>>
>> Thanks for all your feedback.  I really appreciate it and will make the changes you mentioned.
> No problem, I also appreciate the effort you did to address all
> of the previous issues :)
>
>> I'm using an older GCC that doesn't have these errors.  Is this the version of GCC that is recommended (mandated?) for building qemu?
> QEMU aims to support the 2 latest releases of supported distributions.
>  From time to time a brave developer look at the different versions
> packaged and make some cleanup in the code base. It used to be tedious,
> now that repology.org exists it is a bit easier.
>
> The last effort is from Thomas, see commit efc6c070aca:
>
>      The supported distributions use the following version
>      of GCC:
>
>            RHEL-7: 4.8.5
>            Debian (Stretch): 6.3.0
>            Debian (Jessie): 4.8.4
>            OpenBSD (ports): 4.9.4

OpenBSD as of 6.6 uses GCC 8.3.0 for our ports-gcc.

>            FreeBSD (ports): 8.2.0
>            OpenSUSE Leap 15: 7.3.1
>            Ubuntu (Xenial): 5.3.1
>            macOS (Homebrew): 8.2.0
>
>      So we can safely assume GCC 4.8 these days.
FreeBSD and OpenBSD nowadays use Clang for the (system) compiler.
>
> This is the "mandated" compiler version.
>
>
> QEMU has some CI jobs, see:
> https://wiki.qemu.org/Testing/CI
>
> You can use most of them by opening GitLab and Travis/Cirrus
> (for GitHub, which you already use).
>
> GitLab will become our "gating CI" soon, so your series is
> expected to pass all the GitLab jobs. IIRC running the tests
> is as easy as register and push your branch to your account.
>
>> PS  You were right about Richard recommending const.  It's already on my TODO list from his review 😉
>>
> =)
>
> Regards,
>
> Phil.
>
>> Thanks,
>> Taylor
>>
Richard Henderson Oct. 2, 2020, 5:16 p.m. UTC | #11
On 9/28/20 12:28 PM, Taylor Simpson wrote:
> This series adds support for the Hexagon processor with Linux user support
> 
> See patch 02/34 Hexagon README for detailed information.
> 
> Once the series is applied, the Hexagon port will pass "make check-tcg".
> The series also includes Hexagon-specific tests in tcg/tests/hexagon.
> 
> The series is also available at https://github.com/quic/qemu on branch
> small_series_v4.

BTW, some whitespace warnings when applying this series.


r~


> Applying: Hexagon Update MAINTAINERS file
> Applying: Hexagon (target/hexagon) README
> .git/rebase-apply/patch:247: new blank line at EOF.
> +
> warning: 1 line adds whitespace errors.
> Applying: Hexagon (include/elf.h) ELF machine definition
> Applying: Hexagon (target/hexagon) scalar core definition
> Applying: Hexagon (disas) disassembler
> .git/rebase-apply/patch:87: new blank line at EOF.
> +
> warning: 1 line adds whitespace errors.
> Applying: Hexagon (target/hexagon) register names
> Applying: Hexagon (target/hexagon) scalar core helpers
> .git/rebase-apply/patch:431: new blank line at EOF.
> +
> warning: 1 line adds whitespace errors.
> Applying: Hexagon (target/hexagon) GDB Stub
> Applying: Hexagon (target/hexagon) architecture types
> Applying: Hexagon (target/hexagon) instruction and packet types
> Applying: Hexagon (target/hexagon) register fields
> .git/rebase-apply/patch:132: new blank line at EOF.
> +
> warning: 1 line adds whitespace errors.
> Applying: Hexagon (target/hexagon) instruction attributes
> .git/rebase-apply/patch:149: new blank line at EOF.
> +
> warning: 1 line adds whitespace errors.
> Applying: Hexagon (target/hexagon) instruction/packet decode
> Applying: Hexagon (target/hexagon) instruction printing
> .git/rebase-apply/patch:136: new blank line at EOF.
> +
> warning: 1 line adds whitespace errors.
> Applying: Hexagon (target/hexagon) utility functions
> .git/rebase-apply/patch:512: new blank line at EOF.
> +
> .git/rebase-apply/patch:887: new blank line at EOF.
> +
> .git/rebase-apply/patch:1670: new blank line at EOF.
> +
> warning: 3 lines add whitespace errors.
> Applying: Hexagon (target/hexagon/imported) arch import
> .git/rebase-apply/patch:598: space before tab in indent.
> 	  		fSETBYTE(i,RdV,fSATUB(fGETHALF(i,RssV)+fGETHALF(i,RttV)));
> .git/rebase-apply/patch:1329: space before tab in indent.
>  	 		 RdV = RsV;
> .git/rebase-apply/patch:6793: space before tab in indent.
>    	sys_icinva(thread, (REG),insn->slot);
> .git/rebase-apply/patch:7280: space before tab in indent.
>          		   fMPY16SS(fGETBYTE(1,RssV),fGETUBYTE(1,RttV)))));
> .git/rebase-apply/patch:7282: space before tab in indent.
>          		   fMPY16SS(fGETBYTE(3,RssV),fGETUBYTE(3,RttV)))));
> warning: squelched 41 whitespace errors
> warning: 46 lines add whitespace errors.
> Applying: Hexagon (target/hexagon) generator phase 1 - C preprocessor for semantics
> Applying: Hexagon (target/hexagon) generator phase 2 - generate header files
> Applying: Hexagon (target/hexagon) generator phase 3 - C preprocessor for decode tree
> Applying: Hexagon (target/hexagon) generater phase 4 - decode tree
> Applying: Hexagon (target/hexagon) opcode data structures
> Applying: Hexagon (target/hexagon) macros
> Applying: Hexagon (target/hexagon) instruction classes
> .git/rebase-apply/patch:141: new blank line at EOF.
> +
> .git/rebase-apply/patch:199: new blank line at EOF.
> +
> warning: 2 lines add whitespace errors.
> Applying: Hexagon (target/hexagon) TCG generation
> Applying: Hexagon (target/hexagon) TCG for instructions with multiple definitions
> Applying: Hexagon (target/hexagon) translation
> Applying: Hexagon (linux-user/hexagon) Linux user emulation
> .git/rebase-apply/patch:405: new blank line at EOF.
> +
> warning: 1 line adds whitespace errors.
> Applying: Hexagon (tests/tcg/hexagon) TCG tests
> .git/rebase-apply/patch:1314: new blank line at EOF.
> +
> warning: 1 line adds whitespace errors.
> Applying: Hexagon build infrastructure