From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id C287B3858C54 for ; Mon, 24 Oct 2022 02:25:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C287B3858C54 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x52b.google.com with SMTP id a13so26328707edj.0 for ; Sun, 23 Oct 2022 19:25:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=lJ/MHAYtl0fXFDVew6V/FcPYR397uBrdasweIpaYopA=; b=RG3NGfwB1v78WdbhihDmCpA6LA1RHKH1XkClurfqRFldlHxAK0UCcporgg6H29FGMX fB/wzfbF9gWJCPu5zvYGFEV/7OW3qYJhAofKvaniUmWxNC3uPcMKNjQf42RsNkILo0qE k8o/cLaS7/Dur2qaXaiRWKP7EjGE+WbqjS2/D1jrLit6aUcSK8p7OVgQfS/5UirzFvdy IGcaVLJ4pg5WbLSed7Cml8IvKaT56s+CxZ/3fP9ONpsciUOoauMdjKJJKeteF/UbBfjj stzzbv53XYFx4fBqGSGBLZ/GedRpgwqzshWB397ulsoP3jXEWcJL35mhNrzzp6JJIRwC pMIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lJ/MHAYtl0fXFDVew6V/FcPYR397uBrdasweIpaYopA=; b=nkw292JCi7+fSqh/36Ofu1JqRXLalW+VXCh6KTfT/1u8pfh2py4k/rXBHj5+lMqD4k ySfw1jIN5rB/m8XXqaTZ9lOW3AlGycTUZOabQZYxbWafRe6qq1MjSG2crAVdM5KSf+2L Ow/YbnppJBDdLaOm30b8TqBDJ0xRzN9FPR0joea+2oSeGk+tPM+FpK+qy8ZvG+nAghDH IRAL4wUuZkEV8dBUIqDhwEjDtrNXFU9tLrbsyndP8OoPNXel1AkRe2kIZY6bjTpcqEAt V3e1i4YFAVpAiQOTVT0e8Qp++Ofu2V1vdpaOA0Jb8dBHl381MpPWvmIVfuXvfMlUA5eV BsTQ== X-Gm-Message-State: ACrzQf2FCb/ScAFwCBmq9d0aE0DaiU1aooWgGnC6LbqXapP/yxM08yqs iH4GC/8g3aYGVAfLpwSOkyj/JyDp4TgSwFKhhz4= X-Google-Smtp-Source: AMsMyM5CpQtoh2M65ped/D6WzoyacsSJUZruu6O9EyQsg1tGq+FW2b4AB+Ytb1G7qjaBhY8BnA1EbLH3+RnEiP4k5sE= X-Received: by 2002:a17:907:6e93:b0:78d:dff1:71e3 with SMTP id sh19-20020a1709076e9300b0078ddff171e3mr24412842ejc.94.1666578346249; Sun, 23 Oct 2022 19:25:46 -0700 (PDT) MIME-Version: 1.0 References: <20221024022028.197505-1-juzhe.zhong@rivai.ai> In-Reply-To: <20221024022028.197505-1-juzhe.zhong@rivai.ai> From: Kito Cheng Date: Mon, 24 Oct 2022 10:25:34 +0800 Message-ID: Subject: Re: [PATCH] RISC-V: Replace CONSTEXPR with constexpr To: juzhe.zhong@rivai.ai Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Committed, thanks! On Mon, Oct 24, 2022 at 10:21 AM wrote: > > From: Ju-Zhe Zhong > > Move away from the pre-C++11 compatibility macro CONSTEXPR. > This patch is inspired by aarch64: > https://gcc.gnu.org/pipermail/gcc-patches/2022-October/603974.html. > > gcc/ChangeLog: > > * config/riscv/riscv-vector-builtins-bases.cc: Replace CONSTEXPR > with constexpr throughout. > * config/riscv/riscv-vector-builtins-shapes.cc (SHAPE): Likewise. > * config/riscv/riscv-vector-builtins.cc (struct registered_function_hasher): Likewise. > * config/riscv/riscv-vector-builtins.h (struct rvv_arg_type_info): Likewise. > > --- > gcc/config/riscv/riscv-vector-builtins-bases.cc | 4 ++-- > gcc/config/riscv/riscv-vector-builtins-shapes.cc | 2 +- > gcc/config/riscv/riscv-vector-builtins.cc | 14 +++++++------- > gcc/config/riscv/riscv-vector-builtins.h | 2 +- > 4 files changed, 11 insertions(+), 11 deletions(-) > > diff --git a/gcc/config/riscv/riscv-vector-builtins-bases.cc b/gcc/config/riscv/riscv-vector-builtins-bases.cc > index 231b63a610d..713a7566e29 100644 > --- a/gcc/config/riscv/riscv-vector-builtins-bases.cc > +++ b/gcc/config/riscv/riscv-vector-builtins-bases.cc > @@ -84,8 +84,8 @@ public: > } > }; > > -static CONSTEXPR const vsetvl vsetvl_obj; > -static CONSTEXPR const vsetvl vsetvlmax_obj; > +static constexpr const vsetvl vsetvl_obj; > +static constexpr const vsetvl vsetvlmax_obj; > namespace bases { > const function_base *const vsetvl = &vsetvl_obj; > const function_base *const vsetvlmax = &vsetvlmax_obj; > diff --git a/gcc/config/riscv/riscv-vector-builtins-shapes.cc b/gcc/config/riscv/riscv-vector-builtins-shapes.cc > index 24fc1c02341..14c59690c06 100644 > --- a/gcc/config/riscv/riscv-vector-builtins-shapes.cc > +++ b/gcc/config/riscv/riscv-vector-builtins-shapes.cc > @@ -71,7 +71,7 @@ build_all (function_builder &b, const function_group_info &group) > /* Declare the function shape NAME, pointing it to an instance > of class _def. */ > #define SHAPE(DEF, VAR) \ > - static CONSTEXPR const DEF##_def VAR##_obj; \ > + static constexpr const DEF##_def VAR##_obj; \ > namespace shapes { const function_shape *const VAR = &VAR##_obj; } > > /* Base class for for build. */ > diff --git a/gcc/config/riscv/riscv-vector-builtins.cc b/gcc/config/riscv/riscv-vector-builtins.cc > index dc410788c99..caeb97211f9 100644 > --- a/gcc/config/riscv/riscv-vector-builtins.cc > +++ b/gcc/config/riscv/riscv-vector-builtins.cc > @@ -88,7 +88,7 @@ struct registered_function_hasher : nofree_ptr_hash > }; > > /* Static information about each RVV type. */ > -static CONSTEXPR const vector_type_info vector_types[] = { > +static constexpr const vector_type_info vector_types[] = { > #define DEF_RVV_TYPE(NAME, NCHARS, ABI_NAME, ARGS...) \ > {#NAME, #ABI_NAME, "u" #NCHARS #ABI_NAME}, > #include "riscv-vector-builtins.def" > @@ -123,23 +123,23 @@ static const rvv_type_info i_ops[] = { > #include "riscv-vector-builtins-types.def" > {NUM_VECTOR_TYPES, 0}}; > > -static CONSTEXPR const rvv_arg_type_info rvv_arg_type_info_end > +static constexpr const rvv_arg_type_info rvv_arg_type_info_end > = rvv_arg_type_info (NUM_BASE_TYPES); > > /* A list of args for size_t func (void) function. */ > -static CONSTEXPR const rvv_arg_type_info void_args[] > +static constexpr const rvv_arg_type_info void_args[] > = {rvv_arg_type_info (RVV_BASE_void), rvv_arg_type_info_end}; > > /* A list of args for size_t func (size_t) function. */ > -static CONSTEXPR const rvv_arg_type_info size_args[] > +static constexpr const rvv_arg_type_info size_args[] > = {rvv_arg_type_info (RVV_BASE_size), rvv_arg_type_info_end}; > > /* A list of none preds that will be registered for intrinsic functions. */ > -static CONSTEXPR const predication_type_index none_preds[] > +static constexpr const predication_type_index none_preds[] > = {PRED_TYPE_none, NUM_PRED_TYPES}; > > /* A static operand information for size_t func (void) function registration. */ > -static CONSTEXPR const rvv_op_info i_none_size_void_ops > +static constexpr const rvv_op_info i_none_size_void_ops > = {i_ops, /* Types */ > OP_TYPE_none, /* Suffix */ > rvv_arg_type_info (RVV_BASE_size), /* Return type */ > @@ -147,7 +147,7 @@ static CONSTEXPR const rvv_op_info i_none_size_void_ops > > /* A static operand information for size_t func (size_t) function registration. > */ > -static CONSTEXPR const rvv_op_info i_none_size_size_ops > +static constexpr const rvv_op_info i_none_size_size_ops > = {i_ops, /* Types */ > OP_TYPE_none, /* Suffix */ > rvv_arg_type_info (RVV_BASE_size), /* Return type */ > diff --git a/gcc/config/riscv/riscv-vector-builtins.h b/gcc/config/riscv/riscv-vector-builtins.h > index 425da12326c..e5636e23a7c 100644 > --- a/gcc/config/riscv/riscv-vector-builtins.h > +++ b/gcc/config/riscv/riscv-vector-builtins.h > @@ -171,7 +171,7 @@ struct rvv_builtin_suffixes > /* RVV Builtin argument information. */ > struct rvv_arg_type_info > { > - CONSTEXPR rvv_arg_type_info (rvv_base_type base_type_in) > + constexpr rvv_arg_type_info (rvv_base_type base_type_in) > : base_type (base_type_in) > {} > enum rvv_base_type base_type; > -- > 2.36.1 >