diff mbox series

[06/15] aarch64: Add an abstraction for scatter store type inference

Message ID mpth68k9qea.fsf@arm.com
State New
Headers show
Series aarch64: Add support for SVE2.1 | expand

Commit Message

Richard Sandiford Nov. 6, 2024, 6:19 p.m. UTC
Until now, all data arguments to a scatter store needed to have
32-bit or 64-bit elements.  This isn't true for the upcoming SVE2.1
svst1q scatter intrinsic, so this patch adds an abstraction around the
restriction.

gcc/
	* config/aarch64/aarch64-sve-builtins-shapes.cc
	(store_scatter_base::infer_vector_type): New virtual member function.
	(store_scatter_base::resolve): Use it.
---
 gcc/config/aarch64/aarch64-sve-builtins-shapes.cc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc b/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc
index f190770250f..e1204c283b6 100644
--- a/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc
+++ b/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc
@@ -994,12 +994,18 @@  struct store_scatter_base : public overloaded_base<0>
     mode_suffix_index mode;
     type_suffix_index type;
     if (!r.check_gp_argument (has_displacement_p ? 3 : 2, i, nargs)
-	|| (type = r.infer_sd_vector_type (nargs - 1)) == NUM_TYPE_SUFFIXES
+	|| (type = infer_vector_type (r, nargs - 1)) == NUM_TYPE_SUFFIXES
 	|| (mode = r.resolve_gather_address (i, type, false)) == MODE_none)
       return error_mark_node;
 
     return r.resolve_to (mode, type);
   }
+
+  virtual type_suffix_index
+  infer_vector_type (function_resolver &r, unsigned int argno) const
+  {
+    return r.infer_sd_vector_type (argno);
+  }
 };
 
 /* Base class for ternary operations in which the final argument is an