From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 42E5F3C9453 for ; Mon, 30 Mar 2026 11:52:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774871525; cv=none; b=hNpZixVa9owZFkkcGZ0M51AU+e8vhYNI9xiAegL5N7bk2h8NfVnFKV2DULJK33ad66Um6YDX6qdtC2AlsKN2YfnuArwqrk1/KKMtiz4ndh7oruBV8IugSdEjHzeb7088KMHzWSm/RC23U1QkW/iXuX71uDEQyuBvNCbJdQZbEjw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774871525; c=relaxed/simple; bh=tZcULxHj5V0iA+N1C3dGSr9T38DlrHQP6YwqsGs0kkE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HCh5Z8bSk4l1aHkW9+jabImm0c46JP44OrtvhYzmI/JuOdr6NWVoRj7e+jVwFmyUiLHr/SU/c+hMXtnO4f5sQG0qVwxmE7Y3Qn6Fwwb2eylQlEPBDRtxbjy0EXFKhAWs/uLUlABG1n67IyEP9ylFKiGpKHDMddnseRZRHBNmERU= 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=eRoMQ4qZ; arc=none smtp.client-ip=209.85.221.47 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="eRoMQ4qZ" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-43cf5fbacc9so837492f8f.1 for ; Mon, 30 Mar 2026 04:52:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774871523; x=1775476323; 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=0jxUu8FUh9u9Ljj/yOQuXagWoNZOfHM1JD0/FDxW0pI=; b=eRoMQ4qZP95s0561zmqDf/oOa/r8lQq89gL7XMKF44f+vE99mLm4ujqy1Q09866mRc Gz2By5/ixrbeaOoi4ViigHlPGQOKmaZ3dMkoqRv7/0sgDZ2bWWL6Segj6H+C+VnKx3M5 cxxcBX8XmPZu3+V/4b37ToZ1R5YABwfSKZVC77Lq6g8g0Mmu+aCCV/zCNEygmuYotqSl tCTHhnu1eenbE2sjNkSS6XjjY+dECocs9DVS2WEoDF66Vg7XM1Zp8S2qtWBWqA0d2+xQ Ab0b6wdt/Enayazbv5jueSaSPj2faD3jrImNLeKLZwD2xxYVanbnglfimXGguCRCCizo HOOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774871523; x=1775476323; 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=0jxUu8FUh9u9Ljj/yOQuXagWoNZOfHM1JD0/FDxW0pI=; b=WwWFrgVCt3OJ21NJkYWIls6zNFhhl15dmEsSLNSQi1n44B6S0ux6OHA11QTP1JZPVG p5KLLJsvc1TJXoc8SjKpQe14QQBEuA1aoZYwX72oAkEAI9T7wC+rb0vCgsRwFQofoND9 I+h/qB1Ba41/2rSayNEZoEklggZ4qm7pOaKzZUAKEOjK2o0TKh1qUUGthb7Amxl/Gsqq tOtgi2FfShYCkDYKch3eFCJxHTQ7UytW9jwtNrCyPCXqzYGPrTqNZJCjoo/tRtOzLwqZ 7e3qtKwgyzFUnjxnbjNaI8b7SysGE7at21bdBNL6WHK+pI22uZ0uCkbYDEF2Ed1Jrnnp K4Zg== X-Forwarded-Encrypted: i=1; AJvYcCU+QmZiPD1pu+3e68nGp3A2Z+Zf0BuArT9D5NguuOMS6wmwNY7OfEqvKX8YfuIZ/x/UnseSCXGXwYiTJqQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzbJK4ZuCIOA0L7aXAyWRE1Tq/wfF+LlAvTC5ESKfzCg1ZVCqv9 87KX2oR+CPZl0fBOf85ifijNFhUQqyPPSO+NrFJpbutmuOn7pjwQcbXn X-Gm-Gg: ATEYQzxA27j433KX26USVkOB6nAwP9m6xIQ5Gp794NcOjjuKW+RC/iCQcTOwbUAjzDH QpLBeqH6LAbP1EkoCL0+b01RprCP2iKPFhRiR6tnQmeXhUG7aNhaWLpXlLGCwMhBWSiqniidRKZ aBs6fOJ/FykP6D6+kp7b3FTI1Ykyurj59oanOJTv0bgN+mmtS7aywoUFDiwh1e4G/LsWhwcGGK8 whzXoXM3xLqoQviezN3NdeJuWVJ0x6Ry+qiM4BoVqnBc1Ub8Thh5VCesaiFVuvwNKedmft3JMl0 4e8uqD2M0z1hSAwvLXeLihGM3TNe5pSQ4CrSfrc1O2ETQGFll6fbd2FfXlqi3LCFGPm1Nz2ycvb wRhBdN+j9Ii1nOczZqq7TKwPV5YmMFStc9HDgEhrd1YVO24Gu+87tQZeDq7vWRdYdJCmG1HZxuv WK8rgN5BV9DIAij+Tp2uisuXshLA4Q7mTYxRpTYCjlRrfXHmR7MPNeQgIBelNA X-Received: by 2002:a05:6000:208a:b0:439:c153:ae3d with SMTP id ffacd0b85a97d-43b979fbc99mr26341047f8f.6.1774871522357; Mon, 30 Mar 2026 04:52:02 -0700 (PDT) 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-43cf245e4f5sm19069266f8f.19.2026.03.30.04.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2026 04:52:02 -0700 (PDT) Date: Mon, 30 Mar 2026 12:52:00 +0100 From: David Laight To: "Maciej W. Rozycki" Cc: Thomas Bogendoerfer , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] MIPS: Fix the GCC version check for `__multi3' workaround Message-ID: <20260330125200.1cdd9994@pumpkin> In-Reply-To: References: <20260330104644.1da584e1@pumpkin> 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, 30 Mar 2026 11:09:43 +0100 (BST) "Maciej W. Rozycki" wrote: > On Mon, 30 Mar 2026, David Laight wrote: > > > Although it might be worth just deleting the version check. > > __multi3 is unconditionally defined for sparc64 and that is a much > > more complex function rather than the pretty trivial mips64 version. > > We want to catch invalid usage or we could just link with libgcc.a. That would pull in all sorts of expensive functions - like divides. One option would be have a 'u128 mul_u64_u64_u128(u64, u64)' function that architectures could define, defaulting to (u128)a * b. Similar definitions exist for mixed u64/u32 arithmetic on 32bit because gcc tends to make a proverbial 'pig's breakfast' of compiling it. (I've seen explicit multiplies by constant zeros that have been spilled to stack!) I recently improved/optimised the nolibc snprintf() code; that fell over the same problem (on both mips64 and sparc64) doing the div/rem by 10 using multiply by reciprocal. I'm not sure how the kernel snprintf() does the conversion - the entire function needs some TLC. (That would probably speed up things like 'cat /proc/interrupts'.) David > > Maciej >