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: ppc call_value* fixes (plus minor apple gripe)


Aldy Hernandez <aldyh@redhat.com> writes:

...
> i also added a new register class because find_reloads was picking the
> wrong register for the pattern:
> 
> 	(define_insn "*call_value_nonlocal_sysv"
> 	  [(set (match_operand 0 "" "=fgv,fgv,fgv,fgv")
> 
> upon seeing f and g, the biggest subunion containing them was set to
> NON_SPECIAL_REGS, then when it tried to get the union of that and
> ALTIVEC_REGS it got confused.  i noticed apple-gcc has moved
> NON_SPECIAL_REGS before ALTIVEC_REGS to fix the problem, but
> i believe the proper solution is to add a register class encompassing
> all
> three register classes.
> 
> so... this patch:
> 	a) fixes the call_value patterns to handle vector return

That part is OK, although of course it won't work without the next bit.

> values
> 	b) adds GEN_OR_FLOAT_OR_ALTIVEC_REGS
> 
> ok?

Could you change the name of NON_SPECIAL_REGS too?  I don't think the
altivec registers are "special" in that sense...

Actually, I think it'd probably be better to create a
GEN_OR_FLOAT_REGS class, and then make NON_SPECIAL_REGS contain
altivec registers too.  There are two places where NON_SPECIAL_REGS is
used, in PREFERRED_RELOAD_CLASS and secondary_reload_class; the
secondary_reload_class case should be 
(regno == -1 || FP_REGNO_P (regno)) && reg_class_subset_p (FLOAT_REGS, class)
and for PREFERRED_RELOAD_CLASS, you probably want to add a
GEN_OR_ALTIVEC_REGS and use that.

> 2002-01-28 Aldy Hernandez <aldyh@redhat.com>
> 
> 	* config/rs6000/rs6000.h (reg_class): New class
> 	GEN_OR_FLOAT_OR_ALTIVEC_REGS.
> 	(REG_CLASS_NAMES): Same.
> 	(REG_CLASS_CONTENTS): Same.
> 
> 	* rs6000.md ("*call_value_local32"): Support vector registers.
> 	("*call_value_local64"): Same.
> 	("*call_value_nonlocal_sysv"): Same.
-- 
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>


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