From patchwork Tue Aug 15 01:05:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chenghui Pan X-Patchwork-Id: 1821227 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RPtPy0CCVz1yfZ for ; Tue, 15 Aug 2023 11:06:28 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 52D9B3856DF4 for ; Tue, 15 Aug 2023 01:06:26 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id EDEC53858422 for ; Tue, 15 Aug 2023 01:06:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EDEC53858422 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [10.20.4.45]) by gateway (Coremail) with SMTP id _____8Bx5fB7z9pkfJIYAA--.50734S3; Tue, 15 Aug 2023 09:06:03 +0800 (CST) Received: from loongson-pc.loongson.cn (unknown [10.20.4.45]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxJ810z9pkkcRaAA--.24936S4; Tue, 15 Aug 2023 09:05:58 +0800 (CST) From: Chenghui Pan To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, chenglulu@loongson.cn, xuchenghua@loongson.cn, Chenghui Pan Subject: [PATCH v4 0/6] Add Loongson SX/ASX instruction support to LoongArch target. Date: Tue, 15 Aug 2023 09:05:31 +0800 Message-Id: <20230815010537.1817292-1-panchenghui@loongson.cn> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxJ810z9pkkcRaAA--.24936S4 X-CM-SenderInfo: psdquxxhqjx33l6o00pqjv00gofq/1tbiAQADBGTZqbIDDwAEso X-Coremail-Antispam: 1Uk129KBj93XoWxAr1xJryxGFW5uw1DWF1xWFX_yoW5tr4kpr 9xuwnxAF48Jrs2qrsxJ343Wws8JFyxKw12va13tr18CrW7Wr1jvFy8Gr9rZF1DWw45JryI vr1rKw4j9a1jy3cCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUyEb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVWUJVW8JwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ Jr0_Gr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44I27wAqx4 xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v2 6r1j6r4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwI xGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480 Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41lIxAIcVC0I7 IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k2 6cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxV AFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU8xuctUUUUU== X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This is an update of: https://gcc.gnu.org/pipermail/gcc-patches/2023-August/626194.html This version of patch set only introduces some small simplications of implementation. Because I missed the size limitation of mail size, the huge testsuite patches of v2 and v3 are not shown in the mail list. So, testsuite patches are splited from this patch set again and will be submitted independently in the future. Binutils-gdb introduced LSX/LASX support since 2.41 release: https://lists.gnu.org/archive/html/info-gnu/2023-07/msg00009.html Brief history of patch set version: v1 -> v2: - Reduce usage of "unspec" in RTL template. - Append Support of ADDR_REG_REG in LSX and LASX. - Constraint docs are appended in gcc/doc/md.texi and ccomment block. - Codes related to vecarg are removed. - Testsuite of LSX and LASX is added in v2. (Because of the size limitation of mail list, these patches are not shown) - Adjust the loongarch_expand_vector_init() function to reduce instruction output amount. - Some minor implementation changes of RTL templates. v2 -> v3: - Revert vabsd/xvabsd RTL templates to unspec impl. - Resolve warning in gcc/config/loongarch/loongarch.cc when bootstrapping with BOOT_CFLAGS="-O2 -ftree-vectorize -fno-vect-cost-model -mlasx". - Remove redundant definitions in lasxintrin.h. - Refine commit info. Lulu Cheng (6): LoongArch: Add Loongson SX vector directive compilation framework. LoongArch: Add Loongson SX base instruction support. LoongArch: Add Loongson SX directive builtin function support. LoongArch: Add Loongson ASX vector directive compilation framework. LoongArch: Add Loongson ASX base instruction support. LoongArch: Add Loongson ASX directive builtin function support. gcc/config.gcc | 2 +- gcc/config/loongarch/constraints.md | 131 +- .../loongarch/genopts/loongarch-strings | 4 + gcc/config/loongarch/genopts/loongarch.opt.in | 12 +- gcc/config/loongarch/lasx.md | 5122 ++++++++++++++++ gcc/config/loongarch/lasxintrin.h | 5338 +++++++++++++++++ gcc/config/loongarch/loongarch-builtins.cc | 2686 ++++++++- gcc/config/loongarch/loongarch-c.cc | 18 + gcc/config/loongarch/loongarch-def.c | 6 + gcc/config/loongarch/loongarch-def.h | 9 +- gcc/config/loongarch/loongarch-driver.cc | 10 + gcc/config/loongarch/loongarch-driver.h | 2 + gcc/config/loongarch/loongarch-ftypes.def | 666 +- gcc/config/loongarch/loongarch-modes.def | 39 + gcc/config/loongarch/loongarch-opts.cc | 89 +- gcc/config/loongarch/loongarch-opts.h | 3 + gcc/config/loongarch/loongarch-protos.h | 35 + gcc/config/loongarch/loongarch-str.h | 3 + gcc/config/loongarch/loongarch.cc | 4586 +++++++++++++- gcc/config/loongarch/loongarch.h | 117 +- gcc/config/loongarch/loongarch.md | 56 +- gcc/config/loongarch/loongarch.opt | 12 +- gcc/config/loongarch/lsx.md | 4481 ++++++++++++++ gcc/config/loongarch/lsxintrin.h | 5181 ++++++++++++++++ gcc/config/loongarch/predicates.md | 333 +- gcc/doc/md.texi | 11 + 26 files changed, 28668 insertions(+), 284 deletions(-) create mode 100644 gcc/config/loongarch/lasx.md create mode 100644 gcc/config/loongarch/lasxintrin.h create mode 100644 gcc/config/loongarch/lsx.md create mode 100644 gcc/config/loongarch/lsxintrin.h