diff mbox

[AArch64,cleanup] Remove uses of CONST_DOUBLE_HIGH, CONST_DOUBLE_LOW

Message ID 564084C2.7050806@arm.com
State New
Headers show

Commit Message

Kyrylo Tkachov Nov. 9, 2015, 11:34 a.m. UTC
Hi all,

 From what I understand, we shouldn't encounter the case where CONST_DOUBLE is used to hold
a large integer value, accessed through CONST_DOUBLE_LOW and CONST_DOUBLE_HIGH.
The aarch64 backend doesn't generate any such rtxes and the midend shouldn't be passing
any such rtxes either.  This allows for a bit of cleanup in aarch64_simd_valid_immediate.

Bootstrapped and tested on aarch64.

Ok for trunk?
Thanks,
Kyrill

P.S. I propose this patch separate from my other patch that defines TARGET_SUPPORTS_WIDE_INT for aarch64
(https://gcc.gnu.org/ml/gcc-patches/2015-11/msg00934.html)
as this is not needed to fix the ICE in that case and just removes some dead code and is thus not
appropriate for backporting in my opinion.

2015-11-09  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * config/aarch64/aarch64.c (aarch64_simd_valid_immediate):
     Remove integer CONST_DOUBLE handling.  It should never occur.

Comments

Marcus Shawcroft Nov. 9, 2015, 3:49 p.m. UTC | #1
On 9 November 2015 at 11:34, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:

>     * config/aarch64/aarch64.c (aarch64_simd_valid_immediate):

>     Remove integer CONST_DOUBLE handling.  It should never occur.


OK /Marcus
diff mbox

Patch

commit 4b6c35c0f171a4841cb219e86b9d9ea752e2e849
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date:   Thu Oct 29 10:28:12 2015 +0000

    [AArch64][cleanup] Remove uses of CONST_DOUBLE_HIGH, CONST_DOUBLE_LOW

diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 389bfc0..cbdff44 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -10080,32 +10080,16 @@  aarch64_simd_valid_immediate (rtx op, machine_mode mode, bool inverse,
          it must be laid out in the vector register in reverse order.  */
       rtx el = CONST_VECTOR_ELT (op, BYTES_BIG_ENDIAN ? (n_elts - 1 - i) : i);
       unsigned HOST_WIDE_INT elpart;
-      unsigned int part, parts;
 
-      if (CONST_INT_P (el))
-        {
-          elpart = INTVAL (el);
-          parts = 1;
-        }
-      else if (GET_CODE (el) == CONST_DOUBLE)
-        {
-          elpart = CONST_DOUBLE_LOW (el);
-          parts = 2;
-        }
-      else
-        gcc_unreachable ();
+      gcc_assert (CONST_INT_P (el));
+      elpart = INTVAL (el);
+
+      for (unsigned int byte = 0; byte < innersize; byte++)
+	{
+	  bytes[idx++] = (elpart & 0xff) ^ invmask;
+	  elpart >>= BITS_PER_UNIT;
+	}
 
-      for (part = 0; part < parts; part++)
-        {
-          unsigned int byte;
-          for (byte = 0; byte < innersize; byte++)
-            {
-              bytes[idx++] = (elpart & 0xff) ^ invmask;
-              elpart >>= BITS_PER_UNIT;
-            }
-          if (GET_CODE (el) == CONST_DOUBLE)
-            elpart = CONST_DOUBLE_HIGH (el);
-        }
     }
 
   /* Sanity check.  */