From patchwork Fri Jun 30 02:16:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chenghui Pan X-Patchwork-Id: 1801636 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=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from 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 4Qsf8x6QqNz20ZC for ; Fri, 30 Jun 2023 12:17:20 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 35CAF3858022 for ; Fri, 30 Jun 2023 02:17:18 +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 BF0613858D37 for ; Fri, 30 Jun 2023 02:17:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BF0613858D37 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.10]) by gateway (Coremail) with SMTP id _____8AxBsUdO55kCh4EAA--.6723S3; Fri, 30 Jun 2023 10:17:02 +0800 (CST) Received: from loongson-pc.loongson.cn (unknown [10.20.4.10]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxfSMTO55kbnsSAA--.14825S4; Fri, 30 Jun 2023 10:16: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 v1 0/6] Add Loongson SX/ASX instruction support to LoongArch target. Date: Fri, 30 Jun 2023 10:16:08 +0800 Message-Id: <20230630021614.57201-1-panchenghui@loongson.cn> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxfSMTO55kbnsSAA--.14825S4 X-CM-SenderInfo: psdquxxhqjx33l6o00pqjv00gofq/1tbiAQASBGSdBKsWmgAHsK X-Coremail-Antispam: 1Uk129KBj93XoW7ur1rWw1DZFyrKrWkKry5KFX_yoW8tFy8pr 9xuw13AF48JrsFgrnxJ3sxWwn8JryxKw12va13try8CrW7Wr1UZF18Jr9rZF1UWw45JryI vr1rKa1j9a1UA3cCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUk2b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r126r13M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAF wI0_Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI 0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUXVWUAwAv7VC2z280 aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28Icx kI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2Iq xVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42 IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY 6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aV CY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjxU7cdbUUUUU X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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" These patches add the Loongson SX/ASX instruction support to the LoongArch target, and can be utilized by using the new "-mlsx" and "-mlasx" option. Patches are bootstrapped and tested on loongarch64-linux-gnu target. Lulu Cheng (6): LoongArch: Added Loongson SX vector directive compilation framework. LoongArch: Added Loongson SX base instruction support. LoongArch: Added Loongson SX directive builtin function support. LoongArch: Added Loongson ASX vector directive compilation framework. LoongArch: Added Loongson ASX base instruction support. LoongArch: Added Loongson ASX directive builtin function support. gcc/config.gcc | 2 +- gcc/config/loongarch/constraints.md | 128 +- .../loongarch/genopts/loongarch-strings | 4 + gcc/config/loongarch/genopts/loongarch.opt.in | 16 +- gcc/config/loongarch/lasx.md | 5147 ++++++++++++++++ gcc/config/loongarch/lasxintrin.h | 5342 +++++++++++++++++ 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 | 4615 +++++++++++++- gcc/config/loongarch/loongarch.h | 117 +- gcc/config/loongarch/loongarch.md | 56 +- gcc/config/loongarch/loongarch.opt | 16 +- gcc/config/loongarch/lsx.md | 4490 ++++++++++++++ gcc/config/loongarch/lsxintrin.h | 5181 ++++++++++++++++ gcc/config/loongarch/predicates.md | 333 +- 25 files changed, 28723 insertions(+), 290 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