summaryrefslogtreecommitdiff
path: root/gcc/config/nvptx/nvptx.c
diff options
context:
space:
mode:
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2017-06-06 12:25:04 +0000
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2017-06-06 12:25:04 +0000
commit9f54797167775013b3c4dbe99924d939f2230035 (patch)
treec3f3cce8d8616710b732b23c304fff408d5f85e8 /gcc/config/nvptx/nvptx.c
parent5e13ce0e3faa8ba631fb1ebeb6f9f790e487c17e (diff)
downloadgcc-9f54797167775013b3c4dbe99924d939f2230035.tar.gz
Add and use split_mode_p
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@248918 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/nvptx/nvptx.c')
-rw-r--r--gcc/config/nvptx/nvptx.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 75ecc94be1f..2eb55700247 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -328,6 +328,14 @@ maybe_split_mode (machine_mode 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). */
@@ -1277,7 +1285,7 @@ nvptx_declare_function_name (FILE *file, const char *name, const_tree decl)
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);
@@ -2396,9 +2404,8 @@ nvptx_print_operand (FILE *file, rtx x, int code)
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;
@@ -2499,7 +2506,7 @@ nvptx_print_operand (FILE *file, rtx x, int code)
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