From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id B8F003858CDA for ; Mon, 5 Feb 2024 18:29:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B8F003858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B8F003858CDA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::633 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707157745; cv=none; b=CVWV/RFSEpe2J864/RRMG50CAFk7xduxRtNPmWHGyfvdtP9WN2HRIkVVgzafpipQg0pOJ/IUgYvGyTeFvh60L4U3Y8bo0DEd0ZlBxdjFfqv5tni+xPv3CXmjLTAsT16sHYohAdDPTl84OWer8++Dd6q7skK4vZ2airN+ZqOL3Gc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707157745; c=relaxed/simple; bh=YCSJ1+xJ7uMNT3qcrDlRYGs6PaRu9K7JJOoTCGCwXTw=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:From:To; b=r+SK697xMgJTZp+UI20uNjGnp+YfTUtjZa32rniussnq4ZTLDJb/0vR/BlFTRcn82urrqy2JZQ9fCFlh4mR0NBUzqVGvBAEn/QhWNdfcoof/L/IHFPcS9CdG4A/uCt1dasOsE4V1osyIwPnhCd3j3/tdLFanI2xIQP4yYSHdrbY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1d918008b99so35391625ad.3 for ; Mon, 05 Feb 2024 10:29:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707157743; x=1707762543; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:references:to :from:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=+KluUYIi+KZPJvteSMX0el13WDYd0XZUjAaZBpcjguU=; b=nQmlS4fnvHgH2xzVXkgacJC/emhMqBX8UuL+8FDXz1dTwFBXMullxIpzI3i1bbK2E5 vNvRugC7/vDP3YI6y8V5/4nfeLLlB/iZAFiXo+gw8P0jI9yeMVzDAoS15Or2EXNY2S44 Kf5B/lo07o6u8o3MBXEVXJHjOtB6u/HLUfMWCp310qgHAMJj7IfrBi9Q0Twq5q8rFTrC +2W61qtRc/2wlnlnp7Z3QAYIELpGN6HtlICWLJFIFVZfZjNYmXeQe1hvDvVtFdZivcrs D6/+5ZKp6+qLi7YNydINLmpJnrcmytKtarHMORsieywhVDpv14615zt/BvMpPGb/mPBR e2vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707157743; x=1707762543; h=content-transfer-encoding:in-reply-to:organization:references:to :from:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+KluUYIi+KZPJvteSMX0el13WDYd0XZUjAaZBpcjguU=; b=BkEWHVbCBLNyi8gw1yHhGx6ug+HXmKMRu93Rn2D9efLiZEC87yq4hk+uKVI/NJN0NL Bv3hUuvIPBZTeMo6/s8uvFMH0vHFVdjJu5rpeznIQIimbbnL9ZP4ktlf+k9KbcBW4YeV QR4Jc1dhcEwS1I99lhATFhcCnwfYPWFFgNZ1vy2jc9muQPdhEubgR+iLIz4OS7HyKPC6 HBGBElhst7UPUYsbqxJfPyGtLJulIOl8nw7GR2IgLsHjwo4DGGtP001aHBlvOtW6X2d5 ltOhjLsFwCYugukKlZghaGBTXLQCnl6aDfZOfGGT/oELGSLJGtgR9l2GEcQPVuxBldEK R0sQ== X-Gm-Message-State: AOJu0Ywsg3PktdYPeJUmQeJHw5DaWHgWL020lEk4goPbibEpIGm8AJnq TA7tVBfKvh9xUoM+OHnF4KF4zIR6VKWJVUUMhfcDF1uavm+i7pbqLywa54ooYReanTHnJYy34OI zuvY= X-Google-Smtp-Source: AGHT+IGXjIFZyxhCLB7fSsbRCFqW8SL7ol5nly+TWTjKop/93y9pso5WMtSbUEctMA/rGKVxmlgxow== X-Received: by 2002:a17:902:c94b:b0:1d7:8382:322e with SMTP id i11-20020a170902c94b00b001d78382322emr347223pla.56.1707157742788; Mon, 05 Feb 2024 10:29:02 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCWZnHHd5p16TAGDCpUUR9iY5rD99l0dyBaKqY+reEzZ9rK2VX46TSMREqIJEUSr9BZU5C5smCo45m1kIr8hudWiM+jWci4w3g6B Received: from ?IPV6:2804:1b3:a7c3:574b:f1c3:db83:b701:fe0f? ([2804:1b3:a7c3:574b:f1c3:db83:b701:fe0f]) by smtp.gmail.com with ESMTPSA id jb14-20020a170903258e00b001d7284b9461sm171554plb.128.2024.02.05.10.29.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Feb 2024 10:29:02 -0800 (PST) Message-ID: <850a7fa0-e9c0-4c92-bde8-9f4f6773381f@linaro.org> Date: Mon, 5 Feb 2024 15:28:59 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mips: Use builtins for ffs and ffsll Content-Language: en-US From: Adhemerval Zanella Netto To: Junxian Zhu , libc-alpha@sourceware.org References: <20240204101132.653-2-zhujunxian@oss.cipunited.com> Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: On 05/02/24 11:19, Adhemerval Zanella Netto wrote: > > > On 04/02/24 07:11, Junxian Zhu wrote: >> From: Junxian Zhu >> >> __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 > > LGTM, thanks. > > Reviewed-by: Adhemerval Zanella > >> --- >> sysdeps/mips/math-use-builtins-ffs.h | 2 ++ >> 1 file changed, 2 insertions(+) >> create mode 100644 sysdeps/mips/math-use-builtins-ffs.h >> >> diff --git a/sysdeps/mips/math-use-builtins-ffs.h b/sysdeps/mips/math-use-builtins-ffs.h >> new file mode 100644 >> index 0000000000..78b3f14fae >> --- /dev/null >> +++ b/sysdeps/mips/math-use-builtins-ffs.h >> @@ -0,0 +1,2 @@ >> +#define USE_FFS_BUILTIN (__mips_isa_rev >= 1) >> +#define USE_FFSLL_BUILTIN (__mips_isa_rev >= 1) In fact you need to include since gcc only defines __mips_isa_rev for -mips32 or higher.