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: Fix SPEC2000 GCC misscopilation and SIMD support


> On Fri, Dec 13, 2002 at 12:49:09PM +0100, Jan Hubicka wrote:
> > *************** cannot_change_mode_set_regs (used, from,
> > *** 2619,2627 ****
> > -         class = CANNOT_CHANGE_MODE_CLASS (from, to);
> > -         if (class != NO_REGS)
> > -           IOR_HARD_REG_SET (*used, reg_class_contents [(int) class]);
> > + 	int i;
> > + 	for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
> > +           if (! TEST_HARD_REG_BIT (*used, i)
> > + 	      && REG_CANNOT_CHANGE_MODE_P (from, to, i))
> > + 	    SET_HARD_REG_BIT (*used, i);
> 
> There are fewer register classes than registers.  Iterate over those.
I originally wanted to do that, but this won't work. ALL_REGS
intersect with any class and thus is CANNOT_CHANGE_MODE_CLASS in new
definition.  I would have to iterate over all atomic class, but I don't
think we have some data on this.  Perhaps I can precompute array of such
classes (ie in initialization of regclass iterate over registers and put
the clases found into array).  This can be usefull for regclass too - it
don't need to consider every defined class, it can just work on these
atomic classes and compute the costs of union classes at the end as
maximum of cost of each member class.

This also bring question whether all targets define classes disjoint
with the CANNOT_CHANGE_MODE_CLASS class.  This is true for i386, but I
am not quite sure about the others.  I will check.
> 
> > ! #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
> > !   reg_classes_intersect_p (mips_cannot_change_mode_class (FROM, TO), CLASS)
> 
> Push the class argument into the function.
> 
> > !   reg_classes_intersect_p (sh_cannot_change_mode_class (FROM, TO), CLASS)
> 
> Likewise.
OK.
> 
> > ! @item CANNOT_CHANGE_MODE_CLASS(@var{from}, @var{to}, @var{class})
> > ! If defined, a C expression that returns nonzero for a @var{class} for which
> >   a change from mode @var{from} to mode @var{to} is invalid, otherwise the
> >   macro returns @code{NO_REGS}.
> 
> NO_REGS is out of date.
Oops, thanks!
Honza
> 
> 
> Ok with those changes.
> 
> 
> 
> r~


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