From: Xi Ruoyao <xry111@xry111.site>
To: dengjianbo <dengjianbo@loongson.cn>,
Andreas Schwab <schwab@linux-m68k.org>
Cc: adhemerval.zanella@linaro.org, libc-alpha@sourceware.org,
caiyinyu@loongson.cn, i.swmail@xen0n.name,
joseph_myers@mentor.com, carlos@redhat.com,
xuchenghua@loongson.cn
Subject: Re: [PATCH] LoongArch: Optimize math barriers
Date: Fri, 08 May 2026 17:29:10 +0800 [thread overview]
Message-ID: <460de7efbecb99e8ee40d21d5ed3c451da89d5a8.camel@xry111.site> (raw)
In-Reply-To: <93c7e2b9-423b-46bf-b95c-6b456d5b1da5@loongson.cn>
On Thu, 2026-05-07 at 17:30 +0800, dengjianbo wrote:
> Yes, unnecessary moves can occur if the value is already in a general
> reg. For example, when invoking math_opt_barrier with fixed-point
> parameters. However, in glibc, these two macros are invoked with
> floating-point parameters, and I didn’t find the unnecessary moves
> being generated. For other architectures, aarch64 and s390 also do
> not include the 'r' constraint.
>
> For gcc part, to my understanding, when 'fr' is present, GCC selects the
> union of FP_REGS and GR_REGS as the destination register class, which is
> initialized to GR_REGS. Then compute the cost of choosing different
> register classes, choosing GR_REGS incurs no extra cost, while choosing
> FP_REGS adds an extra move cost. I am not sure if it's a strategy here.
Where does this issue manifest (i.e. in which glibc source file)? I'll
try to reduce a test case from that. To me this seems a compiler bug
too.
>
--
Xi Ruoyao <xry111@xry111.site>
next prev parent reply other threads:[~2026-05-08 9:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-07 2:17 Deng Jianbo
2026-05-07 6:46 ` Andreas Schwab
2026-05-07 9:30 ` dengjianbo
2026-05-08 9:29 ` Xi Ruoyao [this message]
2026-05-08 9:47 ` dengjianbo
2026-05-25 1:09 ` dengjianbo
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=460de7efbecb99e8ee40d21d5ed3c451da89d5a8.camel@xry111.site \
--to=xry111@xry111.site \
--cc=adhemerval.zanella@linaro.org \
--cc=caiyinyu@loongson.cn \
--cc=carlos@redhat.com \
--cc=dengjianbo@loongson.cn \
--cc=i.swmail@xen0n.name \
--cc=joseph_myers@mentor.com \
--cc=libc-alpha@sourceware.org \
--cc=schwab@linux-m68k.org \
--cc=xuchenghua@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).