From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 588694315F for ; Wed, 25 Feb 2026 22:09:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772057347; cv=none; b=IfSSmiHT5uSwQmfynIn9X3ZDMPtlxyOFBIXe+27fR6ryq6BhlFYuxAxAHj1yhvpswKXfHWMruglyHCoSZFzL2o/u43go0O0Y7YCnt6t1RXa5a90wLypL4Wl4X3/aINKiS01d2odBVYNXihZ1mwgLtXu26X3SCFNyCUo4qTvromg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772057347; c=relaxed/simple; bh=CtHLkXx9MzzgU2233OD3Hz9wcVY5abGXfKuaZonV9rs=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ttq56FPLWDG9kRpPH8ZI5ofb1mmTAP9IFAvjfrIpn/GqsfjP69XgAb27qHbu+vnYuCvY23bKDQ01t9EjcYVxgGBJq1aBLE9dztgRd+YKkFdJorofA6eEGUpIa+Vq+kJvK1DJ6jZeTiuKdCGhIDxx8mhDnsN0kr4+Ne211vhuEEQ= 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=El63MHEi; arc=none smtp.client-ip=209.85.128.50 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="El63MHEi" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-480706554beso3110945e9.1 for ; Wed, 25 Feb 2026 14:09:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772057345; x=1772662145; 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=GYc4O3OEv9nFWk5cDQQq1W8RHcCJ+Uk3zGoWPaAwrJk=; b=El63MHEipNiy0LEVtGmBYJQygcwyqXp4DvJKkjlow11jT1eORQVRGAmMnZyImDGElf jBdrT6J02lwVrLmPjdNl/zgIyWwNtHReHnw7IKI9hTqOQrNHc6IAtul3HNX58fB9JWj6 5n9JFyzepjttlAgjKaJla84z0+/bu2gK4+BRjEYa77eFGu1NtRKxOpADQZpA1QXERaDz okVWtgqg6BVj4JLLKtCfhRX8iXtcdDTy3K4KdvWqjpoKYUq2ctExZQ3W/5BrWXzTlpxG 7Cucew7sopcj3tDnRhjIN6yg9q9xIEQI/JVNgHt0zWsptOzX1HWEq39SxCGpFi+tns6k M8fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772057345; x=1772662145; 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=GYc4O3OEv9nFWk5cDQQq1W8RHcCJ+Uk3zGoWPaAwrJk=; b=vV3idWByF5/liQmLAIKS0tvrZOtOl2096zyijpaojwLk4qwPmWaPJxKNkG8diu5V22 /rUI9xrV0hMxi0JbkuhzDCoE2LNCATzCWPzjY8r+IvBbxdfxXRjm0Yn2Cqaow210i7OW /flwcZEjpgeUGIjy207P99m49bD0VfVWOSgC+LfEto7cGSS/otJvWEGgfpm0pAusaIrV WER68ekDhvDHvgZHqhevaNIddzUMUJarVqg0KB4LAN1ZNK/gZJbuGw8UhFArk5trGMWJ tw1U7EcM96dugf7FE0NcbjJ+GX0F1DmWmVF35CKF3xAlx/llTDDq/UPZ84+wtHNWuO83 9pZw== X-Forwarded-Encrypted: i=1; AJvYcCXZwEEzvwVabe9o2zwHmFUavT680F1oVBY0EjTfu10lDJOO6Y78K0JRXPJXRMHsIQ854bhRokXjs9tEhtU=@vger.kernel.org X-Gm-Message-State: AOJu0Yx9w/w9JDcuaTZI1BqqnTzpMILnZ3DTBGMN/TLLB3EF82zV05Ai WMxXeJEt37l+QezciPVfaRRJeysDrPKjwk83AEdZFyKTMaFwZ9QUlRBr X-Gm-Gg: ATEYQzwpHQyKdjeIKFRUAGcqdonuM2NjAMy19bPyQoV3NLKamSXOgfd9VCpi0EZedB4 N25tPYaYFacm8P82wCtLCw1/mJ/WODAX5xcK3Za3j4SNs/2egqzBjMXUQsn+lXCBqIr0OpqYZOg 3eKvkKTPzhYRbuRrvFAn5Fp6RHLuZLxV2Ufd7fhMl/JIJQb0RK66z4GUn8ZzzWRKGqFQIO/5HlM jctNpEoijKxEPUUZpXeeJ+OPCKL+gLKnX2Q/iHa1ANyQefOdeJuLB3cDuec76Tm03joKHEtnzPa RHSGOhsxaXJVgqIe8LzxTHNC+PGHSUUwwi92BLHdF+9+CqJj7qNjEebGXlAQErWGkpsjgO9I2Mm T7Y/4K5/knuiIVGRwqPC4Qepv8ILLfIDKERjhYDU8L19FBTeCKbDJgCY9YXm6Pl112PPE1JElNN JxFTWwY0MhjUHRSdv5WMQkYLjcmvEHkHFPFOOLsfFqYTTjwPbLkQjJ73Z59QnHASkiqrGTcDiHT 2Y= X-Received: by 2002:a05:600c:3acf:b0:47d:3ead:7440 with SMTP id 5b1f17b1804b1-483c21a9fb1mr30868215e9.32.1772057344418; Wed, 25 Feb 2026 14:09:04 -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-43970d4c982sm36589803f8f.31.2026.02.25.14.09.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Feb 2026 14:09:04 -0800 (PST) Date: Wed, 25 Feb 2026 22:09:03 +0000 From: David Laight To: Thomas =?UTF-8?B?V2Vpw59zY2h1aA==?= Cc: Willy Tarreau , linux-kernel@vger.kernel.org, Cheng Li Subject: Re: [PATCH v3 next 02/17] tools/nolibc: Optimise and common up the number to ascii functions Message-ID: <20260225220903.68e941f0@pumpkin> In-Reply-To: References: <20260223101735.2922-1-david.laight.linux@gmail.com> <20260223101735.2922-3-david.laight.linux@gmail.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=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 25 Feb 2026 22:40:29 +0100 Thomas Wei=C3=9Fschuh wrote: > On 2026-02-23 10:17:20+0000, david.laight.linux@gmail.com wrote: > > From: David Laight > >=20 > > Implement u[64]to[ah]_r() using a common function that uses multiply > > by reciprocal to generate the least significant digit first and then > > reverses the string. > >=20 > > On 32bit this is five multiplies (with 64bit product) for each output > > digit. I think the old utoa_r() always did 36 multiplies and a lot > > of subtracts - so this is likely faster even for 32bit values. > > Definitely better for 64bit values (especially small ones). > >=20 > > Clearly shifts are faster for base 16, but reversing the output buffer > > makes a big difference. > >=20 > > Sharing the code reduces the footprint (unless gcc decides to constant > > fold the functions). > > Definitely helps vfprintf() where the constants get loaded and a single > > call is done. > > Also makes it cheap to add octal support to vfprintf for completeness. > >=20 > > Signed-off-by: David Laight =20 >=20 > Applied, thanks. >=20 > Some changes I did: > * Do not use int128 for sparc on clang, as it will also use __multi3. > * Apply Willy's Ack from v1. Thanks. I thought I'd gone through looking for Acks - must have missed that one. David >=20 > (...)