From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7891) id 8C23B3857404; Fri, 28 Oct 2022 07:07:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C23B3857404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666940849; bh=dstCeXD3EmJwZKlLKqALvK8iQDuxQzu+TmOZ24W74sU=; h=From:To:Subject:Date:From; b=gU7rU5SGLCv+UMQCUGu6pLTrnQW3s3OiamJ0Y9j+Tn24j275G1UaCdEg/+DEdmim1 D+FwQuDOOrSOigON8LgNN5HDYwrKxbY2dh9aZ/8WRZIa6ObYCabdEuGeXNJGd3JNJu 1h0ei6CP72ZjxvVfM0/dwszoYzHPSdyWN2wnBdvY= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Yinyu Cai To: glibc-cvs@sourceware.org Subject: [glibc/release/2.36/master] longlong.h: update from GCC for LoongArch clz/ctz support X-Act-Checkin: glibc X-Git-Author: Xi Ruoyao X-Git-Refname: refs/heads/release/2.36/master X-Git-Oldrev: a1dc0be03c9dd850b864bd7a9c03cf8e396eb7ca X-Git-Newrev: 4c6a78addabbd6e1b69763e286768919e56dfe0a Message-Id: <20221028070729.8C23B3857404@sourceware.org> Date: Fri, 28 Oct 2022 07:07:29 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4c6a78addabbd6e1b69763e286768919e56dfe0a commit 4c6a78addabbd6e1b69763e286768919e56dfe0a Author: Xi Ruoyao Date: Sat Oct 15 14:12:13 2022 +0800 longlong.h: update from GCC for LoongArch clz/ctz support Update longlong.h to GCC r13-3269. Keep our local change (prefer https for gnu.org URL). Diff: --- 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. */ \