This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ppc call_value* fixes (plus minor apple gripe)
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Aldy Hernandez <aldyh at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 28 Jan 2002 07:39:27 -0800
- Subject: Re: ppc call_value* fixes (plus minor apple gripe)
- References: <416FDCCF-13C1-11D6-93E4-000393750C1E@redhat.com>
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>