From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 79C5C3858439 for ; Mon, 24 Oct 2022 13:09:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 79C5C3858439 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from loongson.cn (unknown [10.20.4.187]) by gateway (Coremail) with SMTP id _____8CxLdlrjlZjGyUCAA--.8417S3; Mon, 24 Oct 2022 21:08:59 +0800 (CST) Received: from [10.20.4.187] (unknown [10.20.4.187]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Bxj+BqjlZjOGgEAA--.16740S3; Mon, 24 Oct 2022 21:08:58 +0800 (CST) Subject: Re: [PATCH] longlong.h: update from GCC for LoongArch clz/ctz support To: Xi Ruoyao , libc-alpha@sourceware.org Cc: Joseph Myers , Wang Xuerui References: <20221015061212.23105-1-xry111@xry111.site> From: caiyinyu Message-ID: Date: Mon, 24 Oct 2022 21:08:58 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20221015061212.23105-1-xry111@xry111.site> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-TRANSID:AQAAf8Bxj+BqjlZjOGgEAA--.16740S3 X-CM-SenderInfo: 5fdl5xhq1xqz5rrqw2lrqou0/ X-Coremail-Antispam: 1Uk129KBjvJXoW7Xw15Ww4fXFWDtFWfGF4xtFb_yoW8Jr1UpF yDtFy3Kr1rGFy7C34fta45tF1avr18uw13GF1j93yDWrW5tasIgr4jgr43GrZ8tFs5XF10 gr1jg3W7ZF4IkrDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bxkYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_JrI_Jryl8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVWUCVW8JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwA2z4 x0Y4vEx4A2jsIE14v26F4UJVW0owA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Cr1j6rxdM2AI xVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx1l5I8CrVACY4xI64 kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm 72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lc7I2V7IY0VAS07AlzVAYIcxG8wCF04 k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18 MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr4 1lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1l IxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4 A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7IU8czVUUUUUU== X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00,GIT_PATCH_0,KAM_DMARC_STATUS,MIME_CHARSET_FARAWAY,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP 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: Gentle Ping. Tested with gcc 12.0.1 binutils 2.39 and this patch need to be backport to glibc 2.36-master. ÔÚ 2022/10/15 ÏÂÎç2:12, Xi Ruoyao дµÀ: > Update longlong.h to GCC r13-3269. Keep our local change (prefer https > for gnu.org URL). > --- > 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. */ \