1  /* ACLE support for AArch64 SVE (function shapes)
       2     Copyright (C) 2018-2023 Free Software Foundation, Inc.
       3  
       4     This file is part of GCC.
       5  
       6     GCC is free software; you can redistribute it and/or modify it
       7     under the terms of the GNU General Public License as published by
       8     the Free Software Foundation; either version 3, or (at your option)
       9     any later version.
      10  
      11     GCC is distributed in the hope that it will be useful, but
      12     WITHOUT ANY WARRANTY; without even the implied warranty of
      13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      14     General Public License for more details.
      15  
      16     You should have received a copy of the GNU General Public License
      17     along with GCC; see the file COPYING3.  If not see
      18     <http://www.gnu.org/licenses/>.  */
      19  
      20  #ifndef GCC_AARCH64_SVE_BUILTINS_SHAPES_H
      21  #define GCC_AARCH64_SVE_BUILTINS_SHAPES_H
      22  
      23  namespace aarch64_sve
      24  {
      25    /* The naming convention is:
      26  
      27       - to use the name of the function if the rules are very specific to
      28         a particular function (e.g. svext, for which the range of the
      29         final immediate value is in no way generic).
      30  
      31       - to use names like "unary" etc. if the rules are somewhat generic,
      32         especially if there are no ranges involved.
      33  
      34       When using generic names, the handling of the final vector argument
      35       can be modified as follows:
      36  
      37       - an "_n" suffix changes the argument from a vector to a scalar.
      38  
      39       - an "_opt_n" suffix says that there are two forms of each function:
      40         one in which the argument is the usual vector, and one in which it
      41         is replaced by a scalar.
      42  
      43       - "_int" and "_uint" replace the argument's element type with a
      44         signed or unsigned integer of the same width.  The suffixes above
      45         then indicate whether this final argument is or might be a scalar.
      46  
      47       - "_int64" and "_uint64" similarly replace the argument's element type
      48         with int64_t or uint64_t.
      49  
      50       - "_wide" replaces the argument's element type with a 64-bit integer
      51         of the same signedness.  This only makes sense for integer elements.
      52  
      53       - "_lane" indicates that the argument is indexed by a constant lane
      54         number, provided as an immediately-following argument of type uint64_t.
      55  
      56       Also:
      57  
      58       - "inherent" means that the function takes no arguments.
      59  
      60       - "_rotate" means that the final argument is a rotation amount
      61         (0, 90, 180 or 270).
      62  
      63       - "_scalar" indicates that all data arguments are scalars rather
      64         than vectors.
      65  
      66       - in gather/scatter addresses, "sv" stands for "scalar base,
      67         vector displacement" while "vs" stands for "vector base,
      68         scalar displacement".
      69  
      70       - "_pred" indicates that the function takes an svbool_t argument
      71         that does not act as a governing predicate..  */
      72    namespace shapes
      73    {
      74      extern const function_shape *const adr_index;
      75      extern const function_shape *const adr_offset;
      76      extern const function_shape *const binary;
      77      extern const function_shape *const binary_int_opt_n;
      78      extern const function_shape *const binary_lane;
      79      extern const function_shape *const binary_long_lane;
      80      extern const function_shape *const binary_long_opt_n;
      81      extern const function_shape *const binary_n;
      82      extern const function_shape *const binary_narrowb_opt_n;
      83      extern const function_shape *const binary_narrowt_opt_n;
      84      extern const function_shape *const binary_opt_n;
      85      extern const function_shape *const binary_pred;
      86      extern const function_shape *const binary_rotate;
      87      extern const function_shape *const binary_scalar;
      88      extern const function_shape *const binary_to_uint;
      89      extern const function_shape *const binary_uint;
      90      extern const function_shape *const binary_uint_n;
      91      extern const function_shape *const binary_uint_opt_n;
      92      extern const function_shape *const binary_uint64_n;
      93      extern const function_shape *const binary_uint64_opt_n;
      94      extern const function_shape *const binary_wide;
      95      extern const function_shape *const binary_wide_opt_n;
      96      extern const function_shape *const clast;
      97      extern const function_shape *const compare;
      98      extern const function_shape *const compare_opt_n;
      99      extern const function_shape *const compare_ptr;
     100      extern const function_shape *const compare_scalar;
     101      extern const function_shape *const compare_wide_opt_n;
     102      extern const function_shape *const count_inherent;
     103      extern const function_shape *const count_pat;
     104      extern const function_shape *const count_pred;
     105      extern const function_shape *const count_vector;
     106      extern const function_shape *const create;
     107      extern const function_shape *const dupq;
     108      extern const function_shape *const ext;
     109      extern const function_shape *const fold_left;
     110      extern const function_shape *const get;
     111      extern const function_shape *const inc_dec;
     112      extern const function_shape *const inc_dec_pat;
     113      extern const function_shape *const inc_dec_pred;
     114      extern const function_shape *const inc_dec_pred_scalar;
     115      extern const function_shape *const inherent;
     116      extern const function_shape *const inherent_b;
     117      extern const function_shape *const load;
     118      extern const function_shape *const load_ext;
     119      extern const function_shape *const load_ext_gather_index;
     120      extern const function_shape *const load_ext_gather_index_restricted;
     121      extern const function_shape *const load_ext_gather_offset;
     122      extern const function_shape *const load_ext_gather_offset_restricted;
     123      extern const function_shape *const load_gather_sv;
     124      extern const function_shape *const load_gather_sv_restricted;
     125      extern const function_shape *const load_gather_vs;
     126      extern const function_shape *const load_replicate;
     127      extern const function_shape *const mmla;
     128      extern const function_shape *const pattern_pred;
     129      extern const function_shape *const prefetch;
     130      extern const function_shape *const prefetch_gather_index;
     131      extern const function_shape *const prefetch_gather_offset;
     132      extern const function_shape *const ptest;
     133      extern const function_shape *const rdffr;
     134      extern const function_shape *const reduction;
     135      extern const function_shape *const reduction_wide;
     136      extern const function_shape *const set;
     137      extern const function_shape *const setffr;
     138      extern const function_shape *const shift_left_imm_long;
     139      extern const function_shape *const shift_left_imm_to_uint;
     140      extern const function_shape *const shift_right_imm;
     141      extern const function_shape *const shift_right_imm_narrowb;
     142      extern const function_shape *const shift_right_imm_narrowt;
     143      extern const function_shape *const shift_right_imm_narrowb_to_uint;
     144      extern const function_shape *const shift_right_imm_narrowt_to_uint;
     145      extern const function_shape *const store;
     146      extern const function_shape *const store_scatter_index;
     147      extern const function_shape *const store_scatter_index_restricted;
     148      extern const function_shape *const store_scatter_offset;
     149      extern const function_shape *const store_scatter_offset_restricted;
     150      extern const function_shape *const tbl_tuple;
     151      extern const function_shape *const ternary_bfloat;
     152      extern const function_shape *const ternary_bfloat_lane;
     153      extern const function_shape *const ternary_bfloat_lanex2;
     154      extern const function_shape *const ternary_bfloat_opt_n;
     155      extern const function_shape *const ternary_intq_uintq_lane;
     156      extern const function_shape *const ternary_intq_uintq_opt_n;
     157      extern const function_shape *const ternary_lane;
     158      extern const function_shape *const ternary_lane_rotate;
     159      extern const function_shape *const ternary_long_lane;
     160      extern const function_shape *const ternary_long_opt_n;
     161      extern const function_shape *const ternary_opt_n;
     162      extern const function_shape *const ternary_qq_lane;
     163      extern const function_shape *const ternary_qq_lane_rotate;
     164      extern const function_shape *const ternary_qq_opt_n;
     165      extern const function_shape *const ternary_qq_rotate;
     166      extern const function_shape *const ternary_rotate;
     167      extern const function_shape *const ternary_shift_left_imm;
     168      extern const function_shape *const ternary_shift_right_imm;
     169      extern const function_shape *const ternary_uint;
     170      extern const function_shape *const ternary_uintq_intq;
     171      extern const function_shape *const ternary_uintq_intq_lane;
     172      extern const function_shape *const ternary_uintq_intq_opt_n;
     173      extern const function_shape *const tmad;
     174      extern const function_shape *const unary;
     175      extern const function_shape *const unary_convert;
     176      extern const function_shape *const unary_convert_narrowt;
     177      extern const function_shape *const unary_long;
     178      extern const function_shape *const unary_n;
     179      extern const function_shape *const unary_narrowb;
     180      extern const function_shape *const unary_narrowt;
     181      extern const function_shape *const unary_narrowb_to_uint;
     182      extern const function_shape *const unary_narrowt_to_uint;
     183      extern const function_shape *const unary_pred;
     184      extern const function_shape *const unary_to_int;
     185      extern const function_shape *const unary_to_uint;
     186      extern const function_shape *const unary_uint;
     187      extern const function_shape *const unary_widen;
     188    }
     189  }
     190  
     191  #endif