From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 5902C3858D33 for ; Mon, 4 Sep 2023 01:49:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5902C3858D33 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 ) id 1qcyin-0007L6-23 for gcc-patches@gcc.gnu.org; Sun, 03 Sep 2023 21:49:48 -0400 Received: from loongson.cn (unknown [10.20.4.107]) by gateway (Coremail) with SMTP id _____8DxfeuyN_VkI7QeAA--.59981S3; Mon, 04 Sep 2023 09:49:39 +0800 (CST) Received: from [10.20.4.107] (unknown [10.20.4.107]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dx4eSwN_VkyMNqAA--.61027S3; Mon, 04 Sep 2023 09:49:36 +0800 (CST) Subject: Re:[pushed] [PATCH v2] LoongArch: Support storing floating-point zero into MEM[base + index]. To: Guo Jie , gcc-patches@gcc.gnu.org Cc: xuchenghua@loongson.cn, i@xen0n.name, xry111@xry111.site References: <20230902070207.31651-1-guojie@loongson.cn> From: chenglulu Message-ID: <9319543c-8e9d-79af-8891-e7d8af495117@loongson.cn> Date: Mon, 4 Sep 2023 09:49:36 +0800 User-Agent: Mozilla/5.0 (X11; Linux loongarch64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20230902070207.31651-1-guojie@loongson.cn> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-TRANSID:AQAAf8Dx4eSwN_VkyMNqAA--.61027S3 X-CM-SenderInfo: xfkh0wpoxo3qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBj93Xo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DU0xZFpf9x07URa0PU UUUU= Received-SPF: pass client-ip=114.242.206.163; envelope-from=chenglulu@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9,MIME_CHARSET_FARAWAY=2.45,NICE_REPLY_A=-1.473,SPF_HELO_NONE=0.001,SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,KAM_SHORT,MIME_CHARSET_FARAWAY,NICE_REPLY_A,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 List-Id: pushed to r14-3643. ÔÚ 2023/9/2 ÏÂÎç3:02, Guo Jie дµÀ: > v2: Modify commit message. > > gcc/ChangeLog: > > * config/loongarch/loongarch.md: Support 'G' -> 'k' in > movsf_hardfloat and movdf_hardfloat. > > gcc/testsuite/ChangeLog: > > * gcc.target/loongarch/const-double-zero-stx.c: New test. > > --- > gcc/config/loongarch/loongarch.md | 12 ++++++------ > .../loongarch/const-double-zero-stx.c | 18 ++++++++++++++++++ > 2 files changed, 24 insertions(+), 6 deletions(-) > create mode 100644 gcc/testsuite/gcc.target/loongarch/const-double-zero-stx.c > > diff --git a/gcc/config/loongarch/loongarch.md b/gcc/config/loongarch/loongarch.md > index b37e070660f..6f47c23a79c 100644 > --- a/gcc/config/loongarch/loongarch.md > +++ b/gcc/config/loongarch/loongarch.md > @@ -1915,13 +1915,13 @@ (define_expand "movsf" > }) > > (define_insn "*movsf_hardfloat" > - [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,m,f,k,m,*f,*r,*r,*r,*m") > - (match_operand:SF 1 "move_operand" "f,G,m,f,k,f,G,*r,*f,*G*r,*m,*r"))] > + [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,m,f,k,m,k,*f,*r,*r,*r,*m") > + (match_operand:SF 1 "move_operand" "f,G,m,f,k,f,G,G,*r,*f,*G*r,*m,*r"))] > "TARGET_HARD_FLOAT > && (register_operand (operands[0], SFmode) > || reg_or_0_operand (operands[1], SFmode))" > { return loongarch_output_move (operands[0], operands[1]); } > - [(set_attr "move_type" "fmove,mgtf,fpload,fpstore,fpload,fpstore,store,mgtf,mftg,move,load,store") > + [(set_attr "move_type" "fmove,mgtf,fpload,fpstore,fpload,fpstore,store,store,mgtf,mftg,move,load,store") > (set_attr "mode" "SF")]) > > (define_insn "*movsf_softfloat" > @@ -1946,13 +1946,13 @@ (define_expand "movdf" > }) > > (define_insn "*movdf_hardfloat" > - [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,m,f,k,m,*f,*r,*r,*r,*m") > - (match_operand:DF 1 "move_operand" "f,G,m,f,k,f,G,*r,*f,*r*G,*m,*r"))] > + [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,m,f,k,m,k,*f,*r,*r,*r,*m") > + (match_operand:DF 1 "move_operand" "f,G,m,f,k,f,G,G,*r,*f,*r*G,*m,*r"))] > "TARGET_DOUBLE_FLOAT > && (register_operand (operands[0], DFmode) > || reg_or_0_operand (operands[1], DFmode))" > { return loongarch_output_move (operands[0], operands[1]); } > - [(set_attr "move_type" "fmove,mgtf,fpload,fpstore,fpload,fpstore,store,mgtf,mftg,move,load,store") > + [(set_attr "move_type" "fmove,mgtf,fpload,fpstore,fpload,fpstore,store,store,mgtf,mftg,move,load,store") > (set_attr "mode" "DF")]) > > (define_insn "*movdf_softfloat" > diff --git a/gcc/testsuite/gcc.target/loongarch/const-double-zero-stx.c b/gcc/testsuite/gcc.target/loongarch/const-double-zero-stx.c > new file mode 100644 > index 00000000000..8fb04be8ff5 > --- /dev/null > +++ b/gcc/testsuite/gcc.target/loongarch/const-double-zero-stx.c > @@ -0,0 +1,18 @@ > +/* { dg-do compile } */ > +/* { dg-options "-O2" } */ > +/* { dg-final { scan-assembler-times {stx\..\t\$r0} 2 } } */ > + > +extern float arr_f[]; > +extern double arr_d[]; > + > +void > +test_f (int base, int index) > +{ > + arr_f[base + index] = 0.0; > +} > + > +void > +test_d (int base, int index) > +{ > + arr_d[base + index] = 0.0; > +}