This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: load large immediate
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: daniel tian <daniel dot xntian at gmail dot com>
- Cc: iant at google dot com, uday at cse dot iitb dot ac dot in, gcc at gcc dot gnu dot org, yxun lan <dennis dot yxun at gmail dot com>
- Date: Thu, 26 Feb 2009 14:18:25 +0000
- Subject: Re: load large immediate
- References: <121fadb80902260258ye6cf948jcdb8bd322e31911b@mail.gmail.com>
daniel tian wrote:
> there is a 'movm' problem that puzzled me. In my target machine,
> to load a large immediate data, can only move into zero register "R0".
> but R0 is a generally register. I defined the the way in the
> following:
>
> if the immediate data (op1) is larger than 1024
> then do
> {
> emit_move_insn(r0_reg_rtx, gen_rtx_CONST_INT(SImode, op1));
> //Move the immediate data into R0 register
> emit_move_insn(force_reg (mode, operands[0]), r0_reg_rtx);
> //move r0 to default register.
> }
When/where/how are you calling this code?
> the address label "common_reg " used many times. I think it will
> load one time. But after optimized with '-Os' or '-O2', it still loads
> the label "common_reg " six times..
I wonder if you're generating it too late for the optimisers to do anything?
cheers,
DaveK