From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63FD830EF9B for ; Sun, 18 Jan 2026 22:33:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768775604; cv=none; b=NUDDMlj9HhpOw5LGpm5XJ22MebTubqeZGVAMOeYYB5PSKfReHqNMrRwDlKA2A8DPZdOKe8AELjA1hs1g++tUad6VCcRxfyJhwe1rm7ZPk7ZexW1o6xtz2GrsduQhyDbox7uFJhtLwOYIl+W/mVVwW7+u8zdMhO76MRUdyHEmeiw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768775604; c=relaxed/simple; bh=2SA9QQ673KUOqHEy3/rqWkEDcs6dfPbhevlhyfQOLDI=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qc5r67GBb8EtUYVhwdn0CqdKmoYGC2Abc2N3BXoq8efDL2Pzh8FhbrWe4hc6DrX1fUuySPPvmc2Azr3CBuS+E3k59keW2hTjkJQvjKkblLVTr/ROCve7B87GaLdFrnnJ0S7PNnyBbhYqUNm4ah2aiIcjEdz41Gp90WVuo/Maj9Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PGQbiTFP; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PGQbiTFP" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-47eddddcdcfso17168155e9.1 for ; Sun, 18 Jan 2026 14:33:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768775601; x=1769380401; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=Cx9QpyQrvnFrvxngyHgURZOAcKI8WngXTJ0q+cPiikY=; b=PGQbiTFPC94Gcas40p7wRMZXkfgotCMR7be6qG0r2vhERXCGhHntav0iTbNqgIvIMZ Ct2n5amTeQZSqIrrh6xyqVpoo3rCc9JnKsWt0ebPH8Hdgm4A0oYyZ5034bBW51FnHaKX etgXigCaiE3foyYx1dAJN5HGxR0jVVVx7V5w6hVbSe6tDIdCYIwI6tnzt0pDb9IdBHmF RBVHQc14wxoCm5BqCFzazzCLZsFY1I+Hq+aYHqUSbOri3aqW+ppvFxDy0PKLRQaiXrTk FIy49boIi9HP9OB0VVkfaaTEkPTvboncxj9eMy94vLCPP3CNP9STYLU9KzcZuqxOK6jR UtZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768775601; x=1769380401; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Cx9QpyQrvnFrvxngyHgURZOAcKI8WngXTJ0q+cPiikY=; b=P3w7LhJpL+Qrdkp1CbaQfKs6npYKP1FCr8og+ppOC5IPh9wOT0Ce0kUuS4g2EcqwTS NcKTacyNzhLM/VgkNJ33HGpSxjGNqyrdZxskLC/xlsKX3Lw3egVZShSpvarNxJnIo+aI r5JB+ymLGEhjojnqLa7/nDCB/C9b6mTx8LR1pLiMif7EfD8W4blOm1QVfrRlN0czT8/S Q26TQGcuUfmvgL4ETH4DChCiTRdtV+m2xuZ9lWEaF/XSGpH4+fGEX8gVC7q/MRv7Z7Dg u3PA9FvCSZDlrPYSs4x0NqMuqC5CjAdmO7CvJrzOmCXOG/OOimpibFwzkxTQL+Z4YNLg Gq3g== X-Forwarded-Encrypted: i=1; AJvYcCWrsE2MS7rH5F6/v7LElp90B0yb2cyI1rnk536LEFMXHZKtlccjs3U3SwB2ClxiY62Swo/W4rp56nm/8A0=@vger.kernel.org X-Gm-Message-State: AOJu0YzDv4zjPrat5881dNiGINH5eT1r4CwgSaX3RNJEOM06uEX00efT G/XxoDywnMmJXqkWYAnc7pRO7e1iefNsaNMqciLRgzQ3h2Eyo66xszcU X-Gm-Gg: AY/fxX7mndzN08bept0F5WF+M3rqJHNOt2raYCjIQuZVLj+FIBhkeEDzcxAUxxqGQKA lm7v62ftRv+8D3Ob4TTU3azWDAv8ZuJAZq7Snxgvgr0jZRDVh83Rx7rZM7NrQAqQFICEDULOL6a iTq1UZFvssCyYeH2H9MXK830jzGc3Bz/11L/Cw85oZlKauWosN9EOAvqNKcGjJRQobX2xEptqzP fmJIkxhCxFDCCYHrdvRbO5zWigWhLQWN28WrS/eZWZQr2AHWEJFpMS1rXT6tE8oAquyysNbzJDc IoJkJAo0M58ucZ+bnjprLXPjJ+09M6B6lFrUpxeOAVCKi2OjcwhQnN2NIOyCCA0TpPxkSW3dKEy G28+RsBuOuAywPINICwsuGXNFHdGGqGCLcpxCHIQM9NUOTs9mZhwCmzr+S7hNcT2MqNmVvxWrJZ g+3FXVIBs2I/dSYQv/yTSnwWVrffPayqJ9tJmeAg7wX0F1dFXT1BMYoOTPUrS+xR8= X-Received: by 2002:a05:600c:474a:b0:477:9b4a:a82 with SMTP id 5b1f17b1804b1-4801eb14b36mr116131045e9.35.1768775600441; Sun, 18 Jan 2026 14:33:20 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47f4b2672d6sm218823515e9.14.2026.01.18.14.33.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Jan 2026 14:33:20 -0800 (PST) Date: Sun, 18 Jan 2026 22:33:18 +0000 From: David Laight To: kernel test robot Cc: Eric Dumazet , Andrew Morton , oe-kbuild-all@lists.linux.dev, Linux Memory Management List , linux-kernel , netdev@vger.kernel.org, Jakub Kicinski , Eric Dumazet , Paolo Abeni , Nicolas Pitre Subject: Re: [PATCH] compiler_types: Introduce inline_for_performance Message-ID: <20260118223318.7a3e3837@pumpkin> In-Reply-To: <202601190247.dDAvbbMH-lkp@intel.com> References: <20260118152448.2560414-1-edumazet@google.com> <202601190247.dDAvbbMH-lkp@intel.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 19 Jan 2026 02:36:18 +0800 kernel test robot wrote: > Hi Eric, ... > vim +/__arch_xprod_64 +138 include/asm-generic/div64.h > > 461a5e51060c93 Nicolas Pitre 2015-10-30 125 > f682b27c57aec2 Nicolas Pitre 2015-10-30 126 #ifndef __arch_xprod_64 > f682b27c57aec2 Nicolas Pitre 2015-10-30 127 /* > f682b27c57aec2 Nicolas Pitre 2015-10-30 128 * Default C implementation for __arch_xprod_64() > f682b27c57aec2 Nicolas Pitre 2015-10-30 129 * > f682b27c57aec2 Nicolas Pitre 2015-10-30 130 * Prototype: uint64_t __arch_xprod_64(const uint64_t m, uint64_t n, bool bias) > f682b27c57aec2 Nicolas Pitre 2015-10-30 131 * Semantic: retval = ((bias ? m : 0) + m * n) >> 64 > f682b27c57aec2 Nicolas Pitre 2015-10-30 132 * > f682b27c57aec2 Nicolas Pitre 2015-10-30 133 * The product is a 128-bit value, scaled down to 64 bits. > 00a31dd3acea0f Nicolas Pitre 2024-10-03 134 * Hoping for compile-time optimization of conditional code. > f682b27c57aec2 Nicolas Pitre 2015-10-30 135 * Architectures may provide their own optimized assembly implementation. > f682b27c57aec2 Nicolas Pitre 2015-10-30 136 */ > 5f712d70e20a46 Eric Dumazet 2026-01-18 137 static inline_for_performance > d533cb2d2af400 Nicolas Pitre 2024-10-03 @138 uint64_t __arch_xprod_64(const uint64_t m, uint64_t n, bool bias) > f682b27c57aec2 Nicolas Pitre 2015-10-30 139 { > f682b27c57aec2 Nicolas Pitre 2015-10-30 140 uint32_t m_lo = m; > f682b27c57aec2 Nicolas Pitre 2015-10-30 141 uint32_t m_hi = m >> 32; > f682b27c57aec2 Nicolas Pitre 2015-10-30 142 uint32_t n_lo = n; > f682b27c57aec2 Nicolas Pitre 2015-10-30 143 uint32_t n_hi = n >> 32; > 00a31dd3acea0f Nicolas Pitre 2024-10-03 144 uint64_t x, y; > f682b27c57aec2 Nicolas Pitre 2015-10-30 145 > 00a31dd3acea0f Nicolas Pitre 2024-10-03 146 /* Determine if overflow handling can be dispensed with. */ > 00a31dd3acea0f Nicolas Pitre 2024-10-03 147 bool no_ovf = __builtin_constant_p(m) && > 00a31dd3acea0f Nicolas Pitre 2024-10-03 148 ((m >> 32) + (m & 0xffffffff) < 0x100000000); Can that ever have got compiled? Won't the compiler complain about 0x100000000 being out of range? Lots of alternatives... If u128 exists this should probably just be: return ((u128)m * n + (bias ? m : 0)) >> 64; Which is probably the only alternative an architecture might provide (none do AFAICT). David