From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 CA59B3570D0 for ; Mon, 19 Jan 2026 19:03:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768849426; cv=none; b=YfkFxgNomZrjTJDrrUXul2xUj2SStB6zdiYBgApDp19ieYrSxBgqp924o/gCBUvGdjBA6LXZVmR5D5QOqXPvEE+ow0Xd5shkFaBXwMZp4TXV3PLSbBlRZem+hiu2sQv6vyRS/3uw1lVFro768g1RSFwI3np4RG28kvploE2mZXA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768849426; c=relaxed/simple; bh=2VRfUNjAqvrq2v9ryLdJwLkWzIKgoDamqeHq0hKtcLA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=COfrZj8O0HdsmdAVja2qADeBw+sCFhfs3AkGMjha8Xj4RqAyzTFx16eZhO6cWs2QzBcP9C8q6TA9li1USyXuc1z1ygLs5U20Tkj2o+d8svuOJxAdFuEXZQLrSEPlwk/kcfUUW3xTs/GWDj8dm9SewslUNQN95K0EnYD436AAlmY= 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=Gj+UESCg; arc=none smtp.client-ip=209.85.221.46 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="Gj+UESCg" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-4327778df7fso2904433f8f.3 for ; Mon, 19 Jan 2026 11:03:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768849423; x=1769454223; 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=DRuqk5TCfryJ7Ik6jtbOGaU5nqofmByN3gyzEY2WCA8=; b=Gj+UESCgH7xsp3Ov7MMfLTJnFI+yPoCfGNjP85Ui4NLHOjyip6e5SsV15Y+sKMwnLv ae1YJm6mQTeKj2fYpVDPk/OvdLzTE38MXnmicOMXPzdRWiynqV0F8M8hYn/B80Fk2+zO eBaS1vPwC2s9xYpB8+AWuuYmeYZOFX7tO2zNnOZ7xG1OeuURihDy6QrTblD83j/SkdXH ezl0gpK3e8lxpA7Q/2KP5ZgLpl9NyNcl+1I+nJkZBV/kGlJAq7cs2RMNKDk1xnsCCz8G jE9QQ7cDN7ymvhthOIFyXw/OuCix2CPRshe1eOO7xW9FTWd4p1LiXoad7JXx8BNWvLyv RqJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768849423; x=1769454223; 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=DRuqk5TCfryJ7Ik6jtbOGaU5nqofmByN3gyzEY2WCA8=; b=F/rl7cr5U/ltDEdzHT1A8dfDTQ/VvsBK7LL7Mdme7RzpY+ErjBYjzjymLoaFLzFGn5 js8AeG5uofr+LeBGuUTLXh6uL9vnSmBKbboX1IeCUXzSSNkeVQs0WTSPRRKdo7/hYD4V /EtDBb3rvELD7FTqyNTFGq4YiBrHK0brrehsCoY0cfXXzXRgXp60XQCgr1DG+bBm48VK pWb4zviYh90i3r7BCxtin9smwXkgUZTwxI3c8dcKTnT2vIttqr+KD0BbHV/9CR/9WdxN Z/ZQJJctN/aTPT+uo5PvMWMfhO7sLTmz2XvBpRvsq9gpFtpVpIfoyrpvPDn4urZblZ3a Is9A== X-Forwarded-Encrypted: i=1; AJvYcCUBOrI6Qo+KY7WypR3mvZc2hKHZPdVyVccb2WQu+mWk1nF6X7VxRvR9muAUorqSmNxJ7b5VePGU3n9tA9Y=@vger.kernel.org X-Gm-Message-State: AOJu0YySjKU8UgZFABY6rdnMZ8e685Nr8I9SKfF6inzXuXVcWiFsNRn3 hae78Qa7Ak0x46epB/v2VM7yXvs9tuOCAQoBzHmUzYecIhcwn7GhXwkL X-Gm-Gg: AZuq6aIExSKRzkQD7ZjzDDUejYLfYe6zz+Bbl9sHo5OURqa3jcPJKFAKDwLneMtDZic zNiG+X/h+MCvV8wI6PSokS2EMCF1MOtYgLw3ywYDCQDfSiIozoBcgyDL09BsZZAWD3FinCJXvXJ 8eZK0NidUJHjsf4ebvm6egIAj3bRj89zBqHnkeR1Q6vYk4cQIMiqd/0SbOAfeww3R/Yv5nJfcL1 Ur/Ba2ZXnOaCvi8p7nH6qyOcEx4mGvdyeAZ9op0ZACr2vudcXEI1ZRPPzmEF9AosjIDJgrSZVVe BqWiptPLRos/hkM5HSzQdCWx8EFH4jWrYdRkCVl15zw3PKbeq2pQ5wmargkDNHQcaDSy1qu/B3w SMojugqfE+zZQZvV5i2jwqZZSYtq+SJDuLKKQKt7ctMEsHAktJPdviEITLJW1jU5dr+UlBCsQaa YSnCJ+FaGFSU4aTkflmUgJAD4EmSg6Z7amZTaGynF47FKtXUTOu3Z+ X-Received: by 2002:a05:6000:4202:b0:432:a9fb:68f8 with SMTP id ffacd0b85a97d-4356a02643dmr13808435f8f.1.1768849422955; Mon, 19 Jan 2026 11:03:42 -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 ffacd0b85a97d-4356999810bsm24831353f8f.40.2026.01.19.11.03.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jan 2026 11:03:42 -0800 (PST) Date: Mon, 19 Jan 2026 19:03:41 +0000 From: David Laight To: Nicolas Pitre Cc: Andrew Morton , Eric Dumazet , linux-kernel , netdev@vger.kernel.org, Jakub Kicinski , Eric Dumazet , Paolo Abeni Subject: Re: [PATCH] compiler_types: Introduce inline_for_performance Message-ID: <20260119190341.39c3d04c@pumpkin> In-Reply-To: <681985ss-q84n-r802-90pq-0837pr1463p5@syhkavp.arg> References: <20260118152448.2560414-1-edumazet@google.com> <20260118114724.cb7b7081109e88d4fa3c5836@linux-foundation.org> <20260118225802.5e658c2a@pumpkin> <681985ss-q84n-r802-90pq-0837pr1463p5@syhkavp.arg> 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 10:47:51 -0500 (EST) Nicolas Pitre wrote: > On Sun, 18 Jan 2026, David Laight wrote: > > > On 32bit you probably don't want to inline __arch_xprod_64(), but you do > > want to pass (bias ? m : 0) and may want separate functions for the > > 'no overflow' case (if it is common enough to worry about). > > You do want to inline it. Performance quickly degrades otherwise. If it isn't inlined you want a real C function in div.c (or similar), not the compiler generating a separate body in the object file of each file that uses it. That is just the worst of both worlds. > Numbers are in the commit log where I introduced that change. > > And __arch_xprod_64() exists only for 32bit btw. I wonder how much of a mess gcc makes of that code. I added asm functions for u64 mul_add(u32 a, u32 b, u32 c) calculating a * b + c without explicit zero extending any of the 32 bit values. Without that gcc runs out of registers and starts spilling to stack instead of just generating 'mul; add; adc $0'. I could only find the definition in the header file - may not have looked hard enough. But 64bit systems without a 64x64=>128 multiply (ie without u128 support) also need the 'multiply in 32bit chunks' code. And common code is fine with u128 support (ignoring old compilers that generate a call on 64bit mips even though it has exactly the instruction you want). David