+2016-11-02 Max Filippov <jcmvbkbc@gmail.com>
+
+ * config/xtensa/xtensa.c (xtensa_output_integer_literal_parts):
+ New function.
+ (xtensa_output_literal): Use xtensa_output_integer_literal_parts
+ to format MODE_INT and MODE_PARTIAL_INT literals.
+
2016-11-02 Segher Boessenkool <segher@kernel.crashing.org>
PR target/78168
return false;
}
+static void
+xtensa_output_integer_literal_parts (FILE *file, rtx x, int size)
+{
+ if (size > 4 && !(size & (size - 1)))
+ {
+ rtx first, second;
+
+ split_double (x, &first, &second);
+ xtensa_output_integer_literal_parts (file, first, size / 2);
+ fputs (", ", file);
+ xtensa_output_integer_literal_parts (file, second, size / 2);
+ }
+ else if (size == 4)
+ {
+ output_addr_const (file, x);
+ }
+ else
+ {
+ gcc_unreachable();
+ }
+}
void
xtensa_output_literal (FILE *file, rtx x, machine_mode mode, int labelno)
{
long value_long[2];
- int size;
- rtx first, second;
fprintf (file, "\t.literal .LC%u, ", (unsigned) labelno);
case MODE_INT:
case MODE_PARTIAL_INT:
- size = GET_MODE_SIZE (mode);
- switch (size)
- {
- case 4:
- output_addr_const (file, x);
- fputs ("\n", file);
- break;
-
- case 8:
- split_double (x, &first, &second);
- output_addr_const (file, first);
- fputs (", ", file);
- output_addr_const (file, second);
- fputs ("\n", file);
- break;
-
- default:
- gcc_unreachable ();
- }
+ xtensa_output_integer_literal_parts (file, x, GET_MODE_SIZE (mode));
+ fputs ("\n", file);
break;
default: