@@ -550,7 +550,7 @@ struct binary_imm_narrowt_base : public overloaded_base<0>
|| !r.require_integer_immediate (i + 2))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
};
@@ -649,7 +649,7 @@ struct load_contiguous_base : public overloaded_base<0>
|| (vnum_p && !r.require_scalar_type (i + 1, "int64_t")))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
};
@@ -739,7 +739,7 @@ struct mmla_def : public overloaded_base<0>
/* Make sure that the function exists now, since not all forms
follow a set pattern after this point. */
- tree res = r.resolve_to (r.mode_suffix_id, type);
+ tree res = r.resolve_to (type);
if (res == error_mark_node)
return res;
@@ -896,7 +896,7 @@ struct ternary_resize2_base : public overloaded_base<0>
MODIFIER))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
};
@@ -921,7 +921,7 @@ struct ternary_resize2_lane_base : public overloaded_base<0>
|| !r.require_integer_immediate (i + 3))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
};
@@ -1012,7 +1012,7 @@ struct unary_narrowt_base : public overloaded_base<0>
|| !r.require_derived_vector_type (i, i + 1, type, CLASS, r.HALF_SIZE))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
};
@@ -1218,7 +1218,7 @@ struct binary_n_def : public overloaded_base<0>
|| !r.require_derived_scalar_type (i + 1, r.SAME_TYPE_CLASS))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
};
SHAPE (binary_n)
@@ -1399,7 +1399,7 @@ struct binary_uint_def : public overloaded_base<0>
|| !r.require_derived_vector_type (i + 1, i, type, TYPE_unsigned))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
};
SHAPE (binary_uint)
@@ -1427,7 +1427,7 @@ struct binary_uint_n_def : public overloaded_base<0>
|| !r.require_derived_scalar_type (i + 1, TYPE_unsigned))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
};
SHAPE (binary_uint_n)
@@ -1484,7 +1484,7 @@ struct binary_uint64_n_def : public overloaded_base<0>
|| !r.require_scalar_type (i + 1, "uint64_t"))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
};
SHAPE (binary_uint64_n)
@@ -1539,7 +1539,7 @@ struct binary_wide_def : public overloaded_base<0>
r.HALF_SIZE))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
};
SHAPE (binary_wide)
@@ -1671,7 +1671,7 @@ struct compare_ptr_def : public overloaded_base<0>
|| !r.require_matching_pointer_type (i + 1, i, type))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
};
SHAPE (compare_ptr)
@@ -1700,7 +1700,7 @@ struct compare_scalar_def : public overloaded_base<1>
|| !r.require_matching_integer_scalar_type (i + 1, i, type))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, r.type_suffix_ids[0], type);
+ return r.resolve_to (type);
}
};
SHAPE (compare_scalar)
@@ -1877,7 +1877,7 @@ struct fold_left_def : public overloaded_base<0>
|| (type = r.infer_vector_type (i + 1)) == NUM_TYPE_SUFFIXES)
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
};
SHAPE (fold_left)
@@ -1905,7 +1905,7 @@ struct get_def : public overloaded_base<0>
|| !r.require_integer_immediate (i + 1))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
bool
@@ -1987,7 +1987,7 @@ struct inc_dec_pred_def : public overloaded_base<0>
|| !r.require_vector_type (i + 1, VECTOR_TYPE_svbool_t))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
};
SHAPE (inc_dec_pred)
@@ -2014,7 +2014,7 @@ struct inc_dec_pred_scalar_def : public overloaded_base<2>
|| !r.require_vector_type (i + 1, VECTOR_TYPE_svbool_t))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type, r.type_suffix_ids[1]);
+ return r.resolve_to (type, r.type_suffix_ids[1]);
}
};
SHAPE (inc_dec_pred_scalar)
@@ -2419,7 +2419,7 @@ struct set_def : public overloaded_base<0>
|| !r.require_derived_vector_type (i + 2, i, type))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
bool
@@ -2594,7 +2594,7 @@ struct store_def : public overloaded_base<0>
|| ((type = r.infer_tuple_type (nargs - 1)) == NUM_TYPE_SUFFIXES))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
};
SHAPE (store)
@@ -2714,7 +2714,7 @@ struct tbl_tuple_def : public overloaded_base<0>
|| !r.require_derived_vector_type (i + 1, i, type, TYPE_unsigned))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
};
SHAPE (tbl_tuple)
@@ -2959,7 +2959,7 @@ struct ternary_qq_lane_rotate_def : public overloaded_base<0>
|| !r.require_integer_immediate (i + 4))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
bool
@@ -3018,7 +3018,7 @@ struct ternary_qq_rotate_def : public overloaded_base<0>
|| !r.require_integer_immediate (i + 3))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
bool
@@ -3107,7 +3107,7 @@ struct ternary_uint_def : public overloaded_base<0>
|| !r.require_derived_vector_type (i + 2, i, type, TYPE_unsigned))
return error_mark_node;
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
}
};
SHAPE (ternary_uint)
@@ -3437,7 +3437,7 @@ struct unary_widen_def : public overloaded_base<0>
/* There is only a single form for predicates. */
if (type == TYPE_SUFFIX_b)
- return r.resolve_to (r.mode_suffix_id, type);
+ return r.resolve_to (type);
if (type_suffixes[type].integer_p
&& type_suffixes[type].element_bits < 64)
@@ -1255,6 +1255,25 @@ function_resolver::resolve_to (mode_suffix_index mode,
return res;
}
+/* A cut-down interface to the function above that keeps the mode suffix
+ unchanged. As a convenience, resolve_to (TYPE0) can be used for functions
+ whose first type suffix is explicit, with TYPE0 then describing the
+ second type suffix rather than the first. */
+tree
+function_resolver::resolve_to (type_suffix_index type0,
+ type_suffix_index type1)
+{
+ /* Handle convert-like functions in which the first type suffix is
+ explicit. */
+ if (type_suffix_ids[0] != NUM_TYPE_SUFFIXES && type1 == NUM_TYPE_SUFFIXES)
+ {
+ type1 = type0;
+ type0 = type_suffix_ids[0];
+ }
+
+ return resolve_to (mode_suffix_id, type0, type1);
+}
+
/* Require argument ARGNO to be a 32-bit or 64-bit scalar integer type.
Return the associated type suffix on success, otherwise report an
error and return NUM_TYPE_SUFFIXES. */
@@ -1636,7 +1655,7 @@ require_derived_vector_type (unsigned int argno,
/* Make sure that FIRST_TYPE itself is sensible before using it
as a basis for an error message. */
- if (resolve_to (mode_suffix_id, first_type) == error_mark_node)
+ if (resolve_to (first_type) == error_mark_node)
return false;
/* If the arguments have consistent type classes, but a link between
@@ -2202,7 +2221,7 @@ finish_opt_n_resolution (unsigned int argno, unsigned int first_argno,
/* Check the vector form normally. If that succeeds, raise an
error about having no corresponding _n form. */
- tree res = resolve_to (mode_suffix_id, inferred_type);
+ tree res = resolve_to (inferred_type);
if (res != error_mark_node)
error_at (location, "passing %qT to argument %d of %qE, but its"
" %qT form does not accept scalars",
@@ -2222,7 +2241,7 @@ finish_opt_n_resolution (unsigned int argno, unsigned int first_argno,
expected_tclass, expected_bits))
return error_mark_node;
- return resolve_to (mode_suffix_id, inferred_type);
+ return resolve_to (inferred_type);
}
/* Resolve a (possibly predicated) unary function. If the function uses
@@ -2279,12 +2298,7 @@ function_resolver::resolve_unary (type_class_index merge_tclass,
return error_mark_node;
}
- /* Handle convert-like functions in which the first type suffix is
- explicit. */
- if (type_suffix_ids[0] != NUM_TYPE_SUFFIXES)
- return resolve_to (mode_suffix_id, type_suffix_ids[0], type);
-
- return resolve_to (mode_suffix_id, type);
+ return resolve_to (type);
}
/* Resolve a (possibly predicated) function that takes NOPS like-typed
@@ -2309,7 +2323,7 @@ function_resolver::resolve_uniform (unsigned int nops, unsigned int nimm)
if (!require_integer_immediate (i))
return error_mark_node;
- return resolve_to (mode_suffix_id, type);
+ return resolve_to (type);
}
/* Resolve a (possibly predicated) function that offers a choice between
@@ -394,6 +394,7 @@ public:
tree resolve_to (mode_suffix_index,
type_suffix_index = NUM_TYPE_SUFFIXES,
type_suffix_index = NUM_TYPE_SUFFIXES);
+ tree resolve_to (type_suffix_index, type_suffix_index = NUM_TYPE_SUFFIXES);
type_suffix_index infer_integer_scalar_type (unsigned int);
type_suffix_index infer_pointer_type (unsigned int, bool = false);