diff options
author | Cesar Philippidis <cesar@codesourcery.com> | 2016-02-22 08:28:25 -0800 |
---|---|---|
committer | Cesar Philippidis <cesar@gcc.gnu.org> | 2016-02-22 08:28:25 -0800 |
commit | d5ace3b55dc544d0b2a75530998e9c928f452e16 (patch) | |
tree | 59462d6f260d9bd71ab8c3d35d4ed153aacb921e | |
parent | c4e360f44f346e795a671b200d33c61ba187bdcd (diff) | |
download | gcc-d5ace3b55dc544d0b2a75530998e9c928f452e16.zip gcc-d5ace3b55dc544d0b2a75530998e9c928f452e16.tar.gz gcc-d5ace3b55dc544d0b2a75530998e9c928f452e16.tar.bz2 |
nvptx.c (nvptx_gen_shuffle): Add support for QImode and HImode registers.
gcc/
* config/nvptx/nvptx.c (nvptx_gen_shuffle): Add support for QImode
and HImode registers.
libgomp/
* testsuite/libgomp.oacc-c-c++-common/vprop.c: New test.
From-SVN: r233607
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/nvptx/nvptx.c | 14 | ||||
-rw-r--r-- | libgomp/ChangeLog | 4 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.oacc-c-c++-common/vprop.c | 34 |
4 files changed, 57 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a352259..a76236e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-02-22 Cesar Philippidis <cesar@codesourcery.com> + + * config/nvptx/nvptx.c (nvptx_gen_shuffle): Add support for QImode + and HImode registers. + 2016-02-22 Richard Biener <rguenther@suse.de> PR tree-optimization/69882 diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index a955c04..33b495f 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -1306,6 +1306,20 @@ nvptx_gen_shuffle (rtx dst, rtx src, rtx idx, nvptx_shuffle_kind kind) end_sequence (); } break; + case QImode: + case HImode: + { + rtx tmp = gen_reg_rtx (SImode); + + start_sequence (); + emit_insn (gen_rtx_SET (tmp, gen_rtx_fmt_e (ZERO_EXTEND, SImode, src))); + emit_insn (nvptx_gen_shuffle (tmp, tmp, idx, kind)); + emit_insn (gen_rtx_SET (dst, gen_rtx_fmt_e (TRUNCATE, GET_MODE (dst), + tmp))); + res = get_insns (); + end_sequence (); + } + break; default: gcc_unreachable (); diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 732c6c3..1394126 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,7 @@ +2016-02-22 Cesar Philippidis <cesar@codesourcery.com> + + * testsuite/libgomp.oacc-c-c++-common/vprop.c: New test. + 2016-02-19 Jakub Jelinek <jakub@redhat.com> PR driver/69805 diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/vprop.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/vprop.c new file mode 100644 index 0000000..a9b63dc --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/vprop.c @@ -0,0 +1,34 @@ +#include <assert.h> + +#define test(type) \ +void \ +test_##type () \ +{ \ + type b[100]; \ + type i, j, x = -1, y = -1; \ + \ + _Pragma("acc parallel loop copyout (b)") \ + for (j = 0; j > -5; j--) \ + { \ + type c = x+y; \ + _Pragma("acc loop vector") \ + for (i = 0; i < 20; i++) \ + b[-j*20 + i] = c; \ + b[5-j] = c; \ + } \ + \ + for (i = 0; i < 100; i++) \ + assert (b[i] == -2); \ +} + +test(char) +test(short) + +int +main () +{ + test_char (); + test_short (); + + return 0; +} |