public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, alpha]: Some further HWI == 64 improvements
@ 2015-05-13 15:06 Uros Bizjak
  2015-05-13 16:56 ` Richard Henderson
  0 siblings, 1 reply; 6+ messages in thread
From: Uros Bizjak @ 2015-05-13 15:06 UTC (permalink / raw)
  To: gcc-patches; +Cc: Richard Henderson

[-- Attachment #1: Type: text/plain, Size: 683 bytes --]

Hello!

2015-05-13  Uros Bizjak  <ubizjak@gmail.com>

    * config/alpha/alpha.c (alpha_emit_set_long_const): Remove c1 argument.
    (alpha_extract_integer): Redeclare as static HOST_WIDE_INT.
    Remove *p0 and *p1 arguments.  Rewrite function.
    (alpha_legitimate_constant_p): Update call to alpha_extract_integer.
    (alpha_split_const_mov): Update calls to alpha_extract_integer and
    alpha_emit_set_long_const.
    (alpha_expand_epilogue): Update calls to alpha_emit_set_long_const.
    (alpha_output_mi_thunk_osf): Ditto.
    * config/alpha/alpha.md (movti): Do not check operands[1]
    for CONST_DOUBLE.

Tested on alpha-linux-gnu and committed to mainline SVN.

Uros.

[-- Attachment #2: a.diff.txt --]
[-- Type: text/plain, Size: 4182 bytes --]

Index: config/alpha/alpha.c
===================================================================
--- config/alpha/alpha.c	(revision 223097)
+++ config/alpha/alpha.c	(working copy)
@@ -2068,13 +2068,12 @@ alpha_emit_set_const (rtx target, machine_mode mod
    with alpha_emit_set_const.  */
 
 static rtx
-alpha_emit_set_long_const (rtx target, HOST_WIDE_INT c1, HOST_WIDE_INT c2)
+alpha_emit_set_long_const (rtx target, HOST_WIDE_INT c1)
 {
   HOST_WIDE_INT d1, d2, d3, d4;
 
   /* Decompose the entire word */
 
-  gcc_assert (c2 == -(c1 < 0));
   d1 = ((c1 & 0xffff) ^ 0x8000) - 0x8000;
   c1 -= d1;
   d2 = ((c1 & 0xffffffff) ^ 0x80000000) - 0x80000000;
@@ -2109,25 +2108,23 @@ static rtx
 /* Given an integral CONST_INT, CONST_WIDE_INT, CONST_DOUBLE,
    or CONST_VECTOR, return the low 64 bits.  */
 
-static void
-alpha_extract_integer (rtx x, HOST_WIDE_INT *p0, HOST_WIDE_INT *p1)
+static HOST_WIDE_INT
+alpha_extract_integer (rtx x)
 {
-  HOST_WIDE_INT i0, i1;
-
   if (GET_CODE (x) == CONST_VECTOR)
     x = simplify_subreg (DImode, x, GET_MODE (x), 0);
 
-  if (CONST_INT_P (x))
-    i0 = INTVAL (x);
-  else if (CONST_WIDE_INT_P (x))
-    i0 = CONST_WIDE_INT_ELT (x, 0);
-  else
-    i0 = CONST_DOUBLE_LOW (x);
-
-  i1 = -(i0 < 0);
-      
-  *p0 = i0;
-  *p1 = i1;
+  switch (GET_CODE (x))
+    {
+    case CONST_INT:
+      return INTVAL (x);
+    case CONST_WIDE_INT:
+      return CONST_WIDE_INT_ELT (x, 0);
+    case CONST_DOUBLE:
+      return CONST_DOUBLE_LOW (x);
+    default:
+      gcc_unreachable ();
+    }
 }
 
 /* Implement TARGET_LEGITIMATE_CONSTANT_P.  This is all constants for which
@@ -2138,7 +2135,7 @@ static rtx
 bool
 alpha_legitimate_constant_p (machine_mode mode, rtx x)
 {
-  HOST_WIDE_INT i0, i1;
+  HOST_WIDE_INT i0;
 
   switch (GET_CODE (x))
     {
@@ -2185,7 +2182,7 @@ alpha_legitimate_constant_p (machine_mode mode, rt
     do_integer:
       if (TARGET_BUILD_CONSTANTS)
 	return true;
-      alpha_extract_integer (x, &i0, &i1);
+      i0 = alpha_extract_integer (x);
       return alpha_emit_set_const_1 (x, mode, i0, 3, true) != NULL;
 
     default:
@@ -2199,15 +2196,15 @@ alpha_legitimate_constant_p (machine_mode mode, rt
 bool
 alpha_split_const_mov (machine_mode mode, rtx *operands)
 {
-  HOST_WIDE_INT i0, i1;
+  HOST_WIDE_INT i0;
   rtx temp = NULL_RTX;
 
-  alpha_extract_integer (operands[1], &i0, &i1);
+  i0 = alpha_extract_integer (operands[1]);
 
   temp = alpha_emit_set_const (operands[0], mode, i0, 3, false);
 
   if (!temp && TARGET_BUILD_CONSTANTS)
-    temp = alpha_emit_set_long_const (operands[0], i0, i1);
+    temp = alpha_emit_set_long_const (operands[0], i0);
 
   if (temp)
     {
@@ -8260,8 +8257,7 @@ alpha_expand_epilogue (void)
 	    {
 	      /* We can't drop new things to memory this late, afaik,
 		 so build it up by pieces.  */
-	      sp_adj2 = alpha_emit_set_long_const (tmp, frame_size,
-						   -(frame_size < 0));
+	      sp_adj2 = alpha_emit_set_long_const (tmp, frame_size);
 	      gcc_assert (sp_adj2);
 	    }
 	}
@@ -8388,8 +8384,7 @@ alpha_output_mi_thunk_osf (FILE *file, tree thunk_
     }
   else
     {
-      rtx tmp = alpha_emit_set_long_const (gen_rtx_REG (Pmode, 0),
-					   delta, -(delta < 0));
+      rtx tmp = alpha_emit_set_long_const (gen_rtx_REG (Pmode, 0), delta);
       emit_insn (gen_adddi3 (this_rtx, this_rtx, tmp));
     }
 
@@ -8411,7 +8406,7 @@ alpha_output_mi_thunk_osf (FILE *file, tree thunk_
       else
 	{
 	  tmp2 = alpha_emit_set_long_const (gen_rtx_REG (Pmode, 1),
-					    vcall_offset, -(vcall_offset < 0));
+					    vcall_offset);
           emit_insn (gen_adddi3 (tmp, tmp, tmp2));
 	  lo = 0;
 	}
Index: config/alpha/alpha.md
===================================================================
--- config/alpha/alpha.md	(revision 223097)
+++ config/alpha/alpha.md	(working copy)
@@ -4154,8 +4154,7 @@
      32-bit constants in TImode and rely on the splitter, but
      this doesn't seem to be worth the pain.  */
   else if (CONST_INT_P (operands[1])
-	   || GET_CODE (operands[1]) == CONST_WIDE_INT
-	   || GET_CODE (operands[1]) == CONST_DOUBLE)
+	   || GET_CODE (operands[1]) == CONST_WIDE_INT)
     {
       rtx in[2], out[2], target;
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH, alpha]: Some further HWI == 64 improvements
  2015-05-13 15:06 [PATCH, alpha]: Some further HWI == 64 improvements Uros Bizjak
@ 2015-05-13 16:56 ` Richard Henderson
  2015-05-13 17:53   ` Uros Bizjak
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Henderson @ 2015-05-13 16:56 UTC (permalink / raw)
  To: Uros Bizjak, gcc-patches

On 05/13/2015 08:04 AM, Uros Bizjak wrote:
> Hello!
> 
> 2015-05-13  Uros Bizjak  <ubizjak@gmail.com>
> 
>     * config/alpha/alpha.c (alpha_emit_set_long_const): Remove c1 argument.
>     (alpha_extract_integer): Redeclare as static HOST_WIDE_INT.
>     Remove *p0 and *p1 arguments.  Rewrite function.
>     (alpha_legitimate_constant_p): Update call to alpha_extract_integer.
>     (alpha_split_const_mov): Update calls to alpha_extract_integer and
>     alpha_emit_set_long_const.
>     (alpha_expand_epilogue): Update calls to alpha_emit_set_long_const.
>     (alpha_output_mi_thunk_osf): Ditto.
>     * config/alpha/alpha.md (movti): Do not check operands[1]
>     for CONST_DOUBLE.
> 
> Tested on alpha-linux-gnu and committed to mainline SVN.
> 
> Uros.
> 
> 
> a.diff.txt
> 
> 
> Index: config/alpha/alpha.c
> ===================================================================
> --- config/alpha/alpha.c	(revision 223097)
> +++ config/alpha/alpha.c	(working copy)
> @@ -2068,13 +2068,12 @@ alpha_emit_set_const (rtx target, machine_mode mod
>     with alpha_emit_set_const.  */
>  
>  static rtx
> -alpha_emit_set_long_const (rtx target, HOST_WIDE_INT c1, HOST_WIDE_INT c2)
> +alpha_emit_set_long_const (rtx target, HOST_WIDE_INT c1)
>  {
>    HOST_WIDE_INT d1, d2, d3, d4;
>  
>    /* Decompose the entire word */
>  
> -  gcc_assert (c2 == -(c1 < 0));
>    d1 = ((c1 & 0xffff) ^ 0x8000) - 0x8000;
>    c1 -= d1;
>    d2 = ((c1 & 0xffffffff) ^ 0x80000000) - 0x80000000;
> @@ -2109,25 +2108,23 @@ static rtx
>  /* Given an integral CONST_INT, CONST_WIDE_INT, CONST_DOUBLE,
>     or CONST_VECTOR, return the low 64 bits.  */
>  
> -static void
> -alpha_extract_integer (rtx x, HOST_WIDE_INT *p0, HOST_WIDE_INT *p1)
> +static HOST_WIDE_INT
> +alpha_extract_integer (rtx x)
>  {
> -  HOST_WIDE_INT i0, i1;
> -
>    if (GET_CODE (x) == CONST_VECTOR)
>      x = simplify_subreg (DImode, x, GET_MODE (x), 0);
>  
> -  if (CONST_INT_P (x))
> -    i0 = INTVAL (x);
> -  else if (CONST_WIDE_INT_P (x))
> -    i0 = CONST_WIDE_INT_ELT (x, 0);
> -  else
> -    i0 = CONST_DOUBLE_LOW (x);
> -
> -  i1 = -(i0 < 0);
> -      
> -  *p0 = i0;
> -  *p1 = i1;
> +  switch (GET_CODE (x))
> +    {
> +    case CONST_INT:
> +      return INTVAL (x);
> +    case CONST_WIDE_INT:
> +      return CONST_WIDE_INT_ELT (x, 0);
> +    case CONST_DOUBLE:
> +      return CONST_DOUBLE_LOW (x);
> +    default:
> +      gcc_unreachable ();
> +    }

Surely we don't actually need to test for CONST_DOUBLE anymore?

>  }
>  
>  /* Implement TARGET_LEGITIMATE_CONSTANT_P.  This is all constants for which
> @@ -2138,7 +2135,7 @@ static rtx
>  bool
>  alpha_legitimate_constant_p (machine_mode mode, rtx x)
>  {
> -  HOST_WIDE_INT i0, i1;
> +  HOST_WIDE_INT i0;
>  
>    switch (GET_CODE (x))
>      {
> @@ -2185,7 +2182,7 @@ alpha_legitimate_constant_p (machine_mode mode, rt
>      do_integer:
>        if (TARGET_BUILD_CONSTANTS)
>  	return true;
> -      alpha_extract_integer (x, &i0, &i1);
> +      i0 = alpha_extract_integer (x);
>        return alpha_emit_set_const_1 (x, mode, i0, 3, true) != NULL;

Doesn't this now allow CONST_WIDE_INT that are in fact wider than 64 bits?
Which I can't imagine being legitimate...

>  
>      default:
> @@ -2199,15 +2196,15 @@ alpha_legitimate_constant_p (machine_mode mode, rt
>  bool
>  alpha_split_const_mov (machine_mode mode, rtx *operands)
>  {
> -  HOST_WIDE_INT i0, i1;
> +  HOST_WIDE_INT i0;
>    rtx temp = NULL_RTX;
>  
> -  alpha_extract_integer (operands[1], &i0, &i1);
> +  i0 = alpha_extract_integer (operands[1]);
>  
>    temp = alpha_emit_set_const (operands[0], mode, i0, 3, false);
>  
>    if (!temp && TARGET_BUILD_CONSTANTS)
> -    temp = alpha_emit_set_long_const (operands[0], i0, i1);
> +    temp = alpha_emit_set_long_const (operands[0], i0);
>  
>    if (temp)
>      {
> @@ -8260,8 +8257,7 @@ alpha_expand_epilogue (void)
>  	    {
>  	      /* We can't drop new things to memory this late, afaik,
>  		 so build it up by pieces.  */
> -	      sp_adj2 = alpha_emit_set_long_const (tmp, frame_size,
> -						   -(frame_size < 0));
> +	      sp_adj2 = alpha_emit_set_long_const (tmp, frame_size);
>  	      gcc_assert (sp_adj2);
>  	    }
>  	}
> @@ -8388,8 +8384,7 @@ alpha_output_mi_thunk_osf (FILE *file, tree thunk_
>      }
>    else
>      {
> -      rtx tmp = alpha_emit_set_long_const (gen_rtx_REG (Pmode, 0),
> -					   delta, -(delta < 0));
> +      rtx tmp = alpha_emit_set_long_const (gen_rtx_REG (Pmode, 0), delta);
>        emit_insn (gen_adddi3 (this_rtx, this_rtx, tmp));
>      }
>  
> @@ -8411,7 +8406,7 @@ alpha_output_mi_thunk_osf (FILE *file, tree thunk_
>        else
>  	{
>  	  tmp2 = alpha_emit_set_long_const (gen_rtx_REG (Pmode, 1),
> -					    vcall_offset, -(vcall_offset < 0));
> +					    vcall_offset);
>            emit_insn (gen_adddi3 (tmp, tmp, tmp2));
>  	  lo = 0;
>  	}
> Index: config/alpha/alpha.md
> ===================================================================
> --- config/alpha/alpha.md	(revision 223097)
> +++ config/alpha/alpha.md	(working copy)
> @@ -4154,8 +4154,7 @@
>       32-bit constants in TImode and rely on the splitter, but
>       this doesn't seem to be worth the pain.  */
>    else if (CONST_INT_P (operands[1])
> -	   || GET_CODE (operands[1]) == CONST_WIDE_INT
> -	   || GET_CODE (operands[1]) == CONST_DOUBLE)
> +	   || GET_CODE (operands[1]) == CONST_WIDE_INT)
>      {
>        rtx in[2], out[2], target;
>  
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH, alpha]: Some further HWI == 64 improvements
  2015-05-13 16:56 ` Richard Henderson
