aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2017-07-19 13:05:09 +0000
committerTom de Vries <vries@gcc.gnu.org>2017-07-19 13:05:09 +0000
commit1310ff035d548056ad4a0def038a6c5dedd98b47 (patch)
treedeb51abeac0d14c7c2f99d8a535bd66a7a094429 /gcc
parent8d1628eb33d4f53832d6d4be2b0021353057a370 (diff)
downloadgcc-1310ff035d548056ad4a0def038a6c5dedd98b47.zip
gcc-1310ff035d548056ad4a0def038a6c5dedd98b47.tar.gz
gcc-1310ff035d548056ad4a0def038a6c5dedd98b47.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/nvptx/nvptx.c37
2 files changed, 37 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e6e7f9d..c09e0f1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+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>
PR tree-optimization/81346
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 78ce121..ebfa1e7 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -2405,9 +2405,15 @@ nvptx_print_operand (FILE *file, rtx x, int code)
case 'u':
if (x_code == SUBREG)
{
- mode = GET_MODE (SUBREG_REG (x));
- if (split_mode_p (mode))
- mode = maybe_split_mode (mode);
+ machine_mode inner_mode = GET_MODE (SUBREG_REG (x));
+ if (VECTOR_MODE_P (inner_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'));
break;
@@ -2508,7 +2514,14 @@ 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_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)))
output_reg (file, REGNO (inner_x), split);
else
@@ -2550,6 +2563,22 @@ nvptx_print_operand (FILE *file, rtx x, int code)
fprintf (file, "0d%08lx%08lx", vals[1], vals[0]);
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:
output_addr_const (file, x);
}