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: PATCH to rs6000.md, comments?


On Thu, Jul 16, 1998 at 08:08:38PM +0200, Franz Sirl wrote:
> Does this one look ok to you?

Some nits:

> @@ -495,6 +501,9 @@ non_short_cint_operand (op, mode)
>       register rtx op;
>       enum machine_mode mode ATTRIBUTE_UNUSED;
>  {
> +  if (GET_CODE (op) == CONSTANT_P_RTX)
> +    return 0;
> +
>    return (GET_CODE (op) == CONST_INT
>  	  && (unsigned HOST_WIDE_INT) (INTVAL (op) + 0x8000) >= 0x10000);
>  }

No point in this change.

> @@ -561,6 +573,9 @@ reg_or_u_short_operand (op, mode)
>       register rtx op;
>       enum machine_mode mode;
>  {
> +  if (GET_CODE (op) == CONSTANT_P_RTX)
> +    return 1;
> +
>    if (GET_CODE (op) == CONST_INT
>        && (INTVAL (op) & (~ (HOST_WIDE_INT) 0xffff)) == 0)
>      return 1;

I think this function should look like

  return u_short_cint_operand (op, mode) || gpc_reg_operand (op, mode);


> @@ -844,6 +862,9 @@ non_add_cint_operand (op, mode)
>       register rtx op;
>       enum machine_mode mode ATTRIBUTE_UNUSED;
>  {
> +  if (GET_CODE (op) == CONSTANT_P_RTX)
> +    return 0;
> +

Again, no point.

> @@ -871,6 +895,9 @@ non_logical_cint_operand (op, mode)
>       register rtx op;
>       enum machine_mode mode ATTRIBUTE_UNUSED;
>  {
> +  if (GET_CODE (op) == CONSTANT_P_RTX)
> +    return 0;
> +

And here.

> @@ -908,6 +935,9 @@ mask_operand (op, mode)
>       register rtx op;
>       enum machine_mode mode ATTRIBUTE_UNUSED;
>  {
> +  if (GET_CODE (op) == CONSTANT_P_RTX)
> +    return 1;
> +
>    return GET_CODE (op) == CONST_INT && mask_constant (INTVAL (op));
>  }

I don't think this is correct.  While mask_constant accepts 1, it
rejects 0.  I don't know enough about the ppc backend to attempt 
to force this case to see what happens.  

In any case, the only change that is absolutely required is the one
to input_operand.  Plus, I think you will need the following patch,
so that we skip all the special cases in movsi.  Also note that 
since __builtin_constant_p returns an int, you should not need to
modify any other mov patterns.


r~


Index: rs6000.md
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.22
diff -c -p -d -r1.22 rs6000.md
*** rs6000.md	1998/07/02 11:53:24	1.22
--- rs6000.md	1998/07/17 02:56:28
***************
*** 5415,5421 ****
        && !flag_pic
        && CONSTANT_P (operands[1])
        && GET_CODE (operands[1]) != HIGH
!       && GET_CODE (operands[1]) != CONST_INT)
      {
        rtx target = (reload_completed || reload_in_progress)
  			? operands[0] : gen_reg_rtx (SImode);
--- 5415,5422 ----
        && !flag_pic
        && CONSTANT_P (operands[1])
        && GET_CODE (operands[1]) != HIGH
!       && GET_CODE (operands[1]) != CONST_INT
!       && GET_CODE (operands[1]) != CONSTANT_P_RTX)
      {
        rtx target = (reload_completed || reload_in_progress)
  			? operands[0] : gen_reg_rtx (SImode);
***************
*** 5469,5474 ****
--- 5470,5476 ----
    if ((!TARGET_WINDOWS_NT || DEFAULT_ABI != ABI_NT)
        && CONSTANT_P (operands[1])
        && GET_CODE (operands[1]) != CONST_INT
+       && GET_CODE (operands[1]) != CONSTANT_P_RTX
        && GET_CODE (operands[1]) != HIGH
        && ! LEGITIMATE_CONSTANT_POOL_ADDRESS_P (operands[1]))
      {


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