Fix SPEC2000 GCC misscopilation and SIMD support

Jan Hubicka jh@suse.cz
Tue Dec 10 06:39:00 GMT 2002


> On Tue, Dec 10, 2002 at 09:20:25AM +0100, Jan Hubicka wrote:
> > Hmm, alternativy I can use alter_subreg (gen_rtx_SUBREG (...))
> > that should kill the subreg even when doing so is invalid.  I duno
> > whether this is any cleaner then the approach above...
> 
> I have no idea what you're talking about here.
I am trying to prepare alternative plan to the patch changing interface
of CANNOT_CHANGE_MODE_CLASS macro.  So if I will use
CANNOT_CHANGE_MODE_CLASS to prohibit subregs changing size of XMM
register, I will prohibit large set of meaningfull subregs, like
(subreg:DI (reg:TI xmm0) 0) just because I want to prohibit (subreg:DI
(reg;TI xmm0) 8) that is produced by code handling small structures as
integers.

Fortunately our vector code is designed in a way that it don't seems to
rely on it (ie code will just be worse so converting scalar float into
vector float will go trought memory).  Scalar FP code is not the case
and I am using it post reload for avodiding reformating and using
logicals that are packed only.

I use simplify_gen_subreg to do the conversion into mode I want.
However this function uses CANNOT_CHANGE_MODE_CLASS and will generate
(subreg:V2DF (reg:DF xmm0) 0) sequences when CANNOT_CHANGE_MODE_CLASS
returns XMM_REGS.  This later fails in register_operand that uses the
same macro.  So I need to use different approach to produce the
registers.
I don't want to use gen_reg_rtx as the operand may be memory in some
cases and it will confuse my register tracking code from cfg branch.
Only alternative seems to be to rely on hack in alter_subreg that does:

      rtx new = simplify_subreg (GET_MODE (x), y, GET_MODE (y),
				 SUBREG_BYTE (x));

      if (new != 0)
	*xp = new;
      /* Simplify_subreg can't handle some REG cases, but we have to.  */
      else if (GET_CODE (y) == REG)
	{
	  unsigned int regno = subreg_hard_regno (x, 1);
	  PUT_CODE (x, REG);
	  REGNO (x) = regno;
	  ORIGINAL_REGNO (x) = ORIGINAL_REGNO (y);
	  /* This field has a different meaning for REGs and SUBREGs.  Make
	     sure to clear it!  */
	  RTX_FLAG (x, used) = 0;

that is there since some targets rely on it.
I tend to feel that this is hack that should go away in future (and I
wanted to do so), so I don't want to make another use of it...

Better ideas?

Honza
> 
> 
> 
> r~



More information about the Gcc-patches mailing list