@ 2015-05-13 17:53   ` Uros Bizjak
  2015-05-13 19:18     ` Richard Henderson
  0 siblings, 1 reply; 6+ messages in thread
From: Uros Bizjak @ 2015-05-13 17:53 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches

On Wed, May 13, 2015 at 6:46 PM, Richard Henderson <rth@redhat.com> wrote:
> On 05/13/2015 08:04 AM, Uros Bizjak wrote:
>> Hello!
>>
>> 2015-05-13  Uros Bizjak  <ubizjak@gmail.com>
>>
>>     * config/alpha/alpha.c (alpha_emit_set_long_const): Remove c1 argument.
>>     (alpha_extract_integer): Redeclare as static HOST_WIDE_INT.
>>     Remove *p0 and *p1 arguments.  Rewrite function.
>>     (alpha_legitimate_constant_p): Update call to alpha_extract_integer.
>>     (alpha_split_const_mov): Update calls to alpha_extract_integer and
>>     alpha_emit_set_long_const.
>>     (alpha_expand_epilogue): Update calls to alpha_emit_set_long_const.
>>     (alpha_output_mi_thunk_osf): Ditto.
>>     * config/alpha/alpha.md (movti): Do not check operands[1]
>>     for CONST_DOUBLE.
>>
>> Tested on alpha-linux-gnu and committed to mainline SVN.

