Paul,

On Sunday 04 June 2006 13:24, Paul Brook wrote:
> On Sunday 04 June 2006 11:31, Wolfgang Mües wrote:
> > Splitting the insn
> >
> > (define_insn "*arm_movqi_insn"
> >   [(set (match_operand:QI 0 "nonimmediate_operand" "=r,r,r,m")
> >     (match_operand:QI 1 "general_operand" "rI,K,m,r"))]
> >
> > into 4 different insns:
>
> No. This is completely the wrong approach.

Why? I am learning.

> You should just change the valid QImode memory addresses, adding a new 
> constraint if neccessary. 

Hmmmm... I have tried this. I have changed the operand constraint from 
"m" to "Q". But these constraints are only used to select the right 
alternative inside the insn, not which insn is invoked. It might be 
possible to modify "nonimmediate_operand"
into something else, to select this insn only if the address is fitting 
in a single register, without offset or increment.

But this will not give me the freedom to allocate a temporary register. 
According to the manual, mov insns are not supposed to clobber a 
register. I suppose I will have to allocate these registers in 

(define_expand "movqi"
  [(set (match_operand:QI 0 "general_operand" "")
        (match_operand:QI 1 "general_operand" ""))]

So I have to narrow down the constraint "nonimmediate_operand", so that 
every memory address not fitting in a single register will not invoke 
arm_movqi_insn.

Please correct me if I'm wrong. This is my first encounter with the 
inner contents of gcc. I may have completely missed your point.

> You also need to tweak the reload legitimate address bits to obey the
> new restrictions.

Can you show me what you mean here? What to do where?

> For the record these hacks are unlikely to ever be acceptable in
> mainline gcc. They're relatively invasive changes who's only purpose
> is to support fundamentally broken hardware.

Paul, this is clear to me. Homebrew software on the DS is not so 
important to justify such a change in mainline gcc. A patch will be 
fine.

Its a big amount of - sometimes frustrating - work for a gcc newbie to 
make this change. I am doing this only because I know it's the only 
solution, and to turn the command line only DS linux into some nice 
PDA/browser/wireless client machine.

regards

Wolfgang

-- 
We're back to the times when men were men 
and wrote their own device drivers.

(Linus Torvalds)

Reply via email to