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: introduce SH 2a support


> 	2004-02-20  Fred Fish <fnf@redhat.com>,
> 	Corinna Vinschen <vinschen@redhat.com>
> 	* config/sh/t-sh (MULTILIB_OPTIONS): Add 2a-nofpu.
> 	(MULTILIB_EXCEPTIONS): Don't build littel-endian on sh2a.

s/littel/little/

> 	(SHIFT_COUNT_TRUNCATED): Set for sh2a.

You are not setting it, on the contrary.

> 	(ashlsi3_sh2a): New.
> 	(ashrsi3_sh2a): New.
> 	(lshrsi3_sh2a): New.

Your dynamic shifts are 4 bytes long.  From looking at the binutils patch,
it looks like they are the same 2 byte insns that the SH3 / SH4 use.
Which  one is right?

> @@ -3810,6 +3814,10 @@ fixup_addr_diff_vecs (rtx first)
>  	  if (GET_CODE (x) == LABEL_REF && XEXP (x, 0) == vec_lab)
>  	    break;
>  	}
> +      /* FIXME: This is a bug in the optimizer, but it seems harmless
> +	 to just avoid panicing.  */
> +      if (!prev)
> +	continue;

No, it is not.  You can end up jumping to the wrong address.

>        /* Emit the reference label of the braf where it belongs, right after
>  	 the casesi_jump_2 (i.e. braf).  */
> @@ -4786,8 +4794,12 @@ output_stack_adjust (int size, rtx reg, 
>      {
>        HOST_WIDE_INT align = STACK_BOUNDARY / BITS_PER_UNIT;
>  
> +/* This test is bogus, as output_stack_adjust is used to re-align the
> +   stack.  */
> +#if 0
>        if (size % align)
>  	abort ();
> +#endif

No, the test is valid.  The stack must never me mis-aligned on SH[12] or
when you are in supervisor mode, lest an interrupt tries to push something
on the misaligned stack.

I think (TARGET_SH4 || TARGET_SH2A_DOUBLE) is repeated way too often;
why don't you use a new macro to express what you mean?

> @@ -612,6 +674,7 @@ extern int target_flags;
>  %(subtarget_link_emul_suffix) \
>  %{mrelax:-relax} %(subtarget_link_spec)"
>  
> +#define DRIVER_SELF_SPECS "%{m2a:%{ml:%eSH2a does not support little-endian}}"
>  #define OPTIMIZATION_OPTIONS(LEVEL,SIZE)				\
>  do {									\
>    if (LEVEL)								\

What happens when you configure for little endian default and use -m2a ?

> @@ -2542,6 +2615,20 @@ struct sh_args {
>  ((GET_MODE_SIZE(MODE)==8) && ((unsigned)INTVAL(X)<60)	\
>   && ! (INTVAL(X) & 3) && ! (TARGET_SH4 && (MODE) == DFmode))
>  
> +#undef MODE_DISP_OK_4
> +#define MODE_DISP_OK_4(X,MODE) \
> +((GET_MODE_SIZE (MODE) == 4 && (unsigned) INTVAL (X) < 64	\
> +  && ! (INTVAL (X) & 3) && ! (TARGET_SH2E && (MODE) == SFmode)) \
> +  || ((GET_MODE_SIZE(MODE)==4) && ((unsigned)INTVAL(X)<16383)	\
> +  && ! (INTVAL(X) & 3) && TARGET_SH2A))
> +
> +#undef MODE_DISP_OK_8
> +#define MODE_DISP_OK_8(X,MODE) \
> +(((GET_MODE_SIZE(MODE)==8) && ((unsigned)INTVAL(X)<60)	\
> +  && ! (INTVAL(X) & 3) && ! ((TARGET_SH4 || TARGET_SH2A) && (MODE) == DFmode)) \
> + || ((GET_MODE_SIZE(MODE)==8) && ((unsigned)INTVAL(X)<8192)	\
> +  && ! (INTVAL(X) & (TARGET_SH2A_DOUBLE ? 7 : 3)) && (TARGET_SH2A && (MODE) == DFmode)))
> +
>  #define BASE_REGISTER_RTX_P(X)				\
>    ((GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X))	\
>     || (GET_CODE (X) == SUBREG				\

I think you intended just to change the definition.


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