From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 9C33D3858415 for ; Wed, 24 Jan 2024 09:48:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9C33D3858415 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9C33D3858415 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=89.208.246.23 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706089729; cv=none; b=BDhDz9tCWyci+P0tsrox+YdaIPp1m954EeBS8J2L1OAnS+t8mtRNaz0cpg+VdaxlbmiLhkQFOmXrjuv7tc5tgFrgOcu8lSH47bBHig8CCSTp3C9o8sZUVq6/Q3gtLU58A7fMfPoCvFfF28dxoil2ftIkFrd2j+mRZct4rqenkd8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706089729; c=relaxed/simple; bh=okm1yJjP9wDn2q00yvK4LxLhOZON/BaF/9GMnVE14R0=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=TcSt3hZpMojLZZIo8cEbZlguP+kwHuvVD2k9o/p9lvp3LEPdStWdR4j8dMNjVEKAdYouFTqhnSLR/MyT8a0hVlUpEjNwQZ6lx+SzWPXYy662l6Io3emasA4RC8pm9Smt2/qOsfguQ9MjY4V16lhcIq6OBBWif+BYRt4hzgBD/4I= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1706089724; bh=okm1yJjP9wDn2q00yvK4LxLhOZON/BaF/9GMnVE14R0=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=PJSuz7ZcYs6NsIsKcafhXSiHJj7Qes7Di68v9fSMmQYcXDcyQx1o8OeOrkDZt2WAR CFnie3H7OyIEO10y0QmspFioniqcMX7veuCV58doON3a212ExstoggaVsvXuyLBXC3 j0fJeW0vakEMwmE1I81e9v3D71aAxG3AHPRoNMBM= Received: from [IPv6:2408:8471:101c:6a2e:1fb0:74c0:f402:1b17] (unknown [IPv6:2408:8471:101c:6a2e:1fb0:74c0:f402:1b17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id AB3EA66F90; Wed, 24 Jan 2024 04:48:39 -0500 (EST) Message-ID: <291eac07320a425b5e6ce26d801bde2c2d5f4cdd.camel@xry111.site> Subject: Re: [PATCH] LoongArch: Fix incorrect return type for frecipe/frsqrte intrinsic functions From: Xi Ruoyao To: Jiahao Xu , gcc-patches@gcc.gnu.org Cc: i@xen0n.name, chenglulu@loongson.cn, xuchenghua@loongson.cn Date: Wed, 24 Jan 2024 17:48:32 +0800 In-Reply-To: <20240124091932.38877-1-xujiahao@loongson.cn> References: <20240124091932.38877-1-xujiahao@loongson.cn> Autocrypt: addr=xry111@xry111.site; prefer-encrypt=mutual; keydata=mDMEYnkdPhYJKwYBBAHaRw8BAQdAsY+HvJs3EVKpwIu2gN89cQT/pnrbQtlvd6Yfq7egugi0HlhpIFJ1b3lhbyA8eHJ5MTExQHhyeTExMS5zaXRlPoiTBBMWCgA7FiEEkdD1djAfkk197dzorKrSDhnnEOMFAmJ5HT4CGwMFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQrKrSDhnnEOPHFgD8D9vUToTd1MF5bng9uPJq5y3DfpcxDp+LD3joA3U2TmwA/jZtN9xLH7CGDHeClKZK/ZYELotWfJsqRcthOIGjsdAPuDgEYnkdPhIKKwYBBAGXVQEFAQEHQG+HnNiPZseiBkzYBHwq/nN638o0NPwgYwH70wlKMZhRAwEIB4h4BBgWCgAgFiEEkdD1djAfkk197dzorKrSDhnnEOMFAmJ5HT4CGwwACgkQrKrSDhnnEOPjXgD/euD64cxwqDIqckUaisT3VCst11RcnO5iRHm6meNIwj0BALLmWplyi7beKrOlqKfuZtCLbiAPywGfCNg8LOTt4iMD Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.3 MIME-Version: 1.0 X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,LIKELY_SPAM_FROM,SPF_HELO_PASS,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 List-Id: On Wed, 2024-01-24 at 17:19 +0800, Jiahao Xu wrote: > gcc/ChangeLog: >=20 > * config/loongarch/larchintrin.h > (__frecipe_s): Update function return type. > (__frecipe_d): Ditto. > (__frsqrte_s): Ditto. > (__frsqrte_d): Ditto. >=20 > gcc/testsuite/ChangeLog: >=20 > * gcc.target/loongarch/larch-frecipe-intrinsic.c: New test. >=20 > diff --git a/gcc/config/loongarch/larchintrin.h b/gcc/config/loongarch/la= rchintrin.h > index 7692415e04d..ff2c9f460ac 100644 > --- a/gcc/config/loongarch/larchintrin.h > +++ b/gcc/config/loongarch/larchintrin.h > @@ -336,38 +336,38 @@ __iocsrwr_d (unsigned long int _1, unsigned int _2) > =C2=A0#ifdef __loongarch_frecipe > =C2=A0/* Assembly instruction format: fd, fj.=C2=A0 */ > =C2=A0/* Data types in instruction templates:=C2=A0 SF, SF.=C2=A0 */ > -extern __inline void > +extern __inline float > =C2=A0__attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) > =C2=A0__frecipe_s (float _1) > =C2=A0{ > -=C2=A0 __builtin_loongarch_frecipe_s ((float) _1); > +=C2=A0 return (float) __builtin_loongarch_frecipe_s ((float) _1); I don't think the (float) conversion is needed. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University