>> +  switch (GET_CODE (x))
>> +    {
>> +    case CONST_INT:
>> +      return INTVAL (x);
>> +    case CONST_WIDE_INT:
>> +      return CONST_WIDE_INT_ELT (x, 0);
>> +    case CONST_DOUBLE:
>> +      return CONST_DOUBLE_LOW (x);
>> +    default:
>> +      gcc_unreachable ();
>> +    }
>
> Surely we don't actually need to test for CONST_DOUBLE anymore?

Indeed. I will look into it in a follow-up patch. There are probably
some more checks for CONST_DOUBLE, I'll look into this later.


>>  /* Implement TARGET_LEGITIMATE_CONSTANT_P.  This is all constants for which
>> @@ -2138,7 +2135,7 @@ static rtx
>>  bool
>>  alpha_legitimate_constant_p (machine_mode mode, rtx x)
>>  {
>> -  HOST_WIDE_INT i0, i1;
>> +  HOST_WIDE_INT i0;
>>
>>    switch (GET_CODE (x))
>>      {
>> @@ -2185,7 +2182,7 @@ alpha_legitimate_constant_p (machine_mode mode, rt
>>      do_integer:
>>        if (TARGET_BUILD_CONSTANTS)
>>       return true;
>> -      alpha_extract_integer (x, &i0, &i1);
>> +      i0 = alpha_extract_integer (x);
>>        return alpha_emit_set_const_1 (x, mode, i0, 3, true) != NULL;
>
> Doesn't this now allow CONST_WIDE_INT that are in fact wider than 64 bits?
> Which I can't imagine being legitimate...

I did check this part with:

--cut here--
__int128 a;

void test (void)
{
  a = ((__int128) 7 << 100) + ((__int128) 1 << 30);
}
--cut here--

and generated code was identical to unpatched compiler:

        ldah $1,16384($31)
        lda $2,a
        stq $1,0($2)
        lda $1,7($31)
        sll $1,36,$1
        stq $1,8($2)
        ret $31,($26),1

However, this works only for TARGET_BUILD_CONSTANTS. This is a
preexisting bug, it looks that we want:

--cut here--
Index: alpha.c
===================================================================
--- alpha.c     (revision 223166)
+++ alpha.c     (working copy)
@@ -2152,7 +2152,6 @@ alpha_legitimate_constant_p (machine_mode mode, rt

       if (GET_CODE (x) != SYMBOL_REF)
        return true;
-
       /* FALLTHRU */

     case SYMBOL_REF:
