From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by sourceware.org (Postfix) with ESMTPS id C3E883858D1E for ; Sat, 15 Oct 2022 06:12:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C3E883858D1E Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1665814358; bh=2DDSJWnDyWXtvVIkBOhsB5GGkPmyANWEi9aJLGGJFC8=; h=From:To:Cc:Subject:Date:From; b=CMfgovTKkbmCc3e03WjaEFVSrD77f2PjO06019SGacqKSHy9O3jHc+yjdzqiDnTcH kb+TLHsHvzozCV7pssh7o2WzyXjZ2215hjshvUgb3RPp8olsAFJNPAuGhmxYIYt0OY GfIYTsQCJpTCa0jEN3EAjJh1p+aPhT5DakkgyyjU= Received: from xry111-x57s1.. (unknown [IPv6:240e:358:116d:4900:dc73:854d:832e:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 13D4466777; Sat, 15 Oct 2022 02:12:33 -0400 (EDT) From: Xi Ruoyao To: libc-alpha@sourceware.org Cc: caiyinyu , Joseph Myers , Wang Xuerui , Xi Ruoyao Subject: [PATCH] longlong.h: update from GCC for LoongArch clz/ctz support Date: Sat, 15 Oct 2022 14:12:13 +0800 Message-Id: <20221015061212.23105-1-xry111@xry111.site> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD,FROM_SUSPICIOUS_NTLD_FP,GIT_PATCH_0,LIKELY_SPAM_FROM,PDS_OTHER_BAD_TLD,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: 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. */ \ -- 2.38.0