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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D048CC5478C for ; Mon, 4 Mar 2024 13:49:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:Cc:To:From:Date:References: In-Reply-To:Message-Id:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=R2nwcb60KSZiA2yIG9wTf7Pxs7BaJlFEEo17C62oQVQ=; b=LmlGSl+CzXnGJT jYdZJIou+qwLm5bbSF3m6Whhh97m8lZw31ZjjZzhjdfjnPKCKCdUCeBzEtEktSzyPNBtSxpI7f58/ CN8vjRCfLMIxjZ+he0Z4o9Sbs8kgo/vrSaDwX4nKJIUjUspS2TpjK2nyEtc0FQtgMWI/uEv4fpVJS BR0PVFAOCFHMUpIYcxpEAvjsMsyNvoHg/MO+dXXkFeJkReMnccuf55n0gSPf2r9pn/Q0z0KQK3E+D CVMynheM4uk4UBejo177HceyUDqFxPP8ULvJJkXIXIaHOtj/KAusrvndN414BtiBDDZOwBtSpDh+n otghf5hMzcodL3MSlTsw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh8h0-00000009EPG-1EHI; Mon, 04 Mar 2024 13:49:22 +0000 Received: from fout5-smtp.messagingengine.com ([103.168.172.148]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh8gx-00000009EMh-0znw for linux-arm-kernel@lists.infradead.org; Mon, 04 Mar 2024 13:49:20 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id D5B5C138010B; Mon, 4 Mar 2024 08:49:17 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Mon, 04 Mar 2024 08:49:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1709560157; x=1709646557; bh=BRaQGMUhZF +5gvPmzCZj10RTFRpRoCHi8lIQAFa6I38=; b=AmWRSk25knneYEOIKlZQ9P4pod w7Zzklals0aZcGl24S0l5doNkX4rUc+l/jiTAnJ/Xu98d07n5cwfJjFcHjGU+0H3 4KWQcEyS9eesEKaQ4qvMetqJC3l60ZMQ0EMx6kHOWPNU3eIBPrmgNXq+JdokN/fC mDnl/nlvqVNSaJUKopHul8y4fnIdnUNdtIVOjHwiBPrDzTXUR/xsEr08hOeDcXN6 aPhMTbEyA0gc74n/Jy4DyzcQ94hW7d8+IHuQS8lBDd6t3WEcdQomwnKRTl9tKEhD U17Es/Ue/hGgfpc2nD/JwwsM6gQ4gKnzoslNEeHTYlyvG1PwnnjLHSpyZeBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1709560157; x=1709646557; bh=BRaQGMUhZF+5gvPmzCZj10RTFRpR oCHi8lIQAFa6I38=; b=VAgEIm/0E/dM3PQQEGcKjdRAkjB52xCRMiOmUHipXPF6 EOjCeHBFpV2jWZSMmSh9YRunduraSrgp0nFYo7MpzsPyFvOv5bMeDohJYa8chrBw CcgjFk2vHzMCs8pm0IaZ8u+DFTY4AFd+zF55rtpDE89bTaa0jmAXsgw0CGc2+RpH bxPz5scghGuO8wLvtNzkqnkPXutoJKXAX06OJDOWRXQmYzeBc2C3H4NIqdQq1WOj ttakdq2RKGiz9c/5s1H28skDrExUU3kkMJV5lSNjk+R/DeLc8DKa7Q+mV03XTScq wxfcNb0bwfb3Nn3OhkV3ePgtB0ZssPOsut5T/rttIA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrheejgdehhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedtkeet ffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrh hnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 9AD75B6008D; Mon, 4 Mar 2024 08:49:17 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-205-g4dbcac4545-fm-20240301.001-g4dbcac45 MIME-Version: 1.0 Message-Id: <61aa333f-aa13-4068-b73f-eeae615f4640@app.fastmail.com> In-Reply-To: References: <338c89bb-a70b-4f35-b71b-f974e90e3383@app.fastmail.com> <20240304112441.707ded23@donnerap.manchester.arm.com> <1baf9a7f-b0e4-45d8-ac57-0727a213d82d@app.fastmail.com> <20240304114546.4e8e1e32@donnerap.manchester.arm.com> Date: Mon, 04 Mar 2024 14:48:56 +0100 From: "Arnd Bergmann" To: "Ard Biesheuvel" Cc: "Andre Przywara" , "Naresh Kamboju" , "open list" , "Linux ARM" , linux-sunxi@lists.linux.dev, dri-devel@lists.freedesktop.org, lkft-triage@lists.linaro.org, "Maxime Ripard" , "Dave Airlie" , "Dan Carpenter" Subject: Re: arm: ERROR: modpost: "__aeabi_uldivmod" [drivers/gpu/drm/sun4i/sun4i-drm-hdmi.ko] undefined! X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_054919_442452_D4980279 X-CRM114-Status: GOOD ( 15.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Mar 4, 2024, at 14:01, Ard Biesheuvel wrote: > On Mon, 4 Mar 2024 at 13:35, Arnd Bergmann wrote: >> On Mon, Mar 4, 2024, at 12:45, Andre Przywara wrote: >> It's not critical if this is called infrequently, and as Maxime >> just replied, the 64-bit division is in fact required here. >> Since we are dividing by a constant value (200), there is a good >> chance that this will be get turned into fairly efficient >> multiply/shift code. >> > > Clang does not implement that optimization for 64-bit division. That > is how we ended up with this error in the first place. I meant it will use the optimization after the patch to convert the plain '/' to div_u64(). > Perhaps it is worthwhile to make div_u64() check its divisor, e.g., > > --- a/include/linux/math64.h > +++ b/include/linux/math64.h > @@ -127,6 +127,9 @@ > static inline u64 div_u64(u64 dividend, u32 divisor) > { > u32 remainder; > + > + if (IS_ENABLED(CONFIG_CC_IS_GCC) && __builtin_constant_p(divisor)) > + return dividend / divisor; > return div_u64_rem(dividend, divisor, &remainder); > } I think the div_u64()->do_div()->__div64_const32()->__arch_xprod_64() optimization in asm-generic/div64.h already produces what we want on both compilers. Is there something missing there? Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel