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: [PATCH] H8300 Extend 8-bit constant address support to H8300and H8S, 16-bit constant address support to H8S


Hi Dhananjay,

> Currently aa:8 and aa:16 addressing mode is only supported on H8300H.
> The aa:8 mode can also be supported on H8300 and H8S, likewise aa:16 can also 
> be supported on H8S. 
> Each of the above reduces code size by 2. 
> 
> 2002-09-12 Dhananjay Deshpande <dhananjayd@kpit.com>
> 	* config/h8300/h8300.h (EIGHTBIT_CONSTANT_ADDRESS_P): Add support for
> 	  H8300, H8S aa:8 mode
> 	  (TINY_CONSTANT_ADDRESS_P): Add support for H8S aa:16 mode 
> 	* config/h8300/h8300.c  (h8300_adjust_insn_length): Adjust length for
>  	  H8300 aa:8 mode
> ===============================================================================
> --- h8300.h.orig	Thu Sep 12 12:09:55 2002
> +++ h8300.h	Thu Sep 12 12:25:42 2002
> @@ -822,20 +822,24 @@
>     ? !h8300_shift_needs_scratch_p (INTVAL (OP), SImode)	\
>     : 0)
>  
> -/* Nonzero if X is a constant address suitable as an 8-bit absolute on
> -   the H8/300H, which is a special case of the 'R' operand.  */
> +/* Nonzero if X is a constant address suitable as an 8-bit absolute,
> +   which is a special case of the 'R' operand.  */
>  
> -#define EIGHTBIT_CONSTANT_ADDRESS_P(X)			\
> -  (GET_CODE (X) == CONST_INT && TARGET_H8300H		\
> -   && 0xffff00 <= INTVAL (X) && INTVAL (X) <= 0xffffff)
> +#define EIGHTBIT_CONSTANT_ADDRESS_P(X)					      \
> +  (GET_CODE (X) == CONST_INT && 					      \
> +  ((TARGET_H8300H && 0xffff00 <= INTVAL (X) && INTVAL (X) <= 0xffffff) ||     \
> +  (TARGET_H8300S && 0xffffff00 <= INTVAL (X) && INTVAL (X) <= 0xffffffff) ||  \
> +  (TARGET_H8300 && 0xffffff00 <= INTVAL (X) && INTVAL (X) <= 0xffffffff)))

I think H8/300 has 16-bit address, not 32-bit.  Also, it would be nice
if you could fix the formatting like

  A
  && (B
      || C
      || D)

See the GNU coding standard for details.

Doesn't H8/S have 24-bit address and 32-bit address depending on the
operating mode?  I have to look into this.

Kazu Hirata


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