GCC Middle and Back End API Reference
|
#include <rtx-vector-builder.h>
Public Member Functions | |
rtx_vector_builder () | |
rtx_vector_builder (machine_mode, unsigned int, unsigned int) | |
rtx | build (rtvec) |
rtx | build () |
machine_mode | mode () const |
void | new_vector (machine_mode, unsigned int, unsigned int) |
poly_uint64 | full_nelts () const |
unsigned int | npatterns () const |
unsigned int | nelts_per_pattern () const |
unsigned int | encoded_nelts () const |
bool | encoded_full_vector_p () const |
rtx | elt (unsigned int) const |
unsigned int | count_dups (int, int, int) const |
bool | operator== (const rtx_vector_builder &) const |
bool | operator!= (const rtx_vector_builder &x) const |
bool | new_unary_operation (machine_mode, rtx, bool) |
bool | new_binary_operation (machine_mode, rtx, rtx, bool) |
void | finalize () |
vec< rtx, va_heap > | to_vec_legacy () |
Static Public Member Functions | |
static unsigned int | binary_encoded_nelts (rtx, rtx) |
Protected Member Functions | |
void | new_vector (poly_uint64, unsigned int, unsigned int) |
void | reshape (unsigned int, unsigned int) |
bool | repeating_sequence_p (unsigned int, unsigned int, unsigned int) |
bool | stepped_sequence_p (unsigned int, unsigned int, unsigned int) |
bool | try_npatterns (unsigned int) |
Private Types | |
typedef vector_builder< rtx, machine_mode, rtx_vector_builder > | parent |
Private Member Functions | |
bool | equal_p (rtx, rtx) const |
bool | allow_steps_p () const |
bool | integral_p (rtx) const |
poly_wide_int | step (rtx, rtx) const |
rtx | apply_step (rtx, unsigned int, const poly_wide_int &) const |
bool | can_elide_p (rtx) const |
void | note_representative (rtx *, rtx) |
rtx | find_cached_value () |
rtx_vector_builder * | derived () |
const rtx_vector_builder * | derived () const |
Static Private Member Functions | |
static poly_uint64 | shape_nelts (machine_mode mode) |
static poly_uint64 | nelts_of (const_rtx x) |
static unsigned int | npatterns_of (const_rtx x) |
static unsigned int | nelts_per_pattern_of (const_rtx x) |
Private Attributes | |
machine_mode | m_mode |
poly_uint64 | m_full_nelts |
unsigned int | m_npatterns |
unsigned int | m_nelts_per_pattern |
vec< rtx, va_heap, vl_embed > | m_auto |
unsigned char | m_data [sizeof(rtx) *N] |
Friends | |
class | vector_builder< rtx, machine_mode, rtx_vector_builder > |
A class for building vector rtx constants. Copyright (C) 2017-2024 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
This class is used to build VECTOR_CSTs from a sequence of elements. See vector_builder for more details.
|
private |
|
inline |
|
inline |
Create a new builder for a vector of mode MODE. Initially encode the value as NPATTERNS interleaved patterns with NELTS_PER_PATTERN elements each.
References mode(), vector_builder< rtx, machine_mode, rtx_vector_builder >::nelts_per_pattern(), new_vector(), and vector_builder< rtx, machine_mode, rtx_vector_builder >::npatterns().
|
inlineprivate |
Return true if a stepped representation is OK. We don't allow linear series for anything other than integers, to avoid problems with rounding.
References GET_MODE_INNER, is_a(), and m_mode.
|
private |
Return a vector element with the value BASE + FACTOR * STEP.
References as_a(), GET_MODE_INNER, immed_wide_int_const(), m_mode, step(), and wi::to_poly_wide().
|
staticinherited |
Return the number of elements that the caller needs to operate on in order to handle a binary operation on vector constants VEC1 and VEC2. This static function is used instead of new_binary_operation if the result of the operation is not a constant vector.
rtx rtx_vector_builder::build | ( | ) |
Return a CONST_VECTOR for the current constant.
References CONST_VECTOR_NELTS_PER_PATTERN, CONST_VECTOR_NPATTERNS, vector_builder< rtx, machine_mode, rtx_vector_builder >::elt(), vector_builder< rtx, machine_mode, rtx_vector_builder >::encoded_nelts(), vector_builder< rtx, machine_mode, rtx_vector_builder >::finalize(), find_cached_value(), GET_MODE_NUNITS(), i, m_mode, vector_builder< rtx, machine_mode, rtx_vector_builder >::nelts_per_pattern(), vector_builder< rtx, machine_mode, rtx_vector_builder >::npatterns(), rtvec_alloc(), and RTVEC_ELT.
A class for building vector rtx constants. Copyright (C) 2017-2024 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
Return a CONST_VECTOR for the current constant. V is an existing rtvec that contains all the elements.
References CONST_VECTOR_NELTS_PER_PATTERN, CONST_VECTOR_NPATTERNS, vector_builder< rtx, machine_mode, rtx_vector_builder >::finalize(), find_cached_value(), m_mode, vector_builder< rtx, machine_mode, rtx_vector_builder >::nelts_per_pattern(), and vector_builder< rtx, machine_mode, rtx_vector_builder >::npatterns().
Referenced by const_vector_from_tree(), const_vector_mask_from_tree(), expand_vec_perm_var(), gen_const_vec_duplicate(), gen_const_vec_series(), gen_rtx_CONST_VECTOR(), native_decode_vector_rtx(), simplify_const_binary_operation(), simplify_const_unary_operation(), and vec_perm_indices_to_rtx().
|
inherited |
Return the number of leading duplicate elements in the range [START:END:STEP]. The value is always at least 1.
|
inlineprivateinherited |
|
inlineprivateinherited |
|
inherited |
Return the value of vector element I, which might or might not be encoded explicitly.
Referenced by build(), find_cached_value(), and integral_p().
|
inlineinherited |
Return true if every element of the vector is explicitly encoded.
|
inlineinherited |
Return the number of elements that are explicitly encoded. The vec starts with these explicitly-encoded elements and may contain additional elided elements.
Referenced by build(), and find_cached_value().
Return true if elements ELT1 and ELT2 are equal.
References rtx_equal_p().
|
inherited |
|
private |
Check whether there is a global cached value for the vector. Return it if so, otherwise return null.
References CONST0_RTX, const0_rtx, CONST1_RTX, const1_rtx, CONSTM1_RTX, constm1_rtx, vector_builder< rtx, machine_mode, rtx_vector_builder >::elt(), vector_builder< rtx, machine_mode, rtx_vector_builder >::encoded_nelts(), gcc_unreachable, GET_MODE_CLASS, GET_MODE_INNER, m_mode, and NULL_RTX.
|
inlineinherited |
Return true if element ELT can be interpreted as an integer.
References CONST_SCALAR_INT_P, and vector_builder< rtx, machine_mode, rtx_vector_builder >::elt().
|
inline |
References m_mode.
Referenced by new_vector(), rtx_vector_builder(), and shape_nelts().
|
inlinestaticprivate |
References CONST_VECTOR_NUNITS.
|
inlineinherited |
Referenced by build(), build(), new_vector(), and rtx_vector_builder().
|
inlinestaticprivate |
References CONST_VECTOR_NELTS_PER_PATTERN.
|
inherited |
Try to start building a new vector of shape SHAPE that holds the result of a binary operation on vector constants VEC1 and VEC2. ALLOW_STEPPED_P is true if the operation can handle stepped encodings directly, without having to expand the full sequence. Return true if the operation is possible. Leave the builder unchanged otherwise.
|
inherited |
Try to start building a new vector of shape SHAPE that holds the result of a unary operation on vector constant VEC. ALLOW_STEPPED_P is true if the operation can handle stepped encodings directly, without having to expand the full sequence. Return true if the operation is possible, which it always is when ALLOW_STEPPED_P is true. Leave the builder unchanged otherwise.
|
inline |
Start building a new vector of mode MODE. Initially encode the value as NPATTERNS interleaved patterns with NELTS_PER_PATTERN elements each.
References GET_MODE_NUNITS(), m_mode, mode(), vector_builder< rtx, machine_mode, rtx_vector_builder >::nelts_per_pattern(), vector_builder< rtx, machine_mode, rtx_vector_builder >::new_vector(), and vector_builder< rtx, machine_mode, rtx_vector_builder >::npatterns().
Referenced by rtx_vector_builder().
|
protectedinherited |
Start building a vector that has FULL_NELTS elements. Initially encode it using NPATTERNS patterns with NELTS_PER_PATTERN each.
Referenced by new_vector().
|
inlineinherited |
Referenced by build(), build(), new_vector(), and rtx_vector_builder().
|
inlinestaticprivate |
References CONST_VECTOR_NPATTERNS.
|
inlineinherited |
|
inherited |
Return true if this vector and OTHER have the same elements and are encoded in the same way.
|
protectedinherited |
Return true if elements [START, END) contain a repeating sequence of STEP elements.
|
protectedinherited |
Change the encoding to NPATTERNS patterns of NELTS_PER_PATTERN each, but without changing the underlying vector.
|
inlinestaticprivate |
References GET_MODE_NUNITS(), and mode().
|
inlineprivate |
Return the value of element ELT2 minus the value of element ELT1. Both elements are known to be CONST_SCALAR_INT_Ps.
References GET_MODE_INNER, m_mode, and wi::to_poly_wide().
Referenced by apply_step().
|
protectedinherited |
Return true if elements [START, END) contain STEP interleaved linear series.
|
protectedinherited |
Try to change the number of encoded patterns to NPATTERNS, returning true on success.
|
friend |
|
privateinherited |
|
private |
Referenced by allow_steps_p(), apply_step(), build(), build(), find_cached_value(), mode(), new_vector(), and step().
|
privateinherited |
|
privateinherited |