This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PING*2][PATCH] Force SDmode function args into FP registers per the ABI


On Sun, 2007-06-10 at 16:03 -0700, Mark Mitchell wrote:
> Peter Bergner wrote:
> 
> > I'd like to ping again, the following patch:
> > 
> >   http://gcc.gnu.org/ml/gcc-patches/2007-05/msg01515.html
> > 
> > It's mainly a rs6000 change, but does modify emit-rtl.c and
> > combine.c so as to allow paradoxical subregs of SDmode regs.
> 
> I looked at this.  I'm not comfortable with the generic code
> modifications.  I don't see a justification for handling DDmode and
> SDmode specially in this way.  To me, those changes look like a hack
> that works for Power, but doesn't necessarily make sense otherwise.
> And, on some other machine, it seems like the same concerns could apply
> to DFmode and SFmode, or to DImode and SImode.

I did ask whether or not that was the correct approach or not. :)

The reason I went this route is that reload1.c:alter_reg() creates
spill slots and for the 32-bit SDmode values, I need to create
64-bit stack slots because the 64-bit load/store instructions are
the only way to get data into/out of the registers without munging
the bits.  However, the alter_reg() code uses the following to
calculate the size of the stack slot it's going to create:

  unsigned int inherent_size = PSEUDO_REGNO_BYTES (i);
  [snip]
  unsigned int total_size = MAX (inherent_size, reg_max_ref_width[i]);

So my options were to modify total_size after the line above for
SDmode or modify reg_max_ref_width[i].  I guess I thought both
were evil, but using the paradoxical subreg allowed me to change
reg_max_ref_width[i] without changing alter_reg() at all.  All that
was really required was the change to emit-rtl.c and combine.c to
allow paradoxical subregs for SDmode, since paradoxical subregs of
FP types currently isn't allowed.

That said, I'm all ears for suggestions on how to implement this the
right way.  Any suggestions on how I can force 64-bit stack slots to
be created for SDmode values that would be acceptable?

Peter





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]