Commit 1310ff03 by Tom de Vries Committed by Tom de Vries

Add generic v2 vector mode support for nvptx

2017-07-19  Tom de Vries  <tom@codesourcery.com>

	* config/nvptx/nvptx.c (nvptx_print_operand): Handle v2 vector mode.

From-SVN: r250339
parent 8d1628eb
2017-07-19 Tom de Vries <tom@codesourcery.com>
* config/nvptx/nvptx.c (nvptx_print_operand): Handle v2 vector mode.
2017-07-19 Jakub Jelinek <jakub@redhat.com> 2017-07-19 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/81346 PR tree-optimization/81346
......
...@@ -2405,9 +2405,15 @@ nvptx_print_operand (FILE *file, rtx x, int code) ...@@ -2405,9 +2405,15 @@ nvptx_print_operand (FILE *file, rtx x, int code)
case 'u': case 'u':
if (x_code == SUBREG) if (x_code == SUBREG)
{ {
mode = GET_MODE (SUBREG_REG (x)); machine_mode inner_mode = GET_MODE (SUBREG_REG (x));
if (split_mode_p (mode)) if (VECTOR_MODE_P (inner_mode)
mode = maybe_split_mode (mode); && (GET_MODE_SIZE (mode)
<= GET_MODE_SIZE (GET_MODE_INNER (inner_mode))))
mode = GET_MODE_INNER (inner_mode);
else if (split_mode_p (inner_mode))
mode = maybe_split_mode (inner_mode);
else
mode = inner_mode;
} }
fprintf (file, "%s", nvptx_ptx_type_from_mode (mode, code == 't')); fprintf (file, "%s", nvptx_ptx_type_from_mode (mode, code == 't'));
break; break;
...@@ -2508,7 +2514,14 @@ nvptx_print_operand (FILE *file, rtx x, int code) ...@@ -2508,7 +2514,14 @@ nvptx_print_operand (FILE *file, rtx x, int code)
machine_mode inner_mode = GET_MODE (inner_x); machine_mode inner_mode = GET_MODE (inner_x);
machine_mode split = maybe_split_mode (inner_mode); machine_mode split = maybe_split_mode (inner_mode);
if (split_mode_p (inner_mode) if (VECTOR_MODE_P (inner_mode)
&& (GET_MODE_SIZE (mode)
<= GET_MODE_SIZE (GET_MODE_INNER (inner_mode))))
{
output_reg (file, REGNO (inner_x), VOIDmode);
fprintf (file, ".%s", SUBREG_BYTE (x) == 0 ? "x" : "y");
}
else if (split_mode_p (inner_mode)
&& (GET_MODE_SIZE (inner_mode) == GET_MODE_SIZE (mode))) && (GET_MODE_SIZE (inner_mode) == GET_MODE_SIZE (mode)))
output_reg (file, REGNO (inner_x), split); output_reg (file, REGNO (inner_x), split);
else else
...@@ -2550,6 +2563,22 @@ nvptx_print_operand (FILE *file, rtx x, int code) ...@@ -2550,6 +2563,22 @@ nvptx_print_operand (FILE *file, rtx x, int code)
fprintf (file, "0d%08lx%08lx", vals[1], vals[0]); fprintf (file, "0d%08lx%08lx", vals[1], vals[0]);
break; break;
case CONST_VECTOR:
{
unsigned n = CONST_VECTOR_NUNITS (x);
fprintf (file, "{ ");
for (unsigned i = 0; i < n; ++i)
{
if (i != 0)
fprintf (file, ", ");
rtx elem = CONST_VECTOR_ELT (x, i);
output_addr_const (file, elem);
}
fprintf (file, " }");
}
break;
default: default:
output_addr_const (file, x); output_addr_const (file, x);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment