public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: Xi Ruoyao <xry111@xry111.site>, libc-alpha@sourceware.org
Cc: Wang Xuerui <i@xen0n.name>,
	Joseph Myers <joseph@codesourcery.com>,
	caiyinyu <caiyinyu@loongson.cn>
Subject: Re: [PATCH] longlong.h: update from GCC for LoongArch clz/ctz support
Date: Mon, 24 Oct 2022 11:10:00 -0300	[thread overview]
Message-ID: <c8d983aa-1870-1adc-fecf-a7a6fa3ecbdc@linaro.org> (raw)
In-Reply-To: <20221015061212.23105-1-xry111@xry111.site>



On 15/10/22 03:12, Xi Ruoyao via Libc-alpha wrote:
> Update longlong.h to GCC r13-3269.  Keep our local change (prefer https
> for gnu.org URL).


LGTM, it matches gcc commit 6f653a2c85a450714bac905ea4f153234bc6cd5f.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  stdlib/longlong.h | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/stdlib/longlong.h b/stdlib/longlong.h
> index 9b89469ac2..d8f76a43b5 100644
> --- a/stdlib/longlong.h
> +++ b/stdlib/longlong.h
> @@ -593,6 +593,18 @@ extern UDItype __umulsidi3 (USItype, USItype);
>  #define UMUL_TIME 14
>  #endif
>  
> +#ifdef __loongarch__
> +# if W_TYPE_SIZE == 32
> +#  define count_leading_zeros(count, x)  ((count) = __builtin_clz (x))
> +#  define count_trailing_zeros(count, x) ((count) = __builtin_ctz (x))
> +#  define COUNT_LEADING_ZEROS_0 32
> +# elif W_TYPE_SIZE == 64
> +#  define count_leading_zeros(count, x)  ((count) = __builtin_clzll (x))
> +#  define count_trailing_zeros(count, x) ((count) = __builtin_ctzll (x))
> +#  define COUNT_LEADING_ZEROS_0 64
> +# endif
> +#endif
> +
>  #if defined (__M32R__) && W_TYPE_SIZE == 32
>  #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
>    /* The cmp clears the condition bit.  */ \

      parent reply	other threads:[~2022-10-24 14:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-15  6:12 Xi Ruoyao
2022-10-24 13:08 ` caiyinyu
2022-10-24 14:10 ` Adhemerval Zanella Netto [this message]

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=c8d983aa-1870-1adc-fecf-a7a6fa3ecbdc@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=caiyinyu@loongson.cn \
    --cc=i@xen0n.name \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=xry111@xry111.site \
    /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).