@@ -815,14 +815,22 @@ struct load_gather_sv_base : public overloaded_base<0>
unsigned int i, nargs;
mode_suffix_index mode;
type_suffix_index type;
+ auto restrictions = get_target_type_restrictions (r);
if (!r.check_gp_argument (2, i, nargs)
- || (type = r.infer_pointer_type (i, true)) == NUM_TYPE_SUFFIXES
+ || (type = r.infer_pointer_type (i, true,
+ restrictions)) == NUM_TYPE_SUFFIXES
|| (mode = r.resolve_sv_displacement (i + 1, type, true),
mode == MODE_none))
return error_mark_node;
return r.resolve_to (mode, type);
}
+
+ virtual function_resolver::target_type_restrictions
+ get_target_type_restrictions (const function_instance &) const
+ {
+ return function_resolver::TARGET_32_64;
+ }
};
/* Base class for load_ext_gather_index and load_ext_gather_offset,
@@ -1998,10 +1998,12 @@ function_resolver::infer_64bit_scalar_integer_pair (unsigned int argno)
corresponding type suffix. Return that type suffix on success,
otherwise report an error and return NUM_TYPE_SUFFIXES.
GATHER_SCATTER_P is true if the function is a gather/scatter
- operation, and so requires a pointer to 32-bit or 64-bit data. */
+ operation. RESTRICTIONS describes any additional restrictions
+ on the target type. */
type_suffix_index
function_resolver::infer_pointer_type (unsigned int argno,
- bool gather_scatter_p)
+ bool gather_scatter_p,
+ target_type_restrictions restrictions)
{
tree actual = get_argument_type (argno);
if (actual == error_mark_node)
@@ -2027,7 +2029,7 @@ function_resolver::infer_pointer_type (unsigned int argno,
return NUM_TYPE_SUFFIXES;
}
unsigned int bits = type_suffixes[type].element_bits;
- if (gather_scatter_p && bits != 32 && bits != 64)
+ if (restrictions == TARGET_32_64 && bits != 32 && bits != 64)
{
error_at (location, "passing %qT to argument %d of %qE, which"
" expects a pointer to 32-bit or 64-bit elements",
@@ -488,6 +488,7 @@ public:
class function_resolver : public function_call_info
{
public:
+ enum target_type_restrictions { TARGET_ANY, TARGET_32_64 };
enum { SAME_SIZE = 256, HALF_SIZE, QUARTER_SIZE };
static const type_class_index SAME_TYPE_CLASS = NUM_TYPE_CLASSES;
@@ -518,7 +519,8 @@ public:
vector_type_index infer_predicate_type (unsigned int);
type_suffix_index infer_integer_scalar_type (unsigned int);
type_suffix_index infer_64bit_scalar_integer_pair (unsigned int);
- type_suffix_index infer_pointer_type (unsigned int, bool = false);
+ type_suffix_index infer_pointer_type (unsigned int, bool = false,
+ target_type_restrictions = TARGET_ANY);
sve_type infer_sve_type (unsigned int);
sve_type infer_vector_or_tuple_type (unsigned int, unsigned int);
type_suffix_index infer_vector_type (unsigned int);