Message ID | 20230906104307.37244-2-chenxiaolong@loongson.cn |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ab0a:0:b0:3f2:4152:657d with SMTP id m10csp2224087vqo; Wed, 6 Sep 2023 03:44:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFX3qRN33GKTaGz6CoYeXj4prqh8+CU8W8AvXB3hzK5gNUmDEH0e9SCbSpGlHwyzOtjO1Tm X-Received: by 2002:a17:906:1099:b0:99c:5056:4e2e with SMTP id u25-20020a170906109900b0099c50564e2emr1774902eju.31.1693997061550; Wed, 06 Sep 2023 03:44:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693997061; cv=none; d=google.com; s=arc-20160816; b=JvgKWUOW+8rX860ayI6fGB7me9cAWs9opq75dwq8mjeVYp8xD4dZFpcoN0NRDH66XL FR/ZOJUERVeJGhwKptj8OStZFTgaylEuDwatQ9oNfLAfBf2QCMq79UDDgYbClO+njOd3 v/yCk8xxHRP//vo6EA7m0y1cGWuXKdDFZsg7SdSHv4fC3FZqHxGfxC3xM7vhxQPlP+PS mutEbaFv0BVnkisY2k2PEPQb2KKuFtqrPkTsAE7TQ/245je/9juCP5Ns6cmKg9Fez+eY gAgeMn/G5udFseBJNXXm3XoDtXnU1wsbVCyvoTcSM2XcUG1aR9QaWUNhMr5nYS92E1ij A6dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dmarc-filter:delivered-to; bh=+jOBiftFos0RqeldrJuiRjkbV1/ifqRVX1LY7pkFjL4=; fh=BpFCyCzVJo4znJIvOjeDfKzcGsF6Q+JgJbJ+1ev/kM4=; b=nipdkKlvOJFP7O4Oe8puojFbw45+QTt0Q09pvApNpvkU1L946sZIzUlH03qDtdFurS j0/mgjT93ZCetceWmBHKpc3dB4puW6Q3QcBoBDQYwZbep4aw/a7oePrFdyc42ctBHQcB ZzdwbD3cWxYz9+Nocw6tRberFL4t/Ws09GoumVJXqq1AiiTO6UD6DmbYi39vsZMOyrv1 Tp41/gbS4umgPj2URf9KlV1CLO/Z2Yeuumfq+EZajW0dQnYtbDEw9u2sq54aQpKGsnPT Tvdj43C2sZp2bT/HZvyebihU5QaSs/klmPQrOmDWmiL4K8fU/PjrnyOxTdNgo/0kuxi2 z6GQ== 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 p26-20020a170906b21a00b0099279210460si9808179ejz.643.2023.09.06.03.44.21 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Sep 2023 03:44:21 -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 5274B3858288 for <ouuuleilei@gmail.com>; Wed, 6 Sep 2023 10:43:50 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 862883858402 for <gcc-patches@gcc.gnu.org>; Wed, 6 Sep 2023 10:43:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 862883858402 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=loongson.cn Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from <chenxiaolong@loongson.cn>) id 1qdq0H-0006hF-3x for gcc-patches@gcc.gnu.org; Wed, 06 Sep 2023 06:43:25 -0400 Received: from loongson.cn (unknown [10.10.130.252]) by gateway (Coremail) with SMTP id _____8CxNvHEV_hkXVAgAA--.64551S3; Wed, 06 Sep 2023 18:43:16 +0800 (CST) Received: from slurm-master.loongson.cn (unknown [10.10.130.252]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxriO8V_hkPXpuAA--.28525S5; Wed, 06 Sep 2023 18:43:15 +0800 (CST) From: Xiaolong Chen <chenxiaolong@loongson.cn> To: gcc-patches@gcc.gnu.org Subject: [PATCH v1 1/4] LoongArch: Add tests of -mstrict-align option. Date: Wed, 6 Sep 2023 18:43:04 +0800 Message-Id: <20230906104307.37244-2-chenxiaolong@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230906104307.37244-1-chenxiaolong@loongson.cn> References: <20230906104307.37244-1-chenxiaolong@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8CxriO8V_hkPXpuAA--.28525S5 X-CM-SenderInfo: hfkh05xldrz0tqj6z05rqj20fqof0/1tbiAQAGBWT3-DUFCwAAsW X-Coremail-Antispam: 1Uk129KBj9xXoWruw4Dtw48tFW5tFW7JF1kJFc_yoWfJrXEkF 12q3s3Gr4Uua1xCFWvvry5CF9akws3XFySqF4FqFs7XFyDXFs0yFWDJFy7ZFyjyr18JFZx GFZavr1SyF9xtosvyTuYvTs0mTUanT9S1TB71UUUUUDqnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUb7xYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8JVWxJwA2z4x0Y4vEx4A2jsIE14v26F4UJVW0owA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_ Cr1j6rxdM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx1l5I 8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r126r1DMcIj6I8E87Iv67AK xVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I 0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07j83kZUUUUU= Received-SPF: pass client-ip=114.242.206.163; envelope-from=chenxiaolong@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_FAIL, SPF_HELO_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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Cc: Xiaolong Chen <chenxiaolong@loongson.cn>, xuchenghua@loongson.cn, chenglulu@loongson.cn, i@xen0n.name Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776284662361848097 X-GMAIL-MSGID: 1776284662361848097 |
Series |
Add Loongson SX/ASX instruction support to LoongArch
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
chenxiaolong
Sept. 6, 2023, 10:43 a.m. UTC
gcc/testsuite/ChangeLog: * gcc.target/loongarch/strict-align.c: New test. --- gcc/testsuite/gcc.target/loongarch/strict-align.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 gcc/testsuite/gcc.target/loongarch/strict-align.c
Comments
On Wed, 2023-09-06 at 18:43 +0800, Xiaolong Chen wrote: > gcc/testsuite/ChangeLog: > > * gcc.target/loongarch/strict-align.c: New test. A question: is there really a CPU model with LSX/LASX but without unaligned access support? If not I think we'd just reject -mstrict- align -mlsx. Currently Glibc assumes if LSX is available then unaligned access must be available too. > --- > gcc/testsuite/gcc.target/loongarch/strict-align.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > create mode 100644 gcc/testsuite/gcc.target/loongarch/strict-align.c > > diff --git a/gcc/testsuite/gcc.target/loongarch/strict-align.c > b/gcc/testsuite/gcc.target/loongarch/strict-align.c > new file mode 100644 > index 00000000000..bcad2b84f68 > --- /dev/null > +++ b/gcc/testsuite/gcc.target/loongarch/strict-align.c > @@ -0,0 +1,13 @@ > +/* { dg-do compile } */ > +/* { dg-options "-Ofast -mstrict-align -mlasx" } */ > +/* { dg-final { scan-assembler-not "vfadd.s" } } */ > + > +void > +foo (float* restrict x, float* restrict y) > +{ > + x[0] = x[0] + y[0]; > + x[1] = x[1] + y[1]; > + x[2] = x[2] + y[2]; > + x[3] = x[3] + y[3]; > +} > +
在 2023/9/6 下午7:10, Xi Ruoyao 写道: > On Wed, 2023-09-06 at 18:43 +0800, Xiaolong Chen wrote: >> gcc/testsuite/ChangeLog: >> >> * gcc.target/loongarch/strict-align.c: New test. > A question: is there really a CPU model with LSX/LASX but without > unaligned access support? If not I think we'd just reject -mstrict- > align -mlsx. > > Currently Glibc assumes if LSX is available then unaligned access must > be available too. This is not a question of support or unsupport, the original intention is to need to naturally align memory access to improve performance after enabling LSX, but this part of the code has not been ported to the main branch, so we will submit this test example after adding the corresponding function. Thanks! > >> --- >> gcc/testsuite/gcc.target/loongarch/strict-align.c | 13 +++++++++++++ >> 1 file changed, 13 insertions(+) >> create mode 100644 gcc/testsuite/gcc.target/loongarch/strict-align.c >> >> diff --git a/gcc/testsuite/gcc.target/loongarch/strict-align.c >> b/gcc/testsuite/gcc.target/loongarch/strict-align.c >> new file mode 100644 >> index 00000000000..bcad2b84f68 >> --- /dev/null >> +++ b/gcc/testsuite/gcc.target/loongarch/strict-align.c >> @@ -0,0 +1,13 @@ >> +/* { dg-do compile } */ >> +/* { dg-options "-Ofast -mstrict-align -mlasx" } */ >> +/* { dg-final { scan-assembler-not "vfadd.s" } } */ >> + >> +void >> +foo (float* restrict x, float* restrict y) >> +{ >> + x[0] = x[0] + y[0]; >> + x[1] = x[1] + y[1]; >> + x[2] = x[2] + y[2]; >> + x[3] = x[3] + y[3]; >> +} >> +
diff --git a/gcc/testsuite/gcc.target/loongarch/strict-align.c b/gcc/testsuite/gcc.target/loongarch/strict-align.c new file mode 100644 index 00000000000..bcad2b84f68 --- /dev/null +++ b/gcc/testsuite/gcc.target/loongarch/strict-align.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-Ofast -mstrict-align -mlasx" } */ +/* { dg-final { scan-assembler-not "vfadd.s" } } */ + +void +foo (float* restrict x, float* restrict y) +{ + x[0] = x[0] + y[0]; + x[1] = x[1] + y[1]; + x[2] = x[2] + y[2]; + x[3] = x[3] + y[3]; +} +