> This should probably use GET_MODE_PRECISION as well. > > OK if it bootstraps/tests on both aarch64 and riscv. > > Richard.
I found a several other instances, also in the frontends that I'm not exactly sure about. I'm currently testing this but aarch64 bootstrap is still going to take a while, various aarch compile farm machines are down? Regards Robin >From ef919a27f4a156afeca6b4825e6029d9f44be556 Mon Sep 17 00:00:00 2001 From: Robin Dapp <rd...@ventanamicro.com> Date: Wed, 28 Jun 2023 20:59:29 +0200 Subject: [PATCH] mode_bitsize -> precision. bitsize -> precision. --- gcc/c-family/c-common.cc | 2 +- gcc/fortran/trans-types.cc | 2 +- gcc/go/go-lang.cc | 2 +- gcc/lto/lto-lang.cc | 2 +- gcc/rust/backend/rust-tree.cc | 2 +- gcc/simplify-rtx.cc | 10 +++++----- gcc/tree.cc | 2 +- gcc/varasm.cc | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gcc/c-family/c-common.cc b/gcc/c-family/c-common.cc index 34566a342bd..6ab63dae997 100644 --- a/gcc/c-family/c-common.cc +++ b/gcc/c-family/c-common.cc @@ -2458,7 +2458,7 @@ c_common_type_for_mode (machine_mode mode, int unsignedp) else if (GET_MODE_CLASS (mode) == MODE_VECTOR_BOOL && valid_vector_subparts_p (GET_MODE_NUNITS (mode))) { - unsigned int elem_bits = vector_element_size (GET_MODE_BITSIZE (mode), + unsigned int elem_bits = vector_element_size (GET_MODE_PRECISION (mode), GET_MODE_NUNITS (mode)); tree bool_type = build_nonstandard_boolean_type (elem_bits); return build_vector_type_for_mode (bool_type, mode); diff --git a/gcc/fortran/trans-types.cc b/gcc/fortran/trans-types.cc index d718f28cc86..987e3d26c46 100644 --- a/gcc/fortran/trans-types.cc +++ b/gcc/fortran/trans-types.cc @@ -3403,7 +3403,7 @@ gfc_type_for_mode (machine_mode mode, int unsignedp) else if (GET_MODE_CLASS (mode) == MODE_VECTOR_BOOL && valid_vector_subparts_p (GET_MODE_NUNITS (mode))) { - unsigned int elem_bits = vector_element_size (GET_MODE_BITSIZE (mode), + unsigned int elem_bits = vector_element_size (GET_MODE_PRECISION (mode), GET_MODE_NUNITS (mode)); tree bool_type = build_nonstandard_boolean_type (elem_bits); return build_vector_type_for_mode (bool_type, mode); diff --git a/gcc/go/go-lang.cc b/gcc/go/go-lang.cc index e85a4bfe949..d5c871a533c 100644 --- a/gcc/go/go-lang.cc +++ b/gcc/go/go-lang.cc @@ -414,7 +414,7 @@ go_langhook_type_for_mode (machine_mode mode, int unsignedp) if (GET_MODE_CLASS (mode) == MODE_VECTOR_BOOL && valid_vector_subparts_p (GET_MODE_NUNITS (mode))) { - unsigned int elem_bits = vector_element_size (GET_MODE_BITSIZE (mode), + unsigned int elem_bits = vector_element_size (GET_MODE_PRECISION (mode), GET_MODE_NUNITS (mode)); tree bool_type = build_nonstandard_boolean_type (elem_bits); return build_vector_type_for_mode (bool_type, mode); diff --git a/gcc/lto/lto-lang.cc b/gcc/lto/lto-lang.cc index 52d7626e92e..14d419c2013 100644 --- a/gcc/lto/lto-lang.cc +++ b/gcc/lto/lto-lang.cc @@ -1050,7 +1050,7 @@ lto_type_for_mode (machine_mode mode, int unsigned_p) else if (GET_MODE_CLASS (mode) == MODE_VECTOR_BOOL && valid_vector_subparts_p (GET_MODE_NUNITS (mode))) { - unsigned int elem_bits = vector_element_size (GET_MODE_BITSIZE (mode), + unsigned int elem_bits = vectwhereor_element_size (GET_MODE_PRECISION (mode), GET_MODE_NUNITS (mode)); tree bool_type = build_nonstandard_boolean_type (elem_bits); return build_vector_type_for_mode (bool_type, mode); diff --git a/gcc/rust/backend/rust-tree.cc b/gcc/rust/backend/rust-tree.cc index 8243d4cf5c6..66e859cd70c 100644 --- a/gcc/rust/backend/rust-tree.cc +++ b/gcc/rust/backend/rust-tree.cc @@ -5320,7 +5320,7 @@ c_common_type_for_mode (machine_mode mode, int unsignedp) && valid_vector_subparts_p (GET_MODE_NUNITS (mode))) { unsigned int elem_bits - = vector_element_size (GET_MODE_BITSIZE (mode), GET_MODE_NUNITS (mode)); + = vector_element_size (GET_MODE_PRECISION (mode), GET_MODE_NUNITS (mode)); tree bool_type = build_nonstandard_boolean_type (elem_bits); return build_vector_type_for_mode (bool_type, mode); } diff --git a/gcc/simplify-rtx.cc b/gcc/simplify-rtx.cc index 99cbdd47d93..d7315d82aa3 100644 --- a/gcc/simplify-rtx.cc +++ b/gcc/simplify-rtx.cc @@ -7076,7 +7076,7 @@ native_encode_rtx (machine_mode mode, rtx x, vec<target_unit> &bytes, /* CONST_VECTOR_ELT follows target memory order, so no shuffling is necessary. The only complication is that MODE_VECTOR_BOOL vectors can have several elements per byte. */ - unsigned int elt_bits = vector_element_size (GET_MODE_BITSIZE (mode), + unsigned int elt_bits = vector_element_size (GET_MODE_PRECISION (mode), GET_MODE_NUNITS (mode)); unsigned int elt = first_byte * BITS_PER_UNIT / elt_bits; if (elt_bits < BITS_PER_UNIT) @@ -7222,7 +7222,7 @@ native_decode_vector_rtx (machine_mode mode, const vec<target_unit> &bytes, { rtx_vector_builder builder (mode, npatterns, nelts_per_pattern); - unsigned int elt_bits = vector_element_size (GET_MODE_BITSIZE (mode), + unsigned int elt_bits = vector_element_size (GET_MODE_PRECISION (mode), GET_MODE_NUNITS (mode)); if (elt_bits < BITS_PER_UNIT) { @@ -7359,7 +7359,7 @@ simplify_const_vector_byte_offset (rtx x, poly_uint64 byte) { /* Cope with MODE_VECTOR_BOOL by operating on bits rather than bytes. */ machine_mode mode = GET_MODE (x); - unsigned int elt_bits = vector_element_size (GET_MODE_BITSIZE (mode), + unsigned int elt_bits = vector_element_size (GET_MODE_PRECISION (mode), GET_MODE_NUNITS (mode)); /* The number of bits needed to encode one element from each pattern. */ unsigned int sequence_bits = CONST_VECTOR_NPATTERNS (x) * elt_bits; @@ -7414,10 +7414,10 @@ simplify_const_vector_subreg (machine_mode outermode, rtx x, /* Cope with MODE_VECTOR_BOOL by operating on bits rather than bytes. */ unsigned int x_elt_bits - = vector_element_size (GET_MODE_BITSIZE (innermode), + = vector_element_size (GET_MODE_PRECISION (innermode), GET_MODE_NUNITS (innermode)); unsigned int out_elt_bits - = vector_element_size (GET_MODE_BITSIZE (outermode), + = vector_element_size (GET_MODE_PRECISION (outermode), GET_MODE_NUNITS (outermode)); /* The number of bits needed to encode one element from every pattern diff --git a/gcc/tree.cc b/gcc/tree.cc index 58288efa2e2..c68761fccee 100644 --- a/gcc/tree.cc +++ b/gcc/tree.cc @@ -10143,7 +10143,7 @@ build_truth_vector_type_for_mode (poly_uint64 nunits, machine_mode mask_mode) unsigned HOST_WIDE_INT esize; if (VECTOR_MODE_P (mask_mode)) { - poly_uint64 vsize = GET_MODE_BITSIZE (mask_mode); + poly_uint64 vsize = GET_MODE_PRECISION (mask_mode); esize = vector_element_size (vsize, nunits); } else diff --git a/gcc/varasm.cc b/gcc/varasm.cc index 8ae0a2555cd..f65416cff99 100644 --- a/gcc/varasm.cc +++ b/gcc/varasm.cc @@ -4061,7 +4061,7 @@ output_constant_pool_2 (fixed_size_mode mode, rtx x, unsigned int align) whole element. Often this is byte_mode and contains more than one element. */ unsigned int nelts = GET_MODE_NUNITS (mode); - unsigned int elt_bits = GET_MODE_BITSIZE (mode) / nelts; + unsigned int elt_bits = GET_MODE_PRECISION (mode) / nelts; unsigned int int_bits = MAX (elt_bits, BITS_PER_UNIT); scalar_int_mode int_mode = int_mode_for_size (int_bits, 0).require (); unsigned int mask = GET_MODE_MASK (GET_MODE_INNER (mode)); -- 2.41.0