From: chenglulu <chenglulu@loongson.cn>
To: Jiahao Xu <xujiahao@loongson.cn>, Xi Ruoyao <xry111@xry111.site>,
gcc-patches@gcc.gnu.org
Cc: i@xen0n.name, xuchenghua@loongson.cn
Subject: Re: [PATCH] LoongArch: Fix incorrect return type for frecipe/frsqrte intrinsic functions
Date: Thu, 25 Jan 2024 14:12:51 +0800 [thread overview]
Message-ID: <71559384-ce98-71de-76e6-49a954e7ca79@loongson.cn> (raw)
In-Reply-To: <6574fefa-1c6f-a6d2-d332-74808fe22dee@loongson.cn>
在 2024/1/24 下午5:58, Jiahao Xu 写道:
>
> 在 2024/1/24 下午5:48, Xi Ruoyao 写道:
>> On Wed, 2024-01-24 at 17:19 +0800, Jiahao Xu wrote:
>>> gcc/ChangeLog:
>>>
>>> * config/loongarch/larchintrin.h
>>> (__frecipe_s): Update function return type.
>>> (__frecipe_d): Ditto.
>>> (__frsqrte_s): Ditto.
>>> (__frsqrte_d): Ditto.
>>>
>>> gcc/testsuite/ChangeLog:
>>>
>>> * gcc.target/loongarch/larch-frecipe-intrinsic.c: New test.
>>>
>>> diff --git a/gcc/config/loongarch/larchintrin.h
>>> b/gcc/config/loongarch/larchintrin.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)
>>> #ifdef __loongarch_frecipe
>>> /* Assembly instruction format: fd, fj. */
>>> /* Data types in instruction templates: SF, SF. */
>>> -extern __inline void
>>> +extern __inline float
>>> __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
>>> __frecipe_s (float _1)
>>> {
>>> - __builtin_loongarch_frecipe_s ((float) _1);
>>> + return (float) __builtin_loongarch_frecipe_s ((float) _1);
>> I don't think the (float) conversion is needed.
>>
>>
> Indeed, this float conversion is unnecessary; I simply included it to
> align with the definitions of other intrinsic functions.
This is generated in batches like vectors, so there will be such
redundant symbol type conversion.
We will remove the redundant types later.
next prev parent reply other threads:[~2024-01-25 6:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-24 9:19 Jiahao Xu
2024-01-24 9:48 ` Xi Ruoyao
2024-01-24 9:58 ` Jiahao Xu
2024-01-25 6:12 ` chenglulu [this message]
2024-02-02 2:15 ` [pushed][PATCH] " chenglulu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=71559384-ce98-71de-76e6-49a954e7ca79@loongson.cn \
--to=chenglulu@loongson.cn \
--cc=gcc-patches@gcc.gnu.org \
--cc=i@xen0n.name \
--cc=xry111@xry111.site \
--cc=xuchenghua@loongson.cn \
--cc=xujiahao@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).