From patchwork Wed Sep 20 01:15:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chenghui Pan X-Patchwork-Id: 1836923 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=patchwork.ozlabs.org) Received: from server2.sourceware.org (ip-8-43-85-97.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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Rr0x54kQ6z1yhR for ; Wed, 20 Sep 2023 11:16:41 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7B5213857725 for ; Wed, 20 Sep 2023 01:16:39 +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 B12023858D20 for ; Wed, 20 Sep 2023 01:16:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B12023858D20 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 _____8Cxh+jmRwpl6hoqAA--.45205S3; Wed, 20 Sep 2023 09:16:23 +0800 (CST) Received: from loongson-pc.loongson.cn (unknown [10.20.4.45]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Bx3y_eRwpllB4MAA--.24107S4; Wed, 20 Sep 2023 09:16:21 +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] Update check_effective_target_vect_int_mod according to LoongArch SX/ASX capabilities. Date: Wed, 20 Sep 2023 09:15:57 +0800 Message-Id: <20230920011557.106634-1-panchenghui@loongson.cn> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Bx3y_eRwpllB4MAA--.24107S4 X-CM-SenderInfo: psdquxxhqjx33l6o00pqjv00gofq/1tbiAQAABGUJBSMKywAAsO X-Coremail-Antispam: 1Uk129KBj93XoW7urWxJr4UAF13Zry7Ar1DJwc_yoW8Cw1fp3 WDur9ayFZ5KrZ7XFZrtwn0qr1rXa1xGrWUZF1xKFWxu3W5JFW0gFy8tF43AF1Yq34fWw1I va18uw15ua1DuFbCm3ZEXasCq-sJn29KB7ZKAUJUUUU5529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUUkFb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr0_Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AK xVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx 1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1Y6r17McIj6I8E87Iv 67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07UNvtZUUUUU= X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, 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.30 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 LoongArch failed to pass gcc.dg/pr104992.c with -mlsx and -mlasx. This test uses different dg-final directives depending on the vect_int_mod result, LoongArch SX/ASX supports this operations but corresponding description is not defined in target-supports.exp. This patch solves the problem above with some modification in proc check_effective_target_vect_int_mod. gcc/testsuite/ChangeLog: * lib/target-supports.exp: Update check_effective_target_vect_int_mod according to LoongArch SX/ASX capabilities. --- gcc/testsuite/lib/target-supports.exp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 2de41cef2f6..b253dc578d2 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -8586,6 +8586,8 @@ proc check_effective_target_vect_int_mod { } { return [check_cached_effective_target_indexed vect_int_mod { expr { ([istarget powerpc*-*-*] && [check_effective_target_has_arch_pwr10]) + || ([istarget loongarch*-*-*] + && [check_effective_target_loongarch_sx]) || [istarget amdgcn-*-*] }}] } @@ -12656,6 +12658,22 @@ proc check_effective_target_const_volatile_readonly_section { } { return 1 } +proc check_effective_target_loongarch_sx { } { + return [check_no_compiler_messages loongarch_lsx assembly { + #if !defined(__loongarch_sx) + #error "LSX not defined" + #endif + }] +} + +proc check_effective_target_loongarch_asx { } { + return [check_no_compiler_messages loongarch_asx assembly { + #if !defined(__loongarch_asx) + #error "LASX not defined" + #endif + }] +} + # Appends necessary Python flags to extra-tool-flags if Python.h is supported. # Otherwise, modifies dg-do-what. proc dg-require-python-h { args } {