+2017-06-06 Tom de Vries <tom@codesourcery.com>
+
+ * config/nvptx/nvptx.c (split_mode_p): New function.
+ (nvptx_declare_function_name, nvptx_print_operand): Use split_mode_p.
+
2017-06-06 Tom de Vries <tom@codesourcery.com>
* config/nvptx/nvptx.c (nvptx_print_operand): Use maybe_split_mode.
return VOIDmode;
}
+/* Return true if mode should be treated as two registers. */
+
+static bool
+split_mode_p (machine_mode mode)
+{
+ return maybe_split_mode (mode) != VOIDmode;
+}
+
/* Output a register, subreg, or register pair (with optional
enclosing braces). */
machine_mode mode = PSEUDO_REGNO_MODE (i);
machine_mode split = maybe_split_mode (mode);
- if (split != VOIDmode)
+ if (split_mode_p (mode))
mode = split;
fprintf (file, "\t.reg%s ", nvptx_ptx_type_from_mode (mode, true));
output_reg (file, i, split, -2);
if (x_code == SUBREG)
{
mode = GET_MODE (SUBREG_REG (x));
- machine_mode split = maybe_split_mode (mode);
- if (split != VOIDmode)
- mode = split;
+ if (split_mode_p (mode))
+ mode = maybe_split_mode (mode);
}
fprintf (file, "%s", nvptx_ptx_type_from_mode (mode, code == 't'));
break;
machine_mode inner_mode = GET_MODE (inner_x);
machine_mode split = maybe_split_mode (inner_mode);
- if (split != VOIDmode
+ if (split_mode_p (inner_mode)
&& (GET_MODE_SIZE (inner_mode) == GET_MODE_SIZE (mode)))
output_reg (file, REGNO (inner_x), split);
else