Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1274980

Re: [GIT PULL] optimize 64-by-32 ddivision for constant divisors on 32-bit machines

From Arnd Bergmann <arnd@arndb.de>
Newsgroups linux.kernel
Subject Re: [GIT PULL] optimize 64-by-32 ddivision for constant divisors on 32-bit machines
Date 2015-11-22 23:20 +0100
Message-ID <qxL9f-1sn-9@gated-at.bofh.it> (permalink)
References <qvDfP-6Ck-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Monday 16 November 2015 20:20:38 you wrote:
> Arnd,
> 
> Please pull the following branch:
> 
> 	git://git.linaro.org/people/nicolas.pitre/linux div64
> 
> This contains those patches I've initially posted here:
> 
> 	https://lkml.org/lkml/2015/11/2/715
> 
> Only changes to those posted patches are cosmetic improvements such as 
> the use of ilog2() replacing the custom __div64_ffs(). Exposure in 
> linux-next would be a good thing.
> 
> I also included fixes for a couple do_div() misuses that an allyesconfig 
> build turned up after switching ARM to the generic do_div() code.  
> Those patches have been posted separately and addressed to relevant 
> maintainers. They are included here until/unless those maintainers 
> include those patches in their tree.
> 
> Original cover letter:
> 
> This is a generalization of the optimization I produced for ARM a decade
> ago to turn constant divisors into a multiplication by the divisor
> reciprocal. Turns out that after all those years gcc is still not
> optimizing things on its own for that case.
> 
> This has important performance benefits as discussed in this thread:
> 
> 	https://lkml.org/lkml/2015/10/28/851
> 
> This series brings the formerly ARM-only optimization to all 32-bit
> architectures using C code by default.  The possibility for the actual
> multiplication to be implemented in assembly is provided in order to get
> optimal code.  The ARM version can be used as an example implementation
> for other interested architectures to implement.

I'm now getting a build regressing with the attached randconfig configuration,
when compiling drivers/net/wireless/iwlegacy/common.o:

drivers/built-in.o: In function `il_send_rxon_timing':
:(.text+0xbbac80): undefined reference to `__aeabi_uldivmod'
:(.text+0xbbac9c): undefined reference to `__aeabi_uldivmod'
:(.text+0xbbacdc): undefined reference to `__aeabi_uldivmod'
:(.text+0xbbadc8): undefined reference to `__aeabi_uldivmod'
:(.text+0xbbadf8): undefined reference to `__aeabi_uldivmod'
:(.text+0xbbae3c): more undefined references to `__aeabi_uldivmod' follow
drivers/built-in.o: In function `il_send_rxon_timing':
:(.text+0xbbb11c): undefined reference to `____ilog2_NaN'

I've verified that this goes away if I turn off CONFIG_PROFILE_ALL_BRANCHES,
and it only shows up with gcc-5.0 through gcc-5.2.1, but not 4.9.3.

Aside from those, I have not been able to reduce the failure scenario.

Also, I have only tested on ARM32, no idea if this shows up elsewhere.

	Arnd

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[GIT PULL] optimize 64-by-32 ddivision for constant divisors on  32-bit machines Nicolas Pitre <nicolas.pitre@linaro.org> - 2015-11-17 02:30 +0100
  Re: [GIT PULL] optimize 64-by-32 ddivision for constant divisors on 32-bit machines Arnd Bergmann <arnd@arndb.de> - 2015-11-19 17:30 +0100
    Re: [GIT PULL] optimize 64-by-32 ddivision for constant divisors on  32-bit machines Nicolas Pitre <nicolas.pitre@linaro.org> - 2015-11-20 01:30 +0100
      Re: [GIT PULL] optimize 64-by-32 ddivision for constant divisors on 32-bit machines Arnd Bergmann <arnd@arndb.de> - 2015-11-20 13:30 +0100
        Re: [GIT PULL] optimize 64-by-32 ddivision for constant divisors on  32-bit machines Nicolas Pitre <nicolas.pitre@linaro.org> - 2015-11-20 14:30 +0100
  Re: [GIT PULL] optimize 64-by-32 ddivision for constant divisors on 32-bit machines Arnd Bergmann <arnd@arndb.de> - 2015-11-22 23:20 +0100
    Re: [GIT PULL] optimize 64-by-32 ddivision for constant divisors on  32-bit machines Nicolas Pitre <nicolas.pitre@linaro.org> - 2015-11-22 23:30 +0100
      Re: [GIT PULL] optimize 64-by-32 ddivision for constant divisors on 32-bit machines Arnd Bergmann <arnd@arndb.de> - 2015-11-23 09:00 +0100
        Re: [GIT PULL] optimize 64-by-32 ddivision for constant divisors on  32-bit machines Nicolas Pitre <nicolas.pitre@linaro.org> - 2015-11-23 16:00 +0100
          Re: [GIT PULL] optimize 64-by-32 ddivision for constant divisors on  32-bit machines Nicolas Pitre <nicolas.pitre@linaro.org> - 2015-11-23 17:10 +0100
            Re: [GIT PULL] optimize 64-by-32 ddivision for constant divisors on 32-bit machines Arnd Bergmann <arnd@arndb.de> - 2015-11-23 17:20 +0100
              Re: [GIT PULL] optimize 64-by-32 ddivision for constant divisors on  32-bit machines Nicolas Pitre <nicolas.pitre@linaro.org> - 2015-11-23 17:40 +0100
              Re: [GIT PULL] optimize 64-by-32 ddivision for constant divisors on  32-bit machines Nicolas Pitre <nicolas.pitre@linaro.org> - 2015-11-24 06:40 +0100
                Re: [GIT PULL] optimize 64-by-32 ddivision for constant divisors on 32-bit machines Arnd Bergmann <arnd@arndb.de> - 2015-11-24 14:30 +0100
                Re: [GIT PULL] optimize 64-by-32 ddivision for constant divisors on  32-bit machines Nicolas Pitre <nicolas.pitre@linaro.org> - 2015-11-24 17:50 +0100

csiph-web