===================================================================
@@ -1848,7 +1848,7 @@ mode @var{mode}. The default is\n\
equal to @code{word_mode}, because the vectorizer can do some\n\
transformations even in absence of specialized @acronym{SIMD} hardware.",
machine_mode,
- (machine_mode mode),
+ (scalar_mode mode),
default_preferred_simd_mode)
/* Returns a mask of vector sizes to iterate over when auto-vectorizing
===================================================================
@@ -100,7 +100,7 @@ extern bool default_builtin_vector_align
default_builtin_support_vector_misalignment (machine_mode mode,
const_tree,
int, bool);
-extern machine_mode default_preferred_simd_mode (machine_mode mode);
+extern machine_mode default_preferred_simd_mode (scalar_mode mode);
extern unsigned int default_autovectorize_vector_sizes (void);
extern machine_mode default_get_mask_mode (unsigned, unsigned);
extern void *default_init_cost (struct loop *);
===================================================================
@@ -1156,7 +1156,7 @@ default_builtin_support_vector_misalignm
possibly adds/subtracts using bit-twiddling. */
machine_mode
-default_preferred_simd_mode (machine_mode mode ATTRIBUTE_UNUSED)
+default_preferred_simd_mode (scalar_mode)
{
return word_mode;
}
===================================================================
@@ -11163,7 +11163,7 @@ aarch64_simd_container_mode (machine_mod
/* Return 128-bit container as the preferred SIMD mode for MODE. */
static machine_mode
-aarch64_preferred_simd_mode (machine_mode mode)
+aarch64_preferred_simd_mode (scalar_mode mode)
{
return aarch64_simd_container_mode (mode, 128);
}
===================================================================
@@ -328,7 +328,7 @@ arc_vector_mode_supported_p (machine_mod
/* Implements target hook TARGET_VECTORIZE_PREFERRED_SIMD_MODE. */
static machine_mode
-arc_preferred_simd_mode (machine_mode mode)
+arc_preferred_simd_mode (scalar_mode mode)
{
switch (mode)
{
===================================================================
@@ -268,7 +268,7 @@ static bool xscale_sched_adjust_cost (rt
static bool fa726te_sched_adjust_cost (rtx_insn *, int, rtx_insn *, int *);
static bool arm_array_mode_supported_p (machine_mode,
unsigned HOST_WIDE_INT);
-static machine_mode arm_preferred_simd_mode (machine_mode);
+static machine_mode arm_preferred_simd_mode (scalar_mode);
static bool arm_class_likely_spilled_p (reg_class_t);
static HOST_WIDE_INT arm_vector_alignment (const_tree type);
static bool arm_vector_alignment_reachable (const_tree type, bool is_packed);
@@ -26947,7 +26947,7 @@ arm_array_mode_supported_p (machine_mode
widths are supported properly by the middle-end. */
static machine_mode
-arm_preferred_simd_mode (machine_mode mode)
+arm_preferred_simd_mode (scalar_mode mode)
{
if (TARGET_NEON)
switch (mode)
===================================================================
@@ -6238,7 +6238,7 @@ c6x_vector_mode_supported_p (machine_mod
/* Implements TARGET_VECTORIZE_PREFERRED_SIMD_MODE. */
static machine_mode
-c6x_preferred_simd_mode (machine_mode mode)
+c6x_preferred_simd_mode (scalar_mode mode)
{
switch (mode)
{
===================================================================
@@ -2773,7 +2773,7 @@ epiphany_min_divisions_for_recip_mul (ma
}
static machine_mode
-epiphany_preferred_simd_mode (machine_mode mode ATTRIBUTE_UNUSED)
+epiphany_preferred_simd_mode (scalar_mode mode ATTRIBUTE_UNUSED)
{
return TARGET_VECT_DOUBLE ? DImode : SImode;
}
===================================================================
@@ -51255,7 +51255,7 @@ ix86_reassociation_width (unsigned int,
place emms and femms instructions. */
static machine_mode
-ix86_preferred_simd_mode (machine_mode mode)
+ix86_preferred_simd_mode (scalar_mode mode)
{
if (!TARGET_SSE)
return word_mode;
===================================================================
@@ -13324,7 +13324,7 @@ mips_scalar_mode_supported_p (scalar_mod
/* Implement TARGET_VECTORIZE_PREFERRED_SIMD_MODE. */
static machine_mode
-mips_preferred_simd_mode (machine_mode mode)
+mips_preferred_simd_mode (scalar_mode mode)
{
if (TARGET_PAIRED_SINGLE_FLOAT
&& mode == SFmode)
===================================================================
@@ -5876,7 +5876,7 @@ rs6000_builtin_vectorization_cost (enum
/* Implement targetm.vectorize.preferred_simd_mode. */
static machine_mode
-rs6000_preferred_simd_mode (machine_mode mode)
+rs6000_preferred_simd_mode (scalar_mode mode)
{
if (TARGET_VSX)
switch (mode)
===================================================================
@@ -5770,7 +5770,7 @@ rs6000_builtin_vectorization_cost (enum
/* Implement targetm.vectorize.preferred_simd_mode. */
static machine_mode
-rs6000_preferred_simd_mode (machine_mode mode)
+rs6000_preferred_simd_mode (scalar_mode mode)
{
if (TARGET_VSX)
switch (mode)
===================================================================
@@ -15491,7 +15491,7 @@ #define FPC_DXC_SHIFT HOST_WIDE_INT_UC
/* Return the vector mode to be used for inner mode MODE when doing
vectorization. */
static machine_mode
-s390_preferred_simd_mode (machine_mode mode)
+s390_preferred_simd_mode (scalar_mode mode)
{
if (TARGET_VX)
switch (mode)
===================================================================
@@ -661,7 +661,7 @@ static void sparc_conditional_register_u
static const char *sparc_mangle_type (const_tree);
#endif
static void sparc_trampoline_init (rtx, tree, rtx);
-static machine_mode sparc_preferred_simd_mode (machine_mode);
+static machine_mode sparc_preferred_simd_mode (scalar_mode);
static reg_class_t sparc_preferred_reload_class (rtx x, reg_class_t rclass);
static bool sparc_lra_p (void);
static bool sparc_print_operand_punct_valid_p (unsigned char);
@@ -7684,7 +7684,7 @@ sparc_vector_mode_supported_p (machine_m
/* Implement the TARGET_VECTORIZE_PREFERRED_SIMD_MODE target hook. */
static machine_mode
-sparc_preferred_simd_mode (machine_mode mode)
+sparc_preferred_simd_mode (scalar_mode mode)
{
if (TARGET_VIS)
switch (mode)
===================================================================
@@ -5796,7 +5796,7 @@ the elements in the vectors should be of
parameter is true if the memory access is defined in a packed struct.
@end deftypefn
-@deftypefn {Target Hook} machine_mode TARGET_VECTORIZE_PREFERRED_SIMD_MODE (machine_mode @var{mode})
+@deftypefn {Target Hook} machine_mode TARGET_VECTORIZE_PREFERRED_SIMD_MODE (scalar_mode @var{mode})
This hook should return the preferred mode for vectorizing scalar
mode @var{mode}. The default is
equal to @code{word_mode}, because the vectorizer can do some
===================================================================
@@ -524,7 +524,11 @@ can_vec_mask_load_store_p (machine_mode
/* See if there is any chance the mask load or store might be
vectorized. If not, punt. */
- vmode = targetm.vectorize.preferred_simd_mode (mode);
+ scalar_mode smode;
+ if (!is_a <scalar_mode> (mode, &smode))
+ return false;
+
+ vmode = targetm.vectorize.preferred_simd_mode (smode);
if (!VECTOR_MODE_P (vmode))
return false;
@@ -541,9 +545,9 @@ can_vec_mask_load_store_p (machine_mode
{
unsigned int cur = 1 << floor_log2 (vector_sizes);
vector_sizes &= ~cur;
- if (cur <= GET_MODE_SIZE (mode))
+ if (cur <= GET_MODE_SIZE (smode))
continue;
- vmode = mode_for_vector (mode, cur / GET_MODE_SIZE (mode));
+ vmode = mode_for_vector (smode, cur / GET_MODE_SIZE (smode));
mask_mode = targetm.vectorize.get_mask_mode (GET_MODE_NUNITS (vmode),
cur);
if (VECTOR_MODE_P (vmode)