From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King - ARM Linux Subject: Re: [RFC/PATCH 0/3] ARM: Use udiv/sdiv for __aeabi_{u}idiv library functions Date: Tue, 24 Nov 2015 12:23:08 +0000 Message-ID: <20151124122308.GB8644@n2100.arm.linux.org.uk> References: <1448068997-26631-1-git-send-email-sboyd@codeaurora.org> <20151124001306.GI19156@codeaurora.org> <20151124085349.GQ19156@codeaurora.org> <4485320.CGMJdfZLya@wuerfel> <20151124104225.GA8644@n2100.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= Cc: Arnd Bergmann , linux-arm-kernel@lists.infradead.org, Stephen Boyd , Nicolas Pitre , Peter Maydell , "linux-arm-msm@vger.kernel.org" , Daniel Lezcano , lkml - Kernel Mailing List , Steven Rostedt , Christopher Covington List-Id: linux-arm-msm@vger.kernel.org On Tue, Nov 24, 2015 at 12:10:02PM +0000, M=E5ns Rullg=E5rd wrote: > Russell King - ARM Linux writes: >=20 > > On Tue, Nov 24, 2015 at 11:38:53AM +0100, Arnd Bergmann wrote: > >> I suggested using -mcpu=3Dcortex-a15 because there are old gcc ver= sions > >> that don't know about -march=3Darmv7ve or -march=3Darmv7-a+idiv ye= t, but > >> that do understand -mcpu=3Dcortex-a15. > > > > That's not all. The bigger problem is that there are toolchains ou= t > > there which accept these options, but do _not_ support IDIV in eith= er > > ARM or Thumb mode. I'm afraid that makes it impossible to add this > > feature to the mainline kernel in this form: we need to run a test > > build to check that -march=3Darmv7ve or what-not really does work > > through both GCC and GAS. >=20 > If the compiler accepts the option but doesn't actually emit any div > instructions, is there any real harm? That's not what I've found. I've found that asking the assembler to accept idiv instructions appears to be ignored, which is something completely different. =46urther to this, what it comes down to is the stupid idea that the compiler should embed .arch / .cpu in the assembly output, which has the effect of overriding the command line arguments given to it via -Wa. So, giving -Wa,-mcpu=3Dcortex-a15 is a total no-op, because the first thing in the assembly output is: .arch armv7-a which kills off any attempt to set the assembly level ISA from the command line. It does appear after all that Ubuntu 14.04 does support sdiv/idiv with -mcpu=3Dcortex-a15, but there is no -march=3Darmv7ve. --=20 =46TTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. From mboxrd@z Thu Jan 1 00:00:00 1970 From: linux@arm.linux.org.uk (Russell King - ARM Linux) Date: Tue, 24 Nov 2015 12:23:08 +0000 Subject: [RFC/PATCH 0/3] ARM: Use udiv/sdiv for __aeabi_{u}idiv library functions In-Reply-To: References: <1448068997-26631-1-git-send-email-sboyd@codeaurora.org> <20151124001306.GI19156@codeaurora.org> <20151124085349.GQ19156@codeaurora.org> <4485320.CGMJdfZLya@wuerfel> <20151124104225.GA8644@n2100.arm.linux.org.uk> Message-ID: <20151124122308.GB8644@n2100.arm.linux.org.uk> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, Nov 24, 2015 at 12:10:02PM +0000, M?ns Rullg?rd wrote: > Russell King - ARM Linux writes: > > > On Tue, Nov 24, 2015 at 11:38:53AM +0100, Arnd Bergmann wrote: > >> I suggested using -mcpu=cortex-a15 because there are old gcc versions > >> that don't know about -march=armv7ve or -march=armv7-a+idiv yet, but > >> that do understand -mcpu=cortex-a15. > > > > That's not all. The bigger problem is that there are toolchains out > > there which accept these options, but do _not_ support IDIV in either > > ARM or Thumb mode. I'm afraid that makes it impossible to add this > > feature to the mainline kernel in this form: we need to run a test > > build to check that -march=armv7ve or what-not really does work > > through both GCC and GAS. > > If the compiler accepts the option but doesn't actually emit any div > instructions, is there any real harm? That's not what I've found. I've found that asking the assembler to accept idiv instructions appears to be ignored, which is something completely different. Further to this, what it comes down to is the stupid idea that the compiler should embed .arch / .cpu in the assembly output, which has the effect of overriding the command line arguments given to it via -Wa. So, giving -Wa,-mcpu=cortex-a15 is a total no-op, because the first thing in the assembly output is: .arch armv7-a which kills off any attempt to set the assembly level ISA from the command line. It does appear after all that Ubuntu 14.04 does support sdiv/idiv with -mcpu=cortex-a15, but there is no -march=armv7ve. -- FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.