Re: [RFC PATCH] MIPS: optimise 32-bit do_div() with constant divisor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/07/2014 07:00 AM, Måns Rullgård wrote:
[...]

As for access to hi/lo, I tried to explicitly put a variable in the lo
register.  Which sort of works for very simple cases but as expected it's
easy to get GCC to spill its RTL guts because it runs out of spill
registers.  It maybe can be made to work but I'd feel nervous about its
stability unless a GCC guru approved this method.

The "x" constraint can be used to move a double-word to/from the hi/lo
registers.  On DSP targets, the "ka" constraint provides access to the
three additional hi/lo pairs while on a non-DSP targets it degenerates
to "x".  The "ka" constraint is available since gcc 4.3.0.  I see no
reason not to allow this extra flexibility.


What would the performance penalty be to hand code the assembly so that only mips32 instructions are used (i.e. no MADD), and transfers from hi/lo were all explicitly coded so that there were no hi/lo register constraints, but only clobbers of "hi", "lo"?

That would give you something usable on any 32-bit CPU with any version of GCC.

David Daney





[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux