]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[10/77] Make assemble_real take a scalar_float_mode
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Aug 2017 11:09:34 +0000 (11:09 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 30 Aug 2017 11:09:34 +0000 (11:09 +0000)
As per subject.

2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* output.h (assemble_real): Take a scalar_float_mode.
* config/arm/arm.c (arm_assemble_integer): Update accordingly.
* config/arm/arm.md (consttable_4): Likewise.
(consttable_8): Likewise.
(consttable_16): Likewise.
* config/mips/mips.md (consttable_float): Likewise.
* config/s390/s390.c (s390_output_pool_entry): Likewise.
* varasm.c (assemble_real): Take a scalar_float_mode.
(output_constant_pool_2): Update accordingly.
(output_constant): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251461 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/arm/arm.c
gcc/config/arm/arm.md
gcc/config/mips/mips.md
gcc/config/s390/s390.c
gcc/output.h
gcc/varasm.c

index 5ca560ee2b1804a3c353ca68aefaaed6dc44a081..5241db9ffbade878839488e3e460cad336b12e26 100644 (file)
@@ -1,3 +1,18 @@
+2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
+           Alan Hayward  <alan.hayward@arm.com>
+           David Sherwood  <david.sherwood@arm.com>
+
+       * output.h (assemble_real): Take a scalar_float_mode.
+       * config/arm/arm.c (arm_assemble_integer): Update accordingly.
+       * config/arm/arm.md (consttable_4): Likewise.
+       (consttable_8): Likewise.
+       (consttable_16): Likewise.
+       * config/mips/mips.md (consttable_float): Likewise.
+       * config/s390/s390.c (s390_output_pool_entry): Likewise.
+       * varasm.c (assemble_real): Take a scalar_float_mode.
+       (output_constant_pool_2): Update accordingly.
+       (output_constant): Likewise.
+
 2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
            Alan Hayward  <alan.hayward@arm.com>
            David Sherwood  <david.sherwood@arm.com>
index b1e9ed259ed986527c8ffec3eac3f3ad45f09856..3b16c7a2da71cd1e887939dce0820a0b345f486b 100644 (file)
@@ -22667,8 +22667,9 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p)
         for (i = 0; i < units; i++)
           {
             rtx elt = CONST_VECTOR_ELT (x, i);
-            assemble_real
-              (*CONST_DOUBLE_REAL_VALUE (elt), GET_MODE_INNER (mode),
+           assemble_real
+             (*CONST_DOUBLE_REAL_VALUE (elt),
+              as_a <scalar_float_mode> (GET_MODE_INNER (mode)),
               i == 0 ? BIGGEST_ALIGNMENT : size * BITS_PER_UNIT);
           }
 
index 049a78edefe9f85c6f84a4ecf0158d559e1d5674..242b65b6fdae0bb00ecbba2a10595ac42c7af62d 100644 (file)
   {
     rtx x = operands[0];
     making_const_table = TRUE;
-    switch (GET_MODE_CLASS (GET_MODE (x)))
+    scalar_float_mode float_mode;
+    if (is_a <scalar_float_mode> (GET_MODE (x), &float_mode))
+      assemble_real (*CONST_DOUBLE_REAL_VALUE (x), float_mode, BITS_PER_WORD);
+    else
       {
-      case MODE_FLOAT:
-       assemble_real (*CONST_DOUBLE_REAL_VALUE (x), GET_MODE (x),
-                      BITS_PER_WORD);
-       break;
-      default:
        /* XXX: Sometimes gcc does something really dumb and ends up with
           a HIGH in a constant pool entry, usually because it's trying to
           load into a VFP register.  We know this will always be used in
          x = XEXP (x, 0);
         assemble_integer (x, 4, BITS_PER_WORD, 1);
        mark_symbol_refs_as_used (x);
-        break;
       }
     return \"\";
   }"
   "*
   {
     making_const_table = TRUE;
-    switch (GET_MODE_CLASS (GET_MODE (operands[0])))
-      {
-      case MODE_FLOAT:
-       assemble_real (*CONST_DOUBLE_REAL_VALUE (operands[0]),
-                      GET_MODE (operands[0]), BITS_PER_WORD);
-       break;
-      default:
-        assemble_integer (operands[0], 8, BITS_PER_WORD, 1);
-        break;
-      }
+    scalar_float_mode float_mode;
+    if (is_a <scalar_float_mode> (GET_MODE (operands[0]), &float_mode))
+      assemble_real (*CONST_DOUBLE_REAL_VALUE (operands[0]),
+                    float_mode, BITS_PER_WORD);
+    else
+      assemble_integer (operands[0], 8, BITS_PER_WORD, 1);
     return \"\";
   }"
   [(set_attr "length" "8")
   "*
   {
     making_const_table = TRUE;
-    switch (GET_MODE_CLASS (GET_MODE (operands[0])))
-      {
-      case MODE_FLOAT:
-       assemble_real (*CONST_DOUBLE_REAL_VALUE (operands[0]),
-                      GET_MODE (operands[0]), BITS_PER_WORD);
-       break;
-      default:
-        assemble_integer (operands[0], 16, BITS_PER_WORD, 1);
-        break;
-      }
+    scalar_float_mode float_mode;
+    if (is_a <scalar_float_mode> (GET_MODE (operands[0]), &float_mode))
+      assemble_real (*CONST_DOUBLE_REAL_VALUE (operands[0]),
+                    float_mode, BITS_PER_WORD);
+    else
+      assemble_integer (operands[0], 16, BITS_PER_WORD, 1);
     return \"\";
   }"
   [(set_attr "length" "16")
index 52326c9cd7fedb39372c81390905a7763331e0c0..aae78fa5a0e7a6d4033d68205399fc453b9fcec3 100644 (file)
 {
   gcc_assert (GET_CODE (operands[0]) == CONST_DOUBLE);
   assemble_real (*CONST_DOUBLE_REAL_VALUE (operands[0]),
-                GET_MODE (operands[0]),
+                as_a <scalar_float_mode> (GET_MODE (operands[0])),
                 GET_MODE_BITSIZE (GET_MODE (operands[0])));
   return "";
 }
index 1f19298ba6e22e02a0dddc813eb15aa382bf4443..cb0ffb8210beadf0e33978d9aa9d9e64e4e77b68 100644 (file)
@@ -9498,7 +9498,8 @@ s390_output_pool_entry (rtx exp, machine_mode mode, unsigned int align)
     case MODE_DECIMAL_FLOAT:
       gcc_assert (GET_CODE (exp) == CONST_DOUBLE);
 
-      assemble_real (*CONST_DOUBLE_REAL_VALUE (exp), mode, align);
+      assemble_real (*CONST_DOUBLE_REAL_VALUE (exp),
+                    as_a <scalar_float_mode> (mode), align);
       break;
 
     case MODE_INT:
index 2ea4366719288e4dfb8d677ca9542184bd598f63..e2d55031a15d244fffaed27d8015063d043f4f32 100644 (file)
@@ -281,7 +281,7 @@ extern section *get_named_text_section (tree, const char *, const char *);
 /* Assemble the floating-point constant D into an object of size MODE.  ALIGN
    is the alignment of the constant in bits.  If REVERSE is true, D is output
    in reverse storage order.  */
-extern void assemble_real (REAL_VALUE_TYPE, machine_mode, unsigned,
+extern void assemble_real (REAL_VALUE_TYPE, scalar_float_mode, unsigned,
                           bool = false);
 
 /* Write the address of the entity given by SYMBOL to SEC.  */
index 91680d692b4a29662ab0c2c76a3547e74c0fb0c2..21fee7fd15f01e8789069030efde73ba99de088e 100644 (file)
@@ -2807,7 +2807,7 @@ assemble_integer (rtx x, unsigned int size, unsigned int align, int force)
    in reverse storage order.  */
 
 void
-assemble_real (REAL_VALUE_TYPE d, machine_mode mode, unsigned int align,
+assemble_real (REAL_VALUE_TYPE d, scalar_float_mode mode, unsigned int align,
               bool reverse)
 {
   long data[4] = {0, 0, 0, 0};
@@ -3877,7 +3877,8 @@ output_constant_pool_2 (machine_mode mode, rtx x, unsigned int align)
     case MODE_DECIMAL_FLOAT:
       {
        gcc_assert (CONST_DOUBLE_AS_FLOAT_P (x));
-       assemble_real (*CONST_DOUBLE_REAL_VALUE (x), mode, align, false);
+       assemble_real (*CONST_DOUBLE_REAL_VALUE (x),
+                      as_a <scalar_float_mode> (mode), align, false);
        break;
       }
 
@@ -4859,7 +4860,8 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align,
       if (TREE_CODE (exp) != REAL_CST)
        error ("initializer for floating value is not a floating constant");
       else
-       assemble_real (TREE_REAL_CST (exp), TYPE_MODE (TREE_TYPE (exp)),
+       assemble_real (TREE_REAL_CST (exp),
+                      SCALAR_FLOAT_TYPE_MODE (TREE_TYPE (exp)),
                       align, reverse);
       break;