diff options
author | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-07-19 13:05:21 +0000 |
---|---|---|
committer | vries <vries@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-07-19 13:05:21 +0000 |
commit | fcac805ed9f2e4d899a3dd2959017884867995ca (patch) | |
tree | e4db190e9097d5c04e3dcdbdc2382673d54d4db5 /gcc/config/nvptx/nvptx.c | |
parent | 557d70411d6f17ad7ab808d018d697527f76bb1e (diff) | |
download | gcc-fcac805ed9f2e4d899a3dd2959017884867995ca.tar.gz |
Add v2si support for nvptx
2017-07-19 Tom de Vries <tom@codesourcery.com>
* config/nvptx/nvptx-modes.def: New file. Add V2SImode.
* config/nvptx/nvptx.c (nvptx_ptx_type_from_mode): Handle V2SImode.
(nvptx_vector_mode_supported): New function. Allow V2SImode.
(TARGET_VECTOR_MODE_SUPPORTED_P): Redefine to nvptx_vector_mode_supported.
* config/nvptx/nvptx.md (VECIM): New mode iterator. Add V2SI.
(mov<VECIM>_insn): New define_insn.
(define_expand "mov<VECIM>): New define_expand.
* gcc.target/nvptx/slp-run.c: New test.
* gcc.target/nvptx/slp.c: New test.
* gcc.target/nvptx/v2si-cvt.c: New test.
* gcc.target/nvptx/v2si-run.c: New test.
* gcc.target/nvptx/v2si.c: New test.
* gcc.target/nvptx/vec.inc: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250340 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/nvptx/nvptx.c')
-rw-r--r-- | gcc/config/nvptx/nvptx.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index ebfa1e7b00e..bc94713bf0a 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -236,6 +236,9 @@ nvptx_ptx_type_from_mode (machine_mode mode, bool promote) case DFmode: return ".f64"; + case V2SImode: + return ".v2.u32"; + default: gcc_unreachable (); } @@ -5433,6 +5436,12 @@ nvptx_cannot_force_const_mem (machine_mode mode ATTRIBUTE_UNUSED, return true; } +static bool +nvptx_vector_mode_supported (machine_mode mode) +{ + return mode == V2SImode; +} + #undef TARGET_OPTION_OVERRIDE #define TARGET_OPTION_OVERRIDE nvptx_option_override @@ -5550,6 +5559,9 @@ nvptx_cannot_force_const_mem (machine_mode mode ATTRIBUTE_UNUSED, #undef TARGET_CANNOT_FORCE_CONST_MEM #define TARGET_CANNOT_FORCE_CONST_MEM nvptx_cannot_force_const_mem +#undef TARGET_VECTOR_MODE_SUPPORTED_P +#define TARGET_VECTOR_MODE_SUPPORTED_P nvptx_vector_mode_supported + struct gcc_target targetm = TARGET_INITIALIZER; #include "gt-nvptx.h" |