public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Xi Ruoyao <xry111@xry111.site>,
	Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>,
	"dengjianbo@loongson.cn" <dengjianbo@loongson.cn>
Cc: xuchenghua <xuchenghua@loongson.cn>,
	"i.swmail" <i.swmail@xen0n.name>,
	libc-alpha <libc-alpha@sourceware.org>,
	joseph <joseph@codesourcery.com>, caiyinyu <caiyinyu@loongson.cn>,
	Lulu Cheng <chenglulu@loongson.cn>
Subject: Re: [PATCH 0/2] LoongArch: Add optimized functions.
Date: Wed, 28 Sep 2022 12:18:19 -0700	[thread overview]
Message-ID: <d8fc513f-a14b-642f-6843-07f17e2c047f@linaro.org> (raw)
In-Reply-To: <6afb2b9136ff6c96d5b729340427f59e24ebf268.camel@xry111.site>

On 9/28/22 09:42, Xi Ruoyao wrote:
>> There is nothing in string-maskoff.h that the compiler should not be able to produce
>> itself from the generic version.  Having a brief look, the compiler simply needs to be
>> improved to unify two current AND patterns (which is an existing bug) and add the
>> additional case for bstrins.d.
> 
> Added GCC LoongArch port maintainer into Cc:.
> 
> It's actually more complicated.  Without the inline assembly in
> repeat_bytes(), the compiler does not hoist the 4-instruction 64-bit
> immediate load sequence out of a loop for "some reason I don't know
> yet".

Oh that's interesting.  I suspect that adding a REG_EQUAL note for each (or perhaps just 
the last) insn emitted by loongarch_move_integer would fix that.

>> Similarly, there is nothing in string-fzi.h that should not be gotten from longlong.h;
>> your only changes are to use __builtin_clz, which longlong.h exports as count_trailing_zeros.
> 
> No, it does not.  By default longlong.h uses a table driven approach for
> count_{trailing,leading}_zeros.  I can add __loongarch__ (or
> __loongarch_lp64) into longlong.h though.

That would best, as that header is used many more places.

>  IIUC I need to submit the change to GCC, then Glibc merges longlong.h from GCC, right?

I believe that's correct.


r~

  reply	other threads:[~2022-09-28 19:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-15  8:57 caiyinyu
2022-08-15  8:57 ` [PATCH 1/2] LoongArch: Add optimized string functions: str{chr, chrnul, cmp, ncmp} caiyinyu
2022-08-15  8:57 ` [PATCH 2/2] LoongArch: Add optimized function: memmove caiyinyu
2022-08-15 14:02 ` [PATCH 0/2] LoongArch: Add optimized functions Carlos O'Donell
2022-08-15 20:46   ` Joseph Myers
     [not found]     ` <ccc3c93d-07d0-ea9b-562c-aeaec8914f20@loongson.cn>
2022-09-02  9:05       ` Fwd: " dengjianbo
2022-09-02 12:27     ` Adhemerval Zanella Netto
     [not found]       ` <403f78f0-55d9-48cf-c62a-4a0462a76987@loongson.cn>
2022-09-19  2:03         ` dengjianbo
2022-09-19 20:16           ` Adhemerval Zanella Netto
2022-09-20  9:54             ` Xi Ruoyao
2022-09-22 18:05               ` Adhemerval Zanella Netto
2022-09-26 13:49                 ` Xi Ruoyao
2022-09-28 14:22                   ` Richard Henderson
2022-09-28 16:42                     ` Xi Ruoyao
2022-09-28 19:18                       ` Richard Henderson [this message]
2022-10-10  1:39                         ` Lulu Cheng
2022-09-29  3:00                       ` Lulu Cheng
2022-09-29 11:45                   ` Adhemerval Zanella Netto

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=d8fc513f-a14b-642f-6843-07f17e2c047f@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=adhemerval.zanella@linaro.org \
    --cc=caiyinyu@loongson.cn \
    --cc=chenglulu@loongson.cn \
    --cc=dengjianbo@loongson.cn \
    --cc=i.swmail@xen0n.name \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=xry111@xry111.site \
    --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).