From patchwork Wed Sep 13 03:40:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenxiaolong X-Patchwork-Id: 138622 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp839171vqx; Tue, 12 Sep 2023 21:03:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFaAXR5UvDD4m1muvYTei9os/E9gx1Jw9aPQbOARqQp7H10clY6fKs3KZQM8SjwFWdfPXAb X-Received: by 2002:a17:906:7485:b0:9a1:b144:30f4 with SMTP id e5-20020a170906748500b009a1b14430f4mr2132359ejl.14.1694577838340; Tue, 12 Sep 2023 21:03:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694577838; cv=none; d=google.com; s=arc-20160816; b=yiWFroW9U+E9+CAi6JnO6AX2f8euA1FMf/7jEq1BbNJlJWKFjvniPIGPJ4XW8FTg0U g9/pzp47wLVKR6Mn0BxdWV6yzNJx6JVYFPJwcjMIqfcuk8wQZjQ1iUrO3VJiFPY6balJ Am7LJOiZv4DMc86XWcvSYM9g9Mh7Uj4nmZFiQePEsWII+h2nCuCcPo08uvA+crK+W7VX fWHe0xyfQnNuCwqVLrzCoKztpx9Q9BasyCxVLyIHePtRwx44xCzDP/ArnSORFcnpXz/y Sgu1GaaXLfuNVqrnWKKQGxVMS5P1Px33H03JGCPGWy5DzTN176vcnFmTwEpkd/69BG2l JeaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dmarc-filter:delivered-to; bh=9ZzLPOue4LmXUvMROyMceBjgtwsx/HlvZUdRPkmP6IU=; fh=3pFUYcpS/27XRzOf17GfR86AuNQu+P1CET04YURgCLs=; b=Hyj1qdWyrjnld6xAe2wI28qT9o3xqgGOQzOnbxA/xruF7zFWOWCtUcUZtNghRpdhVH zyVfrKW3qb6/mVEQk4L7F0PQunpWM7E6ndXozRnaH1M5M9VanDNVmdmeIABH7vMUZM9F XUAmpAlRBOa2HihMwMvMbj6492OO/hNPSwxWeMJPHiU7iTo8qBt55SJjo8We8b92IO5K e/UPFs13zmrrlCgqIPfwJpnFj/eXU6ZaGgoOMh2QVgfmbLbYc3s7HKIDqlV97/9zYCCt sz1pUjliUsJuHhRL5YNYkiD3BLwhf33JskaOwlwiV5t11gMNH4ruMFYxFdtaphV3zMHq G0zw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id sa14-20020a1709076d0e00b009ad88a9b937si3156514ejc.655.2023.09.12.21.03.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 21:03:58 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A54B73848369 for ; Wed, 13 Sep 2023 03:43:04 +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 ED39738279BA for ; Wed, 13 Sep 2023 03:40:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ED39738279BA 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.10.130.252]) by gateway (Coremail) with SMTP id _____8CxtPA3LwFldDEmAA--.9519S3; Wed, 13 Sep 2023 11:40:39 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxfNwtLwFlEhECAA--.3650S7; Wed, 13 Sep 2023 11:40:38 +0800 (CST) From: Xiaolong Chen To: gcc-patches@gcc.gnu.org Cc: xry111@xry111.site, i@xen0n.name, xuchenghua@loongson.cn, chenglulu@loongson.cn, Xiaolong Chen Subject: [PATCH v4 13/22] LoongArch: Add tests for ASX xvldrepl/xvstelm instruction generation. Date: Wed, 13 Sep 2023 11:40:20 +0800 Message-Id: <20230913034026.7751-4-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230913034026.7751-1-chenxiaolong@loongson.cn> References: <20230913034026.7751-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8CxfNwtLwFlEhECAA--.3650S7 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQANBWUBHCIBQgAAsQ X-Coremail-Antispam: 1Uk129KBj93XoW7Cr4fKFy7ur1rtrykuw48uFX_yoW8Ww4Dpw 47CrnxtF48XFZ7Grn7Ga45XF4YvFZ7GFW3u3y3A342kr4UX3sFq3Wktr42yFyDJayYyr1x Xrsxuw1jgF42qwbCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU 0xBIdaVrnRJUUU92b4IE77IF4wAFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2 IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48v e4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI 0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E 14v26r4UJVWxJr1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44 I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_ZF0_GryDMcIj6I8E 87Iv67AKxVW8Jr0_Cr1UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwACjc xG6xCI17CEII8vrVW3JVW8Jr1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_ Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17 CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_tr0E3s1lIxAIcVC0 I7IYx2IY6xkF7I0E14v26r4UJVWxJr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0x vEx4A2jsIE14v26r4UJVWxJr1lIxAIcVC2z280aVCY1x0267AKxVW8Jr0_Cr1UYxBIdaVF xhVjvjDU0xZFpf9x07b0c_-UUUUU= X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776893651673090354 X-GMAIL-MSGID: 1776893651673090354 gcc/testsuite/ChangeLog: * gcc.target/loongarch/vector/lasx/lasx-xvldrepl.c: New test. * gcc.target/loongarch/vector/lasx/lasx-xvstelm.c: New test. --- .../loongarch/vector/lasx/lasx-xvldrepl.c | 16 ++++++++++++++++ .../loongarch/vector/lasx/lasx-xvstelm.c | 14 ++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvldrepl.c create mode 100644 gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvstelm.c diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvldrepl.c b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvldrepl.c new file mode 100644 index 00000000000..10556795119 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvldrepl.c @@ -0,0 +1,16 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -mlasx" } */ +/* { dg-final { scan-assembler-times "xvldrepl.w" 2} } */ + +#define N 258 + +float a[N], b[N], c[N]; + +void +test () +{ + for (int i = 0; i < 256; i++) + { + a[i] = c[0] * b[i] + c[1]; + } +} diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvstelm.c b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvstelm.c new file mode 100644 index 00000000000..1a7b0e86f8b --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/vector/lasx/lasx-xvstelm.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -mlasx" } */ +/* { dg-final { scan-assembler-times "xvstelm.w" 8} } */ + +#define LEN 256 + +float a[LEN], b[LEN], c[LEN]; + +void +test () +{ + for (int i = 0; i < LEN; i += 2) + a[i] = b[i] + c[i]; +}