@@ -2162,7 +2161,7 @@ alpha_legitimate_constant_p (machine_mode mode, rt
     case CONST_WIDE_INT:
       if (x == CONST0_RTX (mode))
        return true;
-      goto do_integer;
+      return TARGET_BUILD_CONSTANTS != 0;

     case CONST_DOUBLE:
       if (x == CONST0_RTX (mode))
@@ -2176,10 +2175,9 @@ alpha_legitimate_constant_p (machine_mode mode, rt
        return false;
       if (GET_MODE_SIZE (mode) != 8)
        return false;
-      goto do_integer;
+      /* FALLTHRU */

     case CONST_INT:
-    do_integer:
       if (TARGET_BUILD_CONSTANTS)
        return true;
       i0 = alpha_extract_integer (x);
--cut here--

The only part that actually processes CONST_WIDE_INT is
alpha_legitimate_constant and movti expander. The latter immediately
splits any TImode CONST_WIDE_INTs.

Uros.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH, alpha]: Some further HWI == 64 improvements
  2015-05-13 17:53   ` Uros Bizjak
@ 2015-05-13 19:18     ` Richard Henderson
  2015-05-14 15:43       ` Uros Bizjak
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Henderson @ 2015-05-13 19:18 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

On 05/13/2015 10:53 AM, Uros Bizjak wrote:
> The only part that actually processes CONST_WIDE_INT is
> alpha_legitimate_constant and movti expander. The latter immediately
> splits any TImode CONST_WIDE_INTs.
> 

Indeed.  Also probably worth cleaning up is using CONST_SCALAR_INT_P, where
both CONST_INT and CONST_WIDE_INT are allowed.


r~

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH, alpha]: Some further HWI == 64 improvements
  2015-05-13 19:18     ` Richard Henderson
@ 2015-05-14 15:43       ` Uros Bizjak
  2015-05-14 16:16         ` Richard Henderson
  0 siblings, 1 reply; 6+ messages in thread
From: Uros Bizjak @ 2015-05-14 15:43 UTC (permalink / raw)
  To: Richard Henderson; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]

