OSDN Git Service

Turn UNITS_PER_SIMD_WORD into a target hook.
[pf3gnuchains/gcc-fork.git] / gcc / config / sparc / sparc.c
index ba034e6..71c94e1 100644 (file)
@@ -434,6 +434,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 bool sparc_units_per_simd_word (enum machine_mode);
 \f
 #ifdef SUBTARGET_ATTRIBUTE_TABLE
 /* Table of valid machine attributes.  */
@@ -571,6 +572,9 @@ 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_DWARF_HANDLE_FRAME_UNSPEC
 #define TARGET_DWARF_HANDLE_FRAME_UNSPEC sparc_dwarf_handle_frame_unspec
 
@@ -6233,6 +6237,14 @@ sparc_vector_mode_supported_p (enum machine_mode mode)
   return TARGET_VIS && VECTOR_MODE_P (mode) ? true : false;
 }
 \f
+/* Implement the TARGET_VECTORIZE_UNITS_PER_SIMD_WORD target hook.  */
+
+static bool
+sparc_units_per_simd_word (enum machine_mode mode ATTRIBUTE_UNUSED)
+{
+  return TARGET_VIS ? 8 : UNITS_PER_WORD;
+}
+\f
 /* Return the string to output an unconditional branch to LABEL, which is
    the operand number of the label.