From patchwork Tue Aug 18 15:50:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taylor Simpson X-Patchwork-Id: 276118 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4619CC433E1 for ; Tue, 18 Aug 2020 15:59:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 03BDE20888 for ; Tue, 18 Aug 2020 15:59:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="YTesKLX5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 03BDE20888 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=quicinc.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k841e-0005oL-6h for qemu-devel@archiver.kernel.org; Tue, 18 Aug 2020 11:59:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k83tH-0006cA-U2 for qemu-devel@nongnu.org; Tue, 18 Aug 2020 11:51:11 -0400 Received: from alexa-out-sd-01.qualcomm.com ([199.106.114.38]:55154) by eggs.gnu.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1k83tD-0005rj-DD for qemu-devel@nongnu.org; Tue, 18 Aug 2020 11:51:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1597765867; x=1629301867; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=jV1OhbXHp7+/ec6ukHszOKcf7pbju1k6KrLDPP5bAyQ=; b=YTesKLX51Z64eoAbRnti2xMQJDBrJgApA2jRbmYH/hQ4ScCv8DU0zz9F eLQkbZ6S9nvTNP9GkgPVNi6/fyjEWjU6hLXuXmDcqqgg1d0pabfEKepjd mEcfwtGeYb3oLMhJPShT7Je+BwTDJwKZQtpRAeJL0ubExXmETtdTUTAPK 4=; Received: from unknown (HELO ironmsg05-sd.qualcomm.com) ([10.53.140.145]) by alexa-out-sd-01.qualcomm.com with ESMTP; 18 Aug 2020 08:50:57 -0700 Received: from vu-tsimpson-aus.qualcomm.com (HELO vu-tsimpson1-aus.qualcomm.com) ([10.222.150.1]) by ironmsg05-sd.qualcomm.com with ESMTP; 18 Aug 2020 08:50:55 -0700 Received: by vu-tsimpson1-aus.qualcomm.com (Postfix, from userid 47164) id 2835E7BD; Tue, 18 Aug 2020 10:50:55 -0500 (CDT) From: Taylor Simpson To: qemu-devel@nongnu.org Subject: [RFC PATCH v3 00/34] Hexagon patch series Date: Tue, 18 Aug 2020 10:50:13 -0500 Message-Id: <1597765847-16637-1-git-send-email-tsimpson@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Received-SPF: pass client-ip=199.106.114.38; envelope-from=tsimpson@qualcomm.com; helo=alexa-out-sd-01.qualcomm.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/18 11:48:34 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ale@rev.ng, riku.voipio@iki.fi, richard.henderson@linaro.org, laurent@vivier.eu, tsimpson@quicinc.com, philmd@redhat.com, aleksandar.m.mail@gmail.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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. We have a parallel effort to make the Hexagon Linux toolchain inside a docker container publically available. *** Future items under consideration *** Use qemu softfloat Use qemu decodetree *** 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 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 scripts/qemu-binfmt-conf.sh Line over 80 characters *** 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 /tests/tcg/hexagon Rework the python scripts to generate one header file at a time Change fWRAP_* macros to fGEN_TCG_* *** Changes in v2 *** - Use scripts/git.orderfile Taylor Simpson (34): Hexagon Update MAINTAINERS file Hexagon (target/hexagon) README Hexagon (include/elf.h) ELF machine definition Hexagon (target/hexagon) scalar core definition Hexagon (target/hexagon) register names Hexagon (disas) disassembler 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) register map Hexagon (target/hexagon) instruction/packet decode Hexagon (target/hexagon) instruction printing Hexagon (target/hexagon) utility functions Hexagon (target/hexagon/imported) arch import - macro definitions Hexagon (target/hexagon/imported) arch import - instruction semantics Hexagon (target/hexagon/imported) arch import - instruction encoding 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 to interface with the generator Hexagon (target/hexagon) macros referenced in instruction semantics Hexagon (target/hexagon) instruction classes Hexagon (target/hexagon) TCG generation helpers 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 | 9 + default-configs/hexagon-linux-user.mak | 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 | 32 + linux-user/hexagon/termbits.h | 18 + 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 | 26 + target/hexagon/cpu.h | 164 +++ 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/genptr_helpers.h | 244 ++++ target/hexagon/helper.h | 35 + target/hexagon/hex_arch_types.h | 43 + target/hexagon/hex_regs.h | 83 ++ target/hexagon/iclass.h | 46 + target/hexagon/insn.h | 75 + target/hexagon/internal.h | 42 + target/hexagon/macros.h | 982 +++++++++++++ target/hexagon/opcodes.h | 66 + target/hexagon/printinsn.h | 26 + target/hexagon/reg_fields.h | 40 + target/hexagon/reg_fields_def.h | 78 + target/hexagon/regmap.h | 38 + target/hexagon/translate.h | 103 ++ disas/hexagon.c | 62 + linux-user/elfload.c | 16 + linux-user/hexagon/cpu_loop.c | 99 ++ linux-user/hexagon/signal.c | 276 ++++ linux-user/syscall.c | 2 + target/hexagon/arch.c | 354 +++++ target/hexagon/conv_emu.c | 369 +++++ target/hexagon/cpu.c | 318 +++++ target/hexagon/decode.c | 593 ++++++++ target/hexagon/fma_emu.c | 781 ++++++++++ target/hexagon/gdbstub.c | 49 + target/hexagon/gen_dectree_import.c | 191 +++ target/hexagon/gen_semantics.c | 88 ++ target/hexagon/genptr.c | 56 + target/hexagon/iclass.c | 88 ++ target/hexagon/op_helper.c | 365 +++++ target/hexagon/opcodes.c | 211 +++ target/hexagon/printinsn.c | 94 ++ target/hexagon/q6v_decode.c | 373 +++++ target/hexagon/reg_fields.c | 28 + target/hexagon/translate.c | 730 ++++++++++ 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/Makefile.objs | 1 + scripts/gensyscalls.sh | 3 +- scripts/qemu-binfmt-conf.sh | 6 +- target/hexagon/Makefile.objs | 203 +++ target/hexagon/README | 254 ++++ target/hexagon/dectree.py | 352 +++++ target/hexagon/gen_helper_funcs.py | 230 +++ 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 | 182 +++ target/hexagon/gen_shortcode.py | 71 + target/hexagon/gen_tcg_funcs.py | 301 ++++ target/hexagon/hex_common.py | 204 +++ 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 + 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 ++++++++++ 105 files changed, 22615 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/genptr_helpers.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/regmap.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 target/hexagon/Makefile.objs 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_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 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 Reviewed-by: Richard Henderson