On Wed, May 13, 2015 at 9:05 PM, Richard Henderson <rth@redhat.com> wrote:
> On 05/13/2015 10:53 AM, Uros Bizjak wrote:
>> The only part that actually processes CONST_WIDE_INT is
>> alpha_legitimate_constant and movti expander. The latter immediately
>> splits any TImode CONST_WIDE_INTs.
>>
>
> Indeed.  Also probably worth cleaning up is using CONST_SCALAR_INT_P, where
> both CONST_INT and CONST_WIDE_INT are allowed.

I will do this in the last patch, when all uses of CONST_WIDE_INT and
CONST_DOUBLE are reviewed.

For now, I have prepared following patch that cleans
alpha_extract_integer and callers.  Please also note that
alpha_legitimate_constant_p now checks full 128 bit constant.

2015-05-14  Uros Bizjak  <ubizjak@gmail.com>

    * config/alpha/alpha.c (alpha_extract_integer): Do not handle
    CONST_WIDE_INT and CONST_DOUBLE.  Assert CONST_INT_P (x).
    (alpha_legitimate_constant_p) <case CONST_WIDE_INT>: Check high and
    low part of the constant using alpha_emit_set_const_1.
    (alpha_expand_mov): Do not handle CONST_WIDE_INT and CONST_DOUBLE.

