On 19 March 2007 17:03, Ulrich Weigand wrote:

> Dave Korn wrote:
> 
>> (define_insn "mulsi3"
>>   [(set (match_operand:SI 0 "register_operand" "=d")
>>         (mult:SI (match_operand:SI 2 "register_operand" "r")
>>                  (match_operand:SI 1 "register_operand" "a")))
>>    (clobber (match_scratch:SI 3 "b"))]
> 
> You should be using "=b" to designate the operand as *output* only.
> 
> Otherwise, reload will attempt (unsuccessfully) to load up "scratch:SI"
> as input value ...

  :)  Thanks!  I guess that even makes a reasonable amount of sense, all
things considered![*]

> B.t.w. if the register class denoted by "b" has just a single
> element, you might just as well use the hard reg directly in
> the insn pattern here.

  Hmm, well I modelled my approach on the way e.g. MIPS port uses a
class-per-register, and that seems to work ok.

  Also, it's not actually a hard reg, it's in fact a memory-mapped peripheral.
This means that I need to specify secondary reloads (can't be loaded directly
from memory as I have no mem->mem move insn, needs to go via a gpr) and that
implies that the register has to exist as a class because you can only specify
secondary reloads on a per-reg-class basis.

    cheers,
      DaveK

[*] - #1 in an occasional series of "Things you don't hear people say about
reload /every/ day of the week." :-)
-- 
Can't think of a witty .sigline today....

Reply via email to