sh-unknown-linux-gnu (Support of no fdiv for integer division)

M. R. Brown mrbrown@0xd6.org
Wed Oct 3 12:47:00 GMT 2001


* NIIBE Yutaka <gniibe@m17n.org> on Wed, Oct 03, 2001:

> 
> We need to handle calling convention of structure passing, and
> variable args.
> 

Wouldn't you rather conditionalize on TARGET_SH4 instead of
TARGET_HARD_SH4, since TARGET_HARD_SH4 doesn't select the ISA to generate?
IMO that'd be easier and more in tune with what TARGET_SH4 is designed for.

> *** 176,181 ****
> --- 177,185 ----
>   /* Nonzero if compiling for SH4 hardware (to be used for insn costs etc.)  */
>   #define TARGET_HARD_SH4 (target_flags & HARD_SH4_BIT)
>   
> + /* Nonzero if compiling for -m4-no-fpu */
> + #define TARGET_NO_FPU (target_flags & NO_FPU_BIT)
> + 
>   /* Nonzero if the default precision of th FPU is single */
>   #define TARGET_FPU_SINGLE (target_flags & FPU_SINGLE_BIT)
>   
> *************** extern int target_flags;
> *** 237,242 ****
> --- 241,248 ----
>     {"4-single-only",	SH3E_BIT|SH3_BIT|SH2_BIT|SH1_BIT|HARD_SH4_BIT|FPU_SINGLE_BIT, "" },	\
>     {"4-single",	TARGET_NONE, "" },		\
>     {"4-single",	SH4_BIT|SH3E_BIT|SH3_BIT|SH2_BIT|SH1_BIT|HARD_SH4_BIT|FPU_SINGLE_BIT, "" },\
> +   {"4-no-fpu",	TARGET_NONE, "" },		\
> +   {"4-no-fpu",	NO_FPU_BIT|SH3_BIT|SH2_BIT|SH1_BIT|HARD_SH4_BIT, "" },\

Add SH4_BIT here as normal, since you want to generate code for the SH4.

> *** 1141,1147 ****
>       || (! TREE_ADDRESSABLE ((tree)(TYPE)) \
>   	&& (! TARGET_HITACHI || ! AGGREGATE_TYPE_P (TYPE)))) \
>      && ! (CUM).force_mem \
> !    && (TARGET_SH3E \
>          ? ((MODE) == BLKmode \
>   	  ? (((CUM).arg_count[(int) SH_ARG_INT] * UNITS_PER_WORD \
>   	      + int_size_in_bytes (TYPE)) \
> --- 1147,1153 ----
>       || (! TREE_ADDRESSABLE ((tree)(TYPE)) \
>   	&& (! TARGET_HITACHI || ! AGGREGATE_TYPE_P (TYPE)))) \
>      && ! (CUM).force_mem \
> !    && ((TARGET_SH3E || (TARGET_HARD_SH4 && TARGET_NO_FPU)) \
>          ? ((MODE) == BLKmode \
>   	  ? (((CUM).arg_count[(int) SH_ARG_INT] * UNITS_PER_WORD \
>   	      + int_size_in_bytes (TYPE)) \

In cases such as these, select (TARGET_SH4 && TARGET_NO_FPU), or
the meaning of TARGET_HARD_SH4 and TARGET_SH4 will become ambiguous.

>   
>   /* Max number of bytes we want move_by_pieces to be able to copy
>      efficiently.  */
> ! #define MOVE_MAX_PIECES (TARGET_SH4 ? 8 : 4)
>   
>   /* Define if operations between registers always perform the operation
>      on the full register even if a narrower mode is specified.  */
> --- 1681,1687 ----
>   
>   /* Max number of bytes we want move_by_pieces to be able to copy
>      efficiently.  */
> ! #define MOVE_MAX_PIECES (TARGET_HARD_SH4 ? 8 : 4)
>   

It seems here that you want to change the definition of TARGET_HARD_SH4.
Please stick to the TARGET_SH? convention of selecting ABI's, etc.

M. R.



More information about the Gcc-patches mailing list