From nobody Mon Jun 24 07:28:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4W701D57fGz5NWts; Mon, 24 Jun 2024 07:28:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W701D2Yc9z4Th4; Mon, 24 Jun 2024 07:28:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719214080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GIVhpgIPDKATWzGf+S+nUonw5aHYNkuA85/eOK7sYdo=; b=WAnqv3LOTTl5SiF1JXAiHfqjS6XD7Oq5dpsmjOKMmSHk9GVT02jd1hHRNt2+eCx57ClPu2 K2iuHzoLejUgmzvQ5yPFBeFZQPJdt7jSDLrVZlLVTbcceAMZrA0oKMStBe0qCSi/cEEQh0 vo0MHbEdCsh30KqYWWKuy2JVPRwUhSMXrfxiTJlqxqMYKLNj/3hDOqk1OiTVwIF7Te1tQQ FbVkvLhJyH+v0asdvZYVoR2vbocWbKmtfwJJG0D0kKDmUBiW7HytYlTh93kkDBusrKQVU3 iDg2EVru3X672w8Z9ertDrzfjvyKyxQJUGYStiWsGVsKpeRRbgLRjoogW2g4xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719214080; a=rsa-sha256; cv=none; b=sbPSrAjzIGEnCbUG+G5Lj6jwIPtb8hcTPgKciQfCE0LFO8plfeK1YQH1EayDwiRZTyDlXN 9Kir/lv5I3NOR7TGQoUnDbnWXpTKYo4zYIRo6wXB5lSpktXbIAEfnOf4847aOmhQ5uZPzD od7xz4O4ERhP2k7KF+XAjq1mLCHY512MrqajTwnuFmKfsi7WOsJADbtc5MTIM4GNsacPXX d2fOycOhuuH4d2ywyN1mXTHrtDnbn9Fj8KL1DeFzxhxtKimihmaAIaly/7kgcu/J1y0JWr 5ekCNLkkYffvIfrGUdl3NKQx3Z3gfSe+oVe09rXvRF28cngQ4QWpwhYRuXb1kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719214080; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GIVhpgIPDKATWzGf+S+nUonw5aHYNkuA85/eOK7sYdo=; b=toBobY23ruOMTw2sOFYtywsOv6+yp90vV2GDlBTWKnY+RGBbDE0RHlP3oGhIC4Xm7IggBA 31kqh6u11VaRx764DQrAX0SSEBHVu6FyW9Dfqr3xEaPJ+7MO4+5sNBjHaKTDoFkmf6L50a gM/BCZhJNEO5Dz6ANL/ZYs11ETGuVPR6ZEqd2fSYdMETgnLUYA0Br8Zlqizce8x07KhfEK CLovsP6F5qdp6hXtaBaiqvQkEpNnctG4w7Pdh/QX6M0+FNnyd+ur/OgkCH7KJk5wNBgM0C AZM9Fy3jbs5aQBVrbpFpahRlY3rkOYxZA/NWQN62o7zmJdoS/heNxdXbMI9s7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4W701D23jWz17qG; Mon, 24 Jun 2024 07:28:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45O7S0AO044608; Mon, 24 Jun 2024 07:28:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45O7S0fT044605; Mon, 24 Jun 2024 07:28:00 GMT (envelope-from git) Date: Mon, 24 Jun 2024 07:28:00 GMT Message-Id: <202406240728.45O7S0fT044605@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 5dbf886104b4 - main - x86: use order_base_2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5dbf886104b45fea255987ee2ae4828b8d002ffe Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=5dbf886104b45fea255987ee2ae4828b8d002ffe commit 5dbf886104b45fea255987ee2ae4828b8d002ffe Author: Doug Moore AuthorDate: 2024-06-24 07:26:23 +0000 Commit: Doug Moore CommitDate: 2024-06-24 07:26:23 +0000 x86: use order_base_2 Use order_base_2 in place of expressions involving fls. Reviewed by: alc, markj Differential Revision: https://reviews.freebsd.org/D45536 --- sys/amd64/vmm/x86.c | 2 +- sys/x86/x86/mp_x86.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/amd64/vmm/x86.c b/sys/amd64/vmm/x86.c index aa8f87c98fe8..1167652d88ea 100644 --- a/sys/amd64/vmm/x86.c +++ b/sys/amd64/vmm/x86.c @@ -67,7 +67,7 @@ static __inline int log2(u_int x) { - return (x == 0 ? -1 : fls(x - 1)); + return (x == 0 ? -1 : order_base_2(x)); } int diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c index 3c08f7fa987d..0a683b3e841a 100644 --- a/sys/x86/x86/mp_x86.c +++ b/sys/x86/x86/mp_x86.c @@ -189,7 +189,7 @@ static __inline int mask_width(u_int x) { - return (x == 0 ? -1 : fls(x - 1)); + return (x == 0 ? -1 : order_base_2(x)); } /*