From 4a9721ca521d7a5626f1788afaf04a2b45960ea3 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Mon, 11 Nov 2024 12:32:17 +0000 Subject: aarch64: Factor out part of the SVE ext_def class This patch factors out some of ext_def into a base class, so that it can be reused for the SVE2.1 svextq intrinsic. gcc/ * config/aarch64/aarch64-sve-builtins-shapes.cc (ext_base): New base class, extracted from... (ext_def): ...here. --- gcc/config/aarch64/aarch64-sve-builtins-shapes.cc | 32 +++++++++++++---------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'gcc') diff --git a/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc b/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc index cf32154..62277af 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc +++ b/gcc/config/aarch64/aarch64-sve-builtins-shapes.cc @@ -735,6 +735,23 @@ struct binary_za_slice_opt_single_base : public overloaded_base<1> } }; +/* Base class for ext. */ +struct ext_base : public overloaded_base<0> +{ + void + build (function_builder &b, const function_group_info &group) const override + { + b.add_overloaded_functions (group, MODE_none); + build_all (b, "v0,v0,v0,su64", group, MODE_none); + } + + tree + resolve (function_resolver &r) const override + { + return r.resolve_uniform (2, 1); + } +}; + /* Base class for inc_dec and inc_dec_pat. */ struct inc_dec_base : public overloaded_base<0> { @@ -2413,21 +2430,8 @@ SHAPE (dupq) where the final argument is an integer constant expression that when multiplied by the number of bytes in t0 is in the range [0, 255]. */ -struct ext_def : public overloaded_base<0> +struct ext_def : public ext_base { - void - build (function_builder &b, const function_group_info &group) const override - { - b.add_overloaded_functions (group, MODE_none); - build_all (b, "v0,v0,v0,su64", group, MODE_none); - } - - tree - resolve (function_resolver &r) const override - { - return r.resolve_uniform (2, 1); - } - bool check (function_checker &c) const override { -- cgit v1.1