Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: David Daney <ddaney.cavm@gmail.com>
To: "Måns Rullgård" <mans@mansr.com>
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
Subject: Re: [RFC PATCH] MIPS: optimise 32-bit do_div() with constant divisor
Date: Fri, 07 Nov 2014 10:35:10 -0800	[thread overview]
Message-ID: <545D10DE.5000804@gmail.com> (raw)
In-Reply-To: <yw1x389vjbsm.fsf@unicorn.mansr.com>

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

  reply	other threads:[~2014-11-07 18:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06 16:23 [RFC PATCH] MIPS: optimise 32-bit do_div() with constant divisor Mans Rullgard
2014-11-06 17:08 ` David Daney
2014-11-06 17:42   ` Måns Rullgård
2014-11-07  0:50 ` Ralf Baechle
2014-11-07  2:20   ` Måns Rullgård
2014-11-07 11:35     ` Ralf Baechle
2014-11-07 15:00       ` Måns Rullgård
2014-11-07 18:35         ` David Daney [this message]
2014-11-08  2:18           ` Måns Rullgård
2015-01-11  5:05 ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=545D10DE.5000804@gmail.com \
    --to=ddaney.cavm@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=mans@mansr.com \
    --cc=ralf@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox