From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id F00893858D1E for ; Mon, 5 Feb 2024 14:19:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F00893858D1E 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 F00893858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::635 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707142766; cv=none; b=J+rt4JLh8+A+8Uo6suIL50rTgIVgwthIedbrkcicrHH+9v6efrdfd6JLRaFrt9vNdC5xQxzkd8gCHbM86cNGHTEr6lgIvpJdzLZGWvrTrQYYgFjAKMbWpfaeuEh7T4r//oOCLseFWJLYmE4erUjm3KAWZZs3/OuuU4quRt9t5zM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707142766; c=relaxed/simple; bh=ZJkD1lqAX6EfKtzJjjb90Ws3oOqpReamL9ehsfmojmg=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=DzreGCUiNebkAqfXQvrob2SSqaOnwAgIAVxwrba051dsKAOlIqjyVQUXoi/yoeY9gFvCjCN4/t+EdlP7NtR1HzzLGiNswxc8NERsd4mZC3A3Air7J7m/QF1IyV5zZ58TcHJ8MoKM+zgchTzsVsRYSIUeA0i5XWsB+OKPRfPA5U8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1d94b222a3aso36246715ad.2 for ; Mon, 05 Feb 2024 06:19:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707142764; x=1707747564; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ZZGyP3KO9zurAKdzwLSxXkL/rgBexGUgMrvieY/D9dw=; b=zxEh3SSXQj+oITg9anC5/NwQhIbDZvQzti6Pipfgj/ycnjbgNCNFLeyGDciSKdvjhf EpT6JZKcMf7QufBOxnFut9PWTOtn1EwjF4IUy9I/PQ0Valdf1NIaG0M+OMSSxbdOCGBE IdmT8A51vS78/XderWOCCcvlWJVX/+i8ZRkEqsi4+c5CkgDLPR8A1E7fIpuZLY0/Nobd 6Mv0hpOtb9jO9n8N4XgzSyhaucMzKVkvqwbb8OQKNCxr7nmpk2pLZbAsKWUCKfrZDdmf mzSxDpa/fVHbsllbJ0K4y4+mnEqmRMAN+AcTAGYoKZsSTEC4oQ8tKY67QYohpHAAGCO4 bzJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707142764; x=1707747564; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZZGyP3KO9zurAKdzwLSxXkL/rgBexGUgMrvieY/D9dw=; b=T8S39wH+2XQCXDx9GPmvu7UgQdeqwHd7YlezCDqa5B28F97+0LrY7NPvP3DqfDLCfa ASUSAR2cICzjXxc+05WCOh4cma7IMEYoe9a3WY+Dajm/LqV7SjHUAT8RiuHC7/eAqFj+ bZSykdWTlk/VR7CCYBxbGl7earD+BNJLyC4TzI43Jgl5qxNWZVRIGZxkQYxqP1WCVjFp Nlhtx43MQFVRt1ViJ5/Qfdy3z5KA/HvrGEAoaYw70TZvq2SpD07e5pHA4CA+mrEDB7Wi CyNFgK9i9S8Oz01mfcIZD39qFbJiAELVk5rusChFR0lxoEn1ZKsuDBWiCpHTQ+FEJ1/N nRZA== X-Gm-Message-State: AOJu0YwYsFuPNH/rbkT9hbn8TtbybTd7PT7rLl3Q+kjq9N0e9Nhh3FY2 Mo4AAzEo2xEtdJLu//culEe4ZI2VDUkDHXxfzGTq1EWpvTQU1Fws8TvBl5uZWM8rzjbDXqQQYZJ d X-Google-Smtp-Source: AGHT+IFJWaCzecBbToZWZFFrJbOQ4BXHyTcDv2pOIO4nlZgkE48OQDi7trivKTaqFA4kNaRwgwS1SQ== X-Received: by 2002:a17:902:6b46:b0:1d9:3bb5:2819 with SMTP id g6-20020a1709026b4600b001d93bb52819mr11639720plt.34.1707142763954; Mon, 05 Feb 2024 06:19:23 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCWIRegqfn6INxP0fVU9pkA56SXx5lHADEZvIPJmRrOK2kp+IWlVLi0BylsapnvRqlcGFld7v+w+sZnp3tDBXTz8dUbL+M7rMWRf 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 iw2-20020a170903044200b001d93f4f0473sm6400781plb.220.2024.02.05.06.19.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Feb 2024 06:19:23 -0800 (PST) Message-ID: Date: Mon, 5 Feb 2024 11:19:20 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] mips: Use builtins for ffs and ffsll Content-Language: en-US To: Junxian Zhu , libc-alpha@sourceware.org References: <20240204101132.653-2-zhujunxian@oss.cipunited.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <20240204101132.653-2-zhujunxian@oss.cipunited.com> 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 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)