From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 0726F385801F; Wed, 14 Feb 2024 16:59:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0726F385801F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707929979; bh=5e3kttNE1aUXLZhvTetIt5hhHmk+i7AKvkeg3m7wdsA=; h=From:To:Subject:Date:From; b=rswuPu0Iwutf067eVPVRiWdMsfLLqdFqRytHZMooT5BO/F3hL7jRsCMf6DZI5Cg/G vKYElPkHnYYSQd7rkAWImox0RxQ1jBmtkzFgwSooBE0wFbh+G/Y9zVxngx9pw7mAcN nDjzloop1HetfC7bd52EN88+Lt2ZOwreA7vaeQks= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] mips: Use builtins for ffs and ffsll X-Act-Checkin: glibc X-Git-Author: Junxian Zhu X-Git-Refname: refs/heads/master X-Git-Oldrev: 491e55beab7457ed310a4a47496f4a333c5d1032 X-Git-Newrev: 545480506fc6576ea37a14e56c654935c691709d Message-Id: <20240214165939.0726F385801F@sourceware.org> Date: Wed, 14 Feb 2024 16:59:38 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=545480506fc6576ea37a14e56c654935c691709d commit 545480506fc6576ea37a14e56c654935c691709d Author: Junxian Zhu Date: Tue Feb 6 16:34:56 2024 +0800 mips: Use builtins for ffs and ffsll __builtin_ffs{,ll} basically on __builtin_ctz{,ll} in MIPS GCC compiler. The hardware ctz instructions were available after MIPS{32,64} Release1. By using builtin ctz. It can also reduce code size of ffs/ffsll. Checked on mips o32. mips64. Signed-off-by: Junxian Zhu Reviewed-by: Adhemerval Zanella Reviewed-by: Maxim Kuvyrkov Diff: --- sysdeps/mips/math-use-builtins-ffs.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sysdeps/mips/math-use-builtins-ffs.h b/sysdeps/mips/math-use-builtins-ffs.h new file mode 100644 index 0000000000..2ab6a03a16 --- /dev/null +++ b/sysdeps/mips/math-use-builtins-ffs.h @@ -0,0 +1,3 @@ +#include +#define USE_FFS_BUILTIN (__mips_isa_rev >= 1) +#define USE_FFSLL_BUILTIN (__mips_isa_rev >= 1)