Skip to content

Commit

Permalink
aarch64: Reinstate some uses of CONSTEXPR
Browse files Browse the repository at this point in the history
In 9482a5e I'd replaced uses
of CONSTEXPR with direct uses of constexpr.  However, it turns
out that we still have CONSTEXPR for a reason: GCC 4.8 doesn't
implement constexpr properly, and for example rejects things like:

  extern const int x;
  constexpr int x = 1;

This patch partially reverts the previous one.  To make things
more complicated, there are still some things that need to be
constexpr rather than CONSTEXPR, since they are used to initialise
scalar constants.  The patch therefore doesn't change anything
in aarch64-feature-deps.h.

gcc/
	* config/aarch64/aarch64-protos.h: Replace constexpr with
	CONSTEXPR.
	* config/aarch64/aarch64-sve-builtins-base.cc: Likewise.
	* config/aarch64/aarch64-sve-builtins-functions.h: Likewise.
	* config/aarch64/aarch64-sve-builtins-shapes.cc: Likewise.
	* config/aarch64/aarch64-sve-builtins-sve2.cc: Likewise.
	* config/aarch64/aarch64-sve-builtins.cc: Likewise.
	* config/aarch64/aarch64.cc: Likewise.
	* config/aarch64/driver-aarch64.cc: Likewise
  • Loading branch information
rsandifo-arm committed Oct 27, 2022
1 parent 2b1fb72 commit f95d3d5
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 62 deletions.
6 changes: 3 additions & 3 deletions gcc/config/aarch64/aarch64-protos.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ typedef struct simd_vec_cost advsimd_vec_cost;
/* SVE-specific extensions to the information provided by simd_vec_cost. */
struct sve_vec_cost : simd_vec_cost
{
constexpr sve_vec_cost (const simd_vec_cost &base,
CONSTEXPR sve_vec_cost (const simd_vec_cost &base,
unsigned int clast_cost,
unsigned int fadda_f16_cost,
unsigned int fadda_f32_cost,
Expand Down Expand Up @@ -354,7 +354,7 @@ using aarch64_scalar_vec_issue_info = aarch64_base_vec_issue_info;
Advanced SIMD and SVE. */
struct aarch64_simd_vec_issue_info : aarch64_base_vec_issue_info
{
constexpr aarch64_simd_vec_issue_info (aarch64_base_vec_issue_info base,
CONSTEXPR aarch64_simd_vec_issue_info (aarch64_base_vec_issue_info base,
unsigned int ld2_st2_general_ops,
unsigned int ld3_st3_general_ops,
unsigned int ld4_st4_general_ops)
Expand Down Expand Up @@ -382,7 +382,7 @@ using aarch64_advsimd_vec_issue_info = aarch64_simd_vec_issue_info;
is a concept of "predicate operations". */
struct aarch64_sve_vec_issue_info : aarch64_simd_vec_issue_info
{
constexpr aarch64_sve_vec_issue_info
CONSTEXPR aarch64_sve_vec_issue_info
(aarch64_simd_vec_issue_info base,
unsigned int pred_ops_per_cycle,
unsigned int while_pred_ops,
Expand Down
56 changes: 28 additions & 28 deletions gcc/config/aarch64/aarch64-sve-builtins-base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class svabd_impl : public function_base
class svac_impl : public function_base
{
public:
constexpr svac_impl (int unspec) : m_unspec (unspec) {}
CONSTEXPR svac_impl (int unspec) : m_unspec (unspec) {}

rtx
expand (function_expander &e) const override
Expand Down Expand Up @@ -209,7 +209,7 @@ class svadda_impl : public function_base
class svadr_bhwd_impl : public function_base
{
public:
constexpr svadr_bhwd_impl (unsigned int shift) : m_shift (shift) {}
CONSTEXPR svadr_bhwd_impl (unsigned int shift) : m_shift (shift) {}

rtx
expand (function_expander &e) const override
Expand Down Expand Up @@ -259,7 +259,7 @@ class svbic_impl : public function_base
class svbrk_binary_impl : public function_base
{
public:
constexpr svbrk_binary_impl (int unspec) : m_unspec (unspec) {}
CONSTEXPR svbrk_binary_impl (int unspec) : m_unspec (unspec) {}

rtx
expand (function_expander &e) const override
Expand All @@ -275,7 +275,7 @@ class svbrk_binary_impl : public function_base
class svbrk_unary_impl : public function_base
{
public:
constexpr svbrk_unary_impl (int unspec) : m_unspec (unspec) {}
CONSTEXPR svbrk_unary_impl (int unspec) : m_unspec (unspec) {}

rtx
expand (function_expander &e) const override
Expand Down Expand Up @@ -309,7 +309,7 @@ class svcadd_impl : public function_base
class svclast_impl : public quiet<function_base>
{
public:
constexpr svclast_impl (int unspec) : m_unspec (unspec) {}
CONSTEXPR svclast_impl (int unspec) : m_unspec (unspec) {}

rtx
expand (function_expander &e) const override
Expand Down Expand Up @@ -381,7 +381,7 @@ class svcmla_lane_impl : public function_base
class svcmp_impl : public function_base
{
public:
constexpr svcmp_impl (tree_code code, int unspec_for_fp)
CONSTEXPR svcmp_impl (tree_code code, int unspec_for_fp)
: m_code (code), m_unspec_for_fp (unspec_for_fp) {}

gimple *
Expand Down Expand Up @@ -437,7 +437,7 @@ class svcmp_impl : public function_base
class svcmp_wide_impl : public function_base
{
public:
constexpr svcmp_wide_impl (tree_code code, int unspec_for_sint,
CONSTEXPR svcmp_wide_impl (tree_code code, int unspec_for_sint,
int unspec_for_uint)
: m_code (code), m_unspec_for_sint (unspec_for_sint),
m_unspec_for_uint (unspec_for_uint) {}
Expand Down Expand Up @@ -512,7 +512,7 @@ class svcnot_impl : public function_base
class svcnt_bhwd_impl : public function_base
{
public:
constexpr svcnt_bhwd_impl (machine_mode ref_mode) : m_ref_mode (ref_mode) {}
CONSTEXPR svcnt_bhwd_impl (machine_mode ref_mode) : m_ref_mode (ref_mode) {}

gimple *
fold (gimple_folder &f) const override
Expand Down Expand Up @@ -949,7 +949,7 @@ class svdupq_lane_impl : public quiet<function_base>
class svext_bhw_impl : public function_base
{
public:
constexpr svext_bhw_impl (scalar_int_mode from_mode)
CONSTEXPR svext_bhw_impl (scalar_int_mode from_mode)
: m_from_mode (from_mode) {}

rtx
Expand Down Expand Up @@ -1053,7 +1053,7 @@ class svinsr_impl : public quiet<function_base>
class svlast_impl : public quiet<function_base>
{
public:
constexpr svlast_impl (int unspec) : m_unspec (unspec) {}
CONSTEXPR svlast_impl (int unspec) : m_unspec (unspec) {}

rtx
expand (function_expander &e) const override
Expand Down Expand Up @@ -1399,7 +1399,7 @@ class svldnt1_impl : public full_width_access
class svldxf1_impl : public full_width_access
{
public:
constexpr svldxf1_impl (int unspec) : m_unspec (unspec) {}
CONSTEXPR svldxf1_impl (int unspec) : m_unspec (unspec) {}

unsigned int
call_properties (const function_instance &) const override
Expand All @@ -1426,7 +1426,7 @@ class svldxf1_impl : public full_width_access
class svldxf1_extend_impl : public extending_load
{
public:
constexpr svldxf1_extend_impl (type_suffix_index memory_type, int unspec)
CONSTEXPR svldxf1_extend_impl (type_suffix_index memory_type, int unspec)
: extending_load (memory_type), m_unspec (unspec) {}

unsigned int
Expand Down Expand Up @@ -1616,7 +1616,7 @@ class svnor_impl : public function_base
class svnot_impl : public rtx_code_function
{
public:
constexpr svnot_impl () : rtx_code_function (NOT, NOT, -1) {}
CONSTEXPR svnot_impl () : rtx_code_function (NOT, NOT, -1) {}

rtx
expand (function_expander &e) const override
Expand Down Expand Up @@ -1664,7 +1664,7 @@ class svpfalse_impl : public function_base
class svpfirst_svpnext_impl : public function_base
{
public:
constexpr svpfirst_svpnext_impl (int unspec) : m_unspec (unspec) {}
CONSTEXPR svpfirst_svpnext_impl (int unspec) : m_unspec (unspec) {}

rtx
expand (function_expander &e) const override
Expand All @@ -1682,7 +1682,7 @@ class svpfirst_svpnext_impl : public function_base
class svprf_bhwd_impl : public function_base
{
public:
constexpr svprf_bhwd_impl (machine_mode mode) : m_mode (mode) {}
CONSTEXPR svprf_bhwd_impl (machine_mode mode) : m_mode (mode) {}

unsigned int
call_properties (const function_instance &) const override
Expand All @@ -1706,7 +1706,7 @@ class svprf_bhwd_impl : public function_base
class svprf_bhwd_gather_impl : public function_base
{
public:
constexpr svprf_bhwd_gather_impl (machine_mode mode) : m_mode (mode) {}
CONSTEXPR svprf_bhwd_gather_impl (machine_mode mode) : m_mode (mode) {}

unsigned int
call_properties (const function_instance &) const override
Expand Down Expand Up @@ -1744,7 +1744,7 @@ class svprf_bhwd_gather_impl : public function_base
class svptest_impl : public function_base
{
public:
constexpr svptest_impl (rtx_code compare) : m_compare (compare) {}
CONSTEXPR svptest_impl (rtx_code compare) : m_compare (compare) {}

rtx
expand (function_expander &e) const override
Expand Down Expand Up @@ -1849,7 +1849,7 @@ class svptrue_pat_impl : public function_base
class svqdec_svqinc_bhwd_impl : public function_base
{
public:
constexpr svqdec_svqinc_bhwd_impl (rtx_code code_for_sint,
CONSTEXPR svqdec_svqinc_bhwd_impl (rtx_code code_for_sint,
rtx_code code_for_uint,
scalar_int_mode elem_mode)
: m_code_for_sint (code_for_sint),
Expand Down Expand Up @@ -1896,23 +1896,23 @@ class svqdec_svqinc_bhwd_impl : public function_base
class svqdec_bhwd_impl : public svqdec_svqinc_bhwd_impl
{
public:
constexpr svqdec_bhwd_impl (scalar_int_mode elem_mode)
CONSTEXPR svqdec_bhwd_impl (scalar_int_mode elem_mode)
: svqdec_svqinc_bhwd_impl (SS_MINUS, US_MINUS, elem_mode) {}
};

/* Implements svqinc[bhwd]{,_pat}. */
class svqinc_bhwd_impl : public svqdec_svqinc_bhwd_impl
{
public:
constexpr svqinc_bhwd_impl (scalar_int_mode elem_mode)
CONSTEXPR svqinc_bhwd_impl (scalar_int_mode elem_mode)
: svqdec_svqinc_bhwd_impl (SS_PLUS, US_PLUS, elem_mode) {}
};

/* Implements svqdecp and svqincp. */
class svqdecp_svqincp_impl : public function_base
{
public:
constexpr svqdecp_svqincp_impl (rtx_code code_for_sint,
CONSTEXPR svqdecp_svqincp_impl (rtx_code code_for_sint,
rtx_code code_for_uint)
: m_code_for_sint (code_for_sint),
m_code_for_uint (code_for_uint)
Expand Down Expand Up @@ -2275,7 +2275,7 @@ class svstnt1_impl : public full_width_access
class svsub_impl : public rtx_code_function
{
public:
constexpr svsub_impl ()
CONSTEXPR svsub_impl ()
: rtx_code_function (MINUS, MINUS, UNSPEC_COND_FSUB) {}

rtx
Expand Down Expand Up @@ -2304,7 +2304,7 @@ class svtbl_impl : public permute
class svtrn_impl : public binary_permute
{
public:
constexpr svtrn_impl (int base)
CONSTEXPR svtrn_impl (int base)
: binary_permute (base ? UNSPEC_TRN2 : UNSPEC_TRN1), m_base (base) {}

gimple *
Expand Down Expand Up @@ -2345,7 +2345,7 @@ class svundef_impl : public quiet<multi_vector_function>
class svunpk_impl : public quiet<function_base>
{
public:
constexpr svunpk_impl (bool high_p) : m_high_p (high_p) {}
CONSTEXPR svunpk_impl (bool high_p) : m_high_p (high_p) {}

gimple *
fold (gimple_folder &f) const override
Expand Down Expand Up @@ -2387,7 +2387,7 @@ class svunpk_impl : public quiet<function_base>
class svusdot_impl : public function_base
{
public:
constexpr svusdot_impl (bool su) : m_su (su) {}
CONSTEXPR svusdot_impl (bool su) : m_su (su) {}

rtx
expand (function_expander &e) const override
Expand Down Expand Up @@ -2415,7 +2415,7 @@ class svusdot_impl : public function_base
class svuzp_impl : public binary_permute
{
public:
constexpr svuzp_impl (unsigned int base)
CONSTEXPR svuzp_impl (unsigned int base)
: binary_permute (base ? UNSPEC_UZP2 : UNSPEC_UZP1), m_base (base) {}

gimple *
Expand All @@ -2438,7 +2438,7 @@ class svuzp_impl : public binary_permute
class svwhilelx_impl : public while_comparison
{
public:
constexpr svwhilelx_impl (int unspec_for_sint, int unspec_for_uint, bool eq_p)
CONSTEXPR svwhilelx_impl (int unspec_for_sint, int unspec_for_uint, bool eq_p)
: while_comparison (unspec_for_sint, unspec_for_uint), m_eq_p (eq_p)
{}

Expand Down Expand Up @@ -2525,7 +2525,7 @@ class svwrffr_impl : public function_base
class svzip_impl : public binary_permute
{
public:
constexpr svzip_impl (unsigned int base)
CONSTEXPR svzip_impl (unsigned int base)
: binary_permute (base ? UNSPEC_ZIP2 : UNSPEC_ZIP1), m_base (base) {}

gimple *
Expand Down
Loading

0 comments on commit f95d3d5

Please sign in to comment.