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]

Re: SH: use register names instead of numbers


> 	* config/sh/sh.h (FIRST_GENERAL_REG, LAST_GENERAL_REG): New.
> 	(SPECIAL_REG): Renamed to SPECIAL_REGISTER_P.
> 	(GENERAL_REGISTER_P, GENERAL_OR_AP_REGISTER_P, FP_REGISTER_P,
> 	XD_REGISTER_P): New.  Use them all over.
> 	Moved most register-number #defines...
> 	* config/sh/sh.md: ... here.  Use macros to refer to register
> 	numbers and unspecs.
> 	* config/sh/sh.c: Likewise.
...
> +  ;; These are used with unspec.

I would rather have the UNSPEC symbols with a leading UNSPEC, and
UNSPECV for UNSPEC_VOLATILE.
I think that way, you can more quickly grasp what this is when you read it.
e.g. UNPSEC_MOVA and UNSPECV_ALIGN .

> +  (BREDIR_UNSPEC	4)

I'm having a hard time to associate this with block_branch_redirect.
It would be easier if it was called UNSPEC_BBR or UNSPEC_BL_BR_REDIR

> +  (CALLER_UNSPEC	10)

I don't know what this is, and I couldn't find it anywhere in the code,
either.

> @@ -3269,8 +3374,8 @@
>  (define_insn "calli"
>    [(call (mem:SI (match_operand:SI 0 "arith_reg_operand" "r"))
>  	 (match_operand 1 "" ""))
> -   (use (reg:SI 48))
> -   (clobber (reg:SI 17))]
> +   (use (reg:PSI FPSCR_REG))
> +   (clobber (reg:SI PR_REG))]
>    ""
>    "jsr	@%0%#"
>    [(set_attr "type" "call")
...
> @@ -3354,8 +3510,8 @@
>    [(parallel [(set (match_operand 0 "arith_reg_operand" "")
>  		   (call (mem:SI (match_operand 1 "arith_reg_operand" ""))
>  				 (match_operand 2 "" "")))
> -	      (use (reg:SI 48))
> -	      (clobber (reg:SI 17))])]
> +	      (use (reg:PSI FPSCR_REG))
> +	      (clobber (reg:SI PR_REG))])]
>    ""
>    "
>  {

Let's keep this patch to naming and reformatting issues.
Burying semantic changes in textual changes makes it hard to track down what
is going on.

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