The patch passes bootstrap on alphaev68-linux-gnu, regression test is
in progress.

OK if regtest passes?

Uros.

[-- Attachment #2: b.diff.txt --]
[-- Type: text/plain, Size: 2641 bytes --]

Index: config/alpha/alpha.c
===================================================================
--- config/alpha/alpha.c	(revision 223190)
+++ config/alpha/alpha.c	(working copy)
@@ -2105,8 +2105,7 @@ alpha_emit_set_long_const (rtx target, HOST_WIDE_I
   return target;
 }
 
-/* Given an integral CONST_INT, CONST_WIDE_INT, CONST_DOUBLE,
-   or CONST_VECTOR, return the low 64 bits.  */
+/* Given an integral CONST_INT or CONST_VECTOR, return the low 64 bits.  */
 
 static HOST_WIDE_INT
 alpha_extract_integer (rtx x)
@@ -2114,17 +2113,9 @@ alpha_extract_integer (rtx x)
   if (GET_CODE (x) == CONST_VECTOR)
     x = simplify_subreg (DImode, x, GET_MODE (x), 0);
 
-  switch (GET_CODE (x))
-    {
-    case CONST_INT:
-      return INTVAL (x);
-    case CONST_WIDE_INT:
-      return CONST_WIDE_INT_ELT (x, 0);
-    case CONST_DOUBLE:
-      return CONST_DOUBLE_LOW (x);
-    default:
-      gcc_unreachable ();
-    }
+  gcc_assert (CONST_INT_P (x));
+
+  return INTVAL (x);
 }
 
 /* Implement TARGET_LEGITIMATE_CONSTANT_P.  This is all constants for which
@@ -2152,7 +2143,6 @@ alpha_legitimate_constant_p (machine_mode mode, rt
 
       if (GET_CODE (x) != SYMBOL_REF)
 	return true;
-
       /* FALLTHRU */
 
     case SYMBOL_REF:
@@ -2160,8 +2150,16 @@ alpha_legitimate_constant_p (machine_mode mode, rt
       return SYMBOL_REF_TLS_MODEL (x) == 0;
 
     case CONST_WIDE_INT:
+      if (TARGET_BUILD_CONSTANTS)
+	return true;
       if (x == CONST0_RTX (mode))
 	return true;
+      mode = DImode;
+      gcc_assert (CONST_WIDE_INT_NUNITS (x) == 2);
+      i0 = CONST_WIDE_INT_ELT (x, 1);
+      if (alpha_emit_set_const_1 (NULL_RTX, mode, i0, 3, true) == NULL)
+	return false;
+      i0 = CONST_WIDE_INT_ELT (x, 0);
       goto do_integer;
 
     case CONST_DOUBLE:
@@ -2176,14 +2174,14 @@ alpha_legitimate_constant_p (machine_mode mode, rt
 	return false;
       if (GET_MODE_SIZE (mode) != 8)
 	return false;
-      goto do_integer;
+      /* FALLTHRU */
 
     case CONST_INT:
-    do_integer:
       if (TARGET_BUILD_CONSTANTS)
 	return true;
       i0 = alpha_extract_integer (x);
-      return alpha_emit_set_const_1 (x, mode, i0, 3, true) != NULL;
+    do_integer:
+      return alpha_emit_set_const_1 (NULL_RTX, mode, i0, 3, true) != NULL;
 
     default:
       return false;
@@ -2248,8 +2246,6 @@ alpha_expand_mov (machine_mode mode, rtx *operands
 
   /* Split large integers.  */
   if (CONST_INT_P (operands[1])
-      || GET_CODE (operands[1]) == CONST_WIDE_INT
-      || GET_CODE (operands[1]) == CONST_DOUBLE
       || GET_CODE (operands[1]) == CONST_VECTOR)
     {
       if (alpha_split_const_mov (mode, operands))

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH, alpha]: Some further HWI == 64 improvements
  2015-05-14 15:43       ` Uros Bizjak
@ 2015-05-14 16:16         ` Richard Henderson
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Henderson @ 2015-05-14 16:16 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

On 05/14/2015 08:32 AM, Uros Bizjak wrote:
> 2015-05-14  Uros Bizjak  <ubizjak@gmail.com>
> 
>     * config/alpha/alpha.c (alpha_extract_integer): Do not handle
>     CONST_WIDE_INT and CONST_DOUBLE.  Assert CONST_INT_P (x).
>     (alpha_legitimate_constant_p) <case CONST_WIDE_INT>: Check high and
>     low part of the constant using alpha_emit_set_const_1.
>     (alpha_expand_mov): Do not handle CONST_WIDE_INT and CONST_DOUBLE.
> 
> The patch passes bootstrap on alphaev68-linux-gnu, regression test is
> in progress.
> 
> OK if regtest passes?

Looks good.


r~

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-05-14 15:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-13 15:06 [PATCH, alpha]: Some further HWI == 64 improvements Uros Bizjak
2015-05-13 16:56 ` Richard Henderson
2015-05-13 17:53   ` Uros Bizjak
2015-05-13 19:18     ` Richard Henderson
2015-05-14 15:43       ` Uros Bizjak
2015-05-14 16:16         ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).