diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-07 14:34:44 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-07 14:34:44 +0000 |
commit | b24d851fa7cad44fd130f4386f28062d6c395bb1 (patch) | |
tree | e369542c279196e8b7be20440bc887cf9eed16f3 /gcc/config/sparc/sparc.c | |
parent | 0d82568791b8565cc38d03ac20a63863cc74f1fb (diff) | |
download | gcc-b24d851fa7cad44fd130f4386f28062d6c395bb1.tar.gz |
2010-10-07 Richard Guenther <rguenther@suse.de>
* target.def (units_per_simd_word): Rename to ...
(preferred_simd_mode): ... this. Return mode instead of size.
* targhooks.c (default_units_per_simd_word): Rename to ...
(default_preferred_simd_mode): ... this. Return word_mode.
* targhooks.h (default_preferred_simd_mode): Declare.
* config/arm/arm.c (arm_units_per_simd_word): Rename to ...
(arm_preferred_simd_mode): ... this. Re-implement.
* config/i386/i386.c (ix86_units_per_simd_word): Rename to ...
(ix86_preferred_simd_mode): ... this. Re-implement.
* config/sparc/sparc.c (sparc_units_per_simd_word): Rename to ...
(sparc_preferred_simd_mode): ... this. Re-implement.
* config/mips/mips.c (mips_units_per_simd_word): Rename to ...
(mips_preferred_simd_mode): ... this. Re-implement.
* config/rs6000/rs6000.c (rs6000_units_per_simd_word): Rename to ...
(rs6000_preferred_simd_mode): ... this. Re-implement.
* tree-vect-stmts.c (get_vectype_for_scalar_type): Adjust.
* doc/tm.texi.in (TARGET_VECTORIZE_UNITS_PER_SIMD_WORD): Remove.
(TARGET_VECTORIZE_PREFERRED_SIMD_MODE): Document.
* doc/tm.texi: Update.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165114 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/sparc/sparc.c')
-rw-r--r-- | gcc/config/sparc/sparc.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 36c60533d98..d672d8f6e3e 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -435,7 +435,7 @@ static bool sparc_can_eliminate (const int, const int); static const char *sparc_mangle_type (const_tree); #endif static void sparc_trampoline_init (rtx, tree, rtx); -static unsigned int sparc_units_per_simd_word (enum machine_mode); +static enum machine_mode sparc_preferred_simd_mode (enum machine_mode); #ifdef SUBTARGET_ATTRIBUTE_TABLE /* Table of valid machine attributes. */ @@ -573,8 +573,8 @@ static bool fpu_option_set = false; #undef TARGET_VECTOR_MODE_SUPPORTED_P #define TARGET_VECTOR_MODE_SUPPORTED_P sparc_vector_mode_supported_p -#undef TARGET_VECTORIZE_UNITS_PER_SIMD_WORD -#define TARGET_VECTORIZE_UNITS_PER_SIMD_WORD sparc_units_per_simd_word +#undef TARGET_VECTORIZE_PREFERRED_SIMD_MODE +#define TARGET_VECTORIZE_PREFERRED_SIMD_MODE sparc_preferred_simd_mode #undef TARGET_DWARF_HANDLE_FRAME_UNSPEC #define TARGET_DWARF_HANDLE_FRAME_UNSPEC sparc_dwarf_handle_frame_unspec @@ -6244,12 +6244,25 @@ sparc_vector_mode_supported_p (enum machine_mode mode) return TARGET_VIS && VECTOR_MODE_P (mode) ? true : false; } -/* Implement the TARGET_VECTORIZE_UNITS_PER_SIMD_WORD target hook. */ +/* Implement the TARGET_VECTORIZE_PREFERRED_SIMD_MODE target hook. */ -static unsigned int -sparc_units_per_simd_word (enum machine_mode mode ATTRIBUTE_UNUSED) +static enum machine_mode +sparc_preferred_simd_mode (enum machine_mode mode) { - return TARGET_VIS ? 8 : UNITS_PER_WORD; + if (TARGET_VIS) + switch (mode) + { + case SImode: + return V2SImode; + case HImode: + return V4HImode; + case QImode: + return V8QImode; + + default:; + } + + return word_mode; } /* Return the string to output an unconditional branch to LABEL, which is |