From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B3C5C43470 for ; Wed, 12 May 2021 20:51:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1EBDB61363 for ; Wed, 12 May 2021 20:51:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346287AbhELUr0 (ORCPT ); Wed, 12 May 2021 16:47:26 -0400 Received: from angie.orcam.me.uk ([78.133.224.34]:33044 "EHLO angie.orcam.me.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1387729AbhELUkB (ORCPT ); Wed, 12 May 2021 16:40:01 -0400 X-Greylist: delayed 915 seconds by postgrey-1.27 at vger.kernel.org; Wed, 12 May 2021 16:39:52 EDT Received: by angie.orcam.me.uk (Postfix, from userid 500) id A0F5392009C; Wed, 12 May 2021 22:38:24 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 92EAA92009B; Wed, 12 May 2021 22:38:24 +0200 (CEST) Date: Wed, 12 May 2021 22:38:24 +0200 (CEST) From: "Maciej W. Rozycki" To: Linus Torvalds cc: Naresh Kamboju , Greg Kroah-Hartman , open list , Shuah Khan , Florian Fainelli , patches@kernelci.org, lkft-triage@lists.linaro.org, Jon Hunter , linux-stable , Pavel Machek , Andrew Morton , Guenter Roeck , clang-built-linux , Thomas Bogendoerfer , Huacai Chen Subject: Re: [PATCH 5.12 000/677] 5.12.4-rc1 review In-Reply-To: Message-ID: References: <20210512144837.204217980@linuxfoundation.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 12 May 2021, Linus Torvalds wrote: > Note that this might just be a random effect of inlining or other > register allocation pressure details. > > So it's possible that upstream builds mostly by luck. > > The "couldn't allocate output register" thing really does seem more > like a compiler issue than a kernel source code issue. Nope, `x' is the constraint for the multiply-divide unit/MDU accumulator register used for calculation output; there's only one, comprised of the HI and LO parts. This register was removed as from the MIPSr6 ISA, which I forgot that we support (unlike the microMIPSr6 ISA), in favour to using regular GPRs, in a slightly different manner. Rather than cluttering code with #ifdefs for the updated MIPSr6 divide and modulo instructions I chose to rewrite this piece in plain C, which actually makes pre-MIPSr6 code slightly better owing to better instruction scheduling (the pre-MIPSr6 MDU runs asynchronously and its output is only interlocked on read access to the accumulator register). NB I don't know if Clang actually supports the `x' constraint even with pre-MIPSr6 code; as it has turned out it has deficiencies compared to GCC with inline asm handling with the MIPS target. OTOH GCC has supported it since ~1991 if memory serves me, when MIPS support was initially added. Maciej