From patchwork Tue Aug 22 04:19:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2 via Gcc-patches" X-Patchwork-Id: 136451 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp3399637vqi; Mon, 21 Aug 2023 21:20:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IETicFHRqMtFQhO0ZqjSiT+xniYwZ3YssCzMZiDcdt3jtmNA8stpLx1gQAGlHKUMYHNjMae X-Received: by 2002:aa7:db47:0:b0:525:69c8:6f51 with SMTP id n7-20020aa7db47000000b0052569c86f51mr5670515edt.35.1692678043011; Mon, 21 Aug 2023 21:20:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692678042; cv=none; d=google.com; s=arc-20160816; b=vwdO5U5G+fZ+M+vkKMhlfbwXE5gwjBVb66ji4UiRAc4e1Ivx/kg1DI3naQCTp2BGwd xrPsxnxGz2DEKlbl8l5/q3BHgr2/THvY5uKv2nLzPBTxhHkgG7xYw56n78qEhS+773n/ mAHUUsOCoeJU2pMkLU7BlJr2ctGloaUAJpVl2YKlAakuRL+Av3RuWStkEmiJcAz0FDSG 8r8Q0xznDzO26vGjf1Fm1llRVhpjDzT/TFnuDnrG0exzyGz60yg4RObSwXm1nmqNOcrl RZt6BsCYfutc8GYUx27+JM8shus0INgFYm+NVjHaKTab/3P0B5Jhj2GiKzOCCfA5J/ZM EV2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=juf8/8rXBB1M/hVB8ZYN1jzY27DNe/xMef79GDB6GMw=; fh=Nw/M2boavwJLWTbobiAULTtRLIIxYVZeHWeEMcryaHM=; b=WIz0G4b7s/58CAGuri2gL3RtCvDxqXaZMxlxuo3ZzCTdO87X1ww6MllhPCj1Gywkzn xYdgqhHt/BRqvVk0H+w87St43Gk4NTD2mzkCaSuL96O2OziUgC1S4NLRanFoIbzTvPVL GQI5slIRez+49q8o8YH5zMakbKBmhSW0sU1rbM3Ax6ZT0ihY7/ipmXcM6MGM9k9U7vNx ZUc3kFmTpmxJt3M2FeIDIps66UsYcRgE40hxCHWB/gVUm/8rEhtxU1/RTQOCzUMPoeXP p9aermqm6v3cOkIZC7sdjzSLMZeTtF0Pqxp5KuiH8vAvXAQsJKzU33gWqpOpz2sLbQ3K WEYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=FdjPVEQK; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ca23-20020aa7cd77000000b00525667e5154si6546771edb.258.2023.08.21.21.20.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 21:20:42 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=FdjPVEQK; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 87E5F3858C2A for ; Tue, 22 Aug 2023 04:20:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 87E5F3858C2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692678041; bh=juf8/8rXBB1M/hVB8ZYN1jzY27DNe/xMef79GDB6GMw=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=FdjPVEQKTk3uPcHoWcrU65p3HMJJFn4FmfVOMBWxiPeatM7v7rMkz9k2ZvpSl21dh yUft5deC/wbfHd6uUvK9hl6xY/SzZhitW96+nAo1Xhz8oZtPQFavDqV5STckOL/Z7+ IRYbt2CWxbakrDrzwxe8hJY8xFKjVkVCTR+AQuuM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by sourceware.org (Postfix) with ESMTPS id 723B93858D33 for ; Tue, 22 Aug 2023 04:19:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 723B93858D33 X-IronPort-AV: E=McAfee;i="6600,9927,10809"; a="372666413" X-IronPort-AV: E=Sophos;i="6.01,192,1684825200"; d="scan'208";a="372666413" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Aug 2023 21:19:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10809"; a="982728361" X-IronPort-AV: E=Sophos;i="6.01,192,1684825200"; d="scan'208";a="982728361" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by fmsmga006.fm.intel.com with ESMTP; 21 Aug 2023 21:19:26 -0700 Received: from pli-ubuntu.sh.intel.com (pli-ubuntu.sh.intel.com [10.239.159.47]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 3900010056FA; Tue, 22 Aug 2023 12:19:26 +0800 (CST) To: gcc-patches@gcc.gnu.org Cc: juzhe.zhong@rivai.ai, rdapp.gcc@gmail.com, jeffreyalaw@gmail.com, pan2.li@intel.com, yanzhang.wang@intel.com, kito.cheng@gmail.com Subject: [PATCH v2] RISC-V: Refactor RVV class by frm_op_type template arg Date: Tue, 22 Aug 2023 12:19:24 +0800 Message-Id: <20230822041924.1861884-1-pan2.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230818025355.3280223-1-pan2.li@intel.com> References: <20230818025355.3280223-1-pan2.li@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Pan Li via Gcc-patches From: "Li, Pan2 via Gcc-patches" Reply-To: pan2.li@intel.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1774533782965053334 X-GMAIL-MSGID: 1774901571496080098 From: Pan Li Update in v2: * Added gcc_assert for vx format in binop. * Passed riscv/rvv.exp test. Original Log: As suggested by kito, we will add new frm_opt_type template arg to the op class, to avoid the duplicated function expand. Signed-off-by: Pan Li gcc/ChangeLog: * config/riscv/riscv-vector-builtins-bases.cc (class binop_frm): Removed. (class reverse_binop_frm): Ditto. (class widen_binop_frm): Ditto. (class vfmacc_frm): Ditto. (class vfnmacc_frm): Ditto. (class vfmsac_frm): Ditto. (class vfnmsac_frm): Ditto. (class vfmadd_frm): Ditto. (class vfnmadd_frm): Ditto. (class vfmsub_frm): Ditto. (class vfnmsub_frm): Ditto. (class vfwmacc_frm): Ditto. (class vfwnmacc_frm): Ditto. (class vfwmsac_frm): Ditto. (class vfwnmsac_frm): Ditto. (class unop_frm): Ditto. (class vfrec7_frm): Ditto. (class binop): Add frm_op_type template arg. (class unop): Ditto. (class widen_binop): Ditto. (class widen_binop_fp): Ditto. (class reverse_binop): Ditto. (class vfmacc): Ditto. (class vfnmsac): Ditto. (class vfmadd): Ditto. (class vfnmsub): Ditto. (class vfnmacc): Ditto. (class vfmsac): Ditto. (class vfnmadd): Ditto. (class vfmsub): Ditto. (class vfwmacc): Ditto. (class vfwnmacc): Ditto. (class vfwmsac): Ditto. (class vfwnmsac): Ditto. (class float_misc): Ditto. Signed-off-by: Pan Li > --- .../riscv/riscv-vector-builtins-bases.cc | 571 +++++------------- 1 file changed, 143 insertions(+), 428 deletions(-) diff --git a/gcc/config/riscv/riscv-vector-builtins-bases.cc b/gcc/config/riscv/riscv-vector-builtins-bases.cc index 5ee7d3119db..54582ee130c 100644 --- a/gcc/config/riscv/riscv-vector-builtins-bases.cc +++ b/gcc/config/riscv/riscv-vector-builtins-bases.cc @@ -262,41 +262,21 @@ public: vremu/vsadd/vsaddu/vssub/vssubu vfadd/vfsub/ */ -template +template class binop : public function_base { public: - rtx expand (function_expander &e) const override + bool has_rounding_mode_operand_p () const override { - switch (e.op_info->op) - { - case OP_TYPE_vx: - case OP_TYPE_vf: - return e.use_exact_insn (code_for_pred_scalar (CODE, e.vector_mode ())); - case OP_TYPE_vv: - return e.use_exact_insn (code_for_pred (CODE, e.vector_mode ())); - default: - gcc_unreachable (); - } + return FRM_OP == HAS_FRM; } -}; - -/* Implements below instructions for now. - - vfadd - - vfsub - - vfmul - - vfdiv -*/ -template -class binop_frm : public function_base -{ -public: - bool has_rounding_mode_operand_p () const override { return true; } rtx expand (function_expander &e) const override { switch (e.op_info->op) { + case OP_TYPE_vx: + gcc_assert (FRM_OP == NO_FRM); case OP_TYPE_vf: return e.use_exact_insn (code_for_pred_scalar (CODE, e.vector_mode ())); case OP_TYPE_vv: @@ -307,365 +287,6 @@ public: } }; -/* Implements below instructions for frm - - vfrsub - - vfrdiv -*/ -template -class reverse_binop_frm : public function_base -{ -public: - bool has_rounding_mode_operand_p () const override { return true; } - -public: - rtx expand (function_expander &e) const override - { - return e.use_exact_insn ( - code_for_pred_reverse_scalar (CODE, e.vector_mode ())); - } -}; - -/* Implements below instructions for frm - - vfwadd - - vfwsub - - vfwmul -*/ -template -class widen_binop_frm : public function_base -{ -public: - bool has_rounding_mode_operand_p () const override { return true; } - - rtx expand (function_expander &e) const override - { - switch (e.op_info->op) - { - case OP_TYPE_vv: - return e.use_exact_insn ( - code_for_pred_dual_widen (CODE, e.vector_mode ())); - case OP_TYPE_vf: - return e.use_exact_insn ( - code_for_pred_dual_widen_scalar (CODE, e.vector_mode ())); - case OP_TYPE_wv: - if (CODE == PLUS) - return e.use_exact_insn ( - code_for_pred_single_widen_add (e.vector_mode ())); - else - return e.use_exact_insn ( - code_for_pred_single_widen_sub (e.vector_mode ())); - case OP_TYPE_wf: - return e.use_exact_insn ( - code_for_pred_single_widen_scalar (CODE, e.vector_mode ())); - default: - gcc_unreachable (); - } - } -}; - -/* Implements below instructions for frm - - vfmacc -*/ -class vfmacc_frm : public function_base -{ -public: - bool has_rounding_mode_operand_p () const override { return true; } - - bool has_merge_operand_p () const override { return false; } - - rtx expand (function_expander &e) const override - { - if (e.op_info->op == OP_TYPE_vf) - return e.use_ternop_insn (true, - code_for_pred_mul_scalar (PLUS, - e.vector_mode ())); - if (e.op_info->op == OP_TYPE_vv) - return e.use_ternop_insn (true, - code_for_pred_mul (PLUS, e.vector_mode ())); - gcc_unreachable (); - } -}; - -/* Implements below instructions for frm - - vfnmacc -*/ -class vfnmacc_frm : public function_base -{ -public: - bool has_rounding_mode_operand_p () const override { return true; } - - bool has_merge_operand_p () const override { return false; } - - rtx expand (function_expander &e) const override - { - if (e.op_info->op == OP_TYPE_vf) - return e.use_ternop_insn ( - true, code_for_pred_mul_neg_scalar (MINUS, e.vector_mode ())); - if (e.op_info->op == OP_TYPE_vv) - return e.use_ternop_insn ( - true, code_for_pred_mul_neg (MINUS, e.vector_mode ())); - gcc_unreachable (); - } -}; - -/* Implements below instructions for frm - - vfmsac -*/ -class vfmsac_frm : public function_base -{ -public: - bool has_rounding_mode_operand_p () const override { return true; } - - bool has_merge_operand_p () const override { return false; } - - rtx expand (function_expander &e) const override - { - if (e.op_info->op == OP_TYPE_vf) - return e.use_ternop_insn ( - true, code_for_pred_mul_scalar (MINUS, e.vector_mode ())); - if (e.op_info->op == OP_TYPE_vv) - return e.use_ternop_insn ( - true, code_for_pred_mul (MINUS, e.vector_mode ())); - - gcc_unreachable (); - } -}; - -/* Implements below instructions for frm - - vfnmsac -*/ -class vfnmsac_frm : public function_base -{ -public: - bool has_rounding_mode_operand_p () const override { return true; } - - bool has_merge_operand_p () const override { return false; } - - rtx expand (function_expander &e) const override - { - if (e.op_info->op == OP_TYPE_vf) - return e.use_ternop_insn ( - true, code_for_pred_mul_neg_scalar (PLUS, e.vector_mode ())); - if (e.op_info->op == OP_TYPE_vv) - return e.use_ternop_insn ( - true, code_for_pred_mul_neg (PLUS, e.vector_mode ())); - - gcc_unreachable (); - } -}; - -/* Implements below instructions for frm - - vfmadd -*/ -class vfmadd_frm : public function_base -{ -public: - bool has_rounding_mode_operand_p () const override { return true; } - - bool has_merge_operand_p () const override { return false; } - - rtx expand (function_expander &e) const override - { - if (e.op_info->op == OP_TYPE_vf) - return e.use_ternop_insn ( - false, code_for_pred_mul_scalar (PLUS, e.vector_mode ())); - if (e.op_info->op == OP_TYPE_vv) - return e.use_ternop_insn ( - false, code_for_pred_mul (PLUS, e.vector_mode ())); - - gcc_unreachable (); - } -}; - -/* Implements below instructions for frm - - vfnmadd -*/ -class vfnmadd_frm : public function_base -{ -public: - bool has_rounding_mode_operand_p () const override { return true; } - - bool has_merge_operand_p () const override { return false; } - - rtx expand (function_expander &e) const override - { - if (e.op_info->op == OP_TYPE_vf) - return e.use_ternop_insn ( - false, code_for_pred_mul_neg_scalar (MINUS, e.vector_mode ())); - if (e.op_info->op == OP_TYPE_vv) - return e.use_ternop_insn ( - false, code_for_pred_mul_neg (MINUS, e.vector_mode ())); - - gcc_unreachable (); - } -}; - -/* Implements below instructions for frm - - vfmsub -*/ -class vfmsub_frm : public function_base -{ -public: - bool has_rounding_mode_operand_p () const override { return true; } - - bool has_merge_operand_p () const override { return false; } - - rtx expand (function_expander &e) const override - { - if (e.op_info->op == OP_TYPE_vf) - return e.use_ternop_insn ( - false, code_for_pred_mul_scalar (MINUS, e.vector_mode ())); - if (e.op_info->op == OP_TYPE_vv) - return e.use_ternop_insn ( - false, code_for_pred_mul (MINUS, e.vector_mode ())); - - gcc_unreachable (); - } -}; - -/* Implements below instructions for frm - - vfnmsub -*/ -class vfnmsub_frm : public function_base -{ -public: - bool has_rounding_mode_operand_p () const override { return true; } - - bool has_merge_operand_p () const override { return false; } - - rtx expand (function_expander &e) const override - { - if (e.op_info->op == OP_TYPE_vf) - return e.use_ternop_insn ( - false, code_for_pred_mul_neg_scalar (PLUS, e.vector_mode ())); - if (e.op_info->op == OP_TYPE_vv) - return e.use_ternop_insn ( - false, code_for_pred_mul_neg (PLUS, e.vector_mode ())); - - gcc_unreachable (); - } -}; - -/* Implements below instructions for frm - - vfwmacc -*/ -class vfwmacc_frm : public function_base -{ -public: - bool has_rounding_mode_operand_p () const override { return true; } - - bool has_merge_operand_p () const override { return false; } - - rtx expand (function_expander &e) const override - { - if (e.op_info->op == OP_TYPE_vf) - return e.use_widen_ternop_insn ( - code_for_pred_widen_mul_scalar (PLUS, e.vector_mode ())); - if (e.op_info->op == OP_TYPE_vv) - return e.use_widen_ternop_insn ( - code_for_pred_widen_mul (PLUS, e.vector_mode ())); - - gcc_unreachable (); - } -}; - -/* Implements below instructions for frm - - vfwnmacc -*/ -class vfwnmacc_frm : public function_base -{ -public: - bool has_rounding_mode_operand_p () const override { return true; } - - bool has_merge_operand_p () const override { return false; } - - rtx expand (function_expander &e) const override - { - if (e.op_info->op == OP_TYPE_vf) - return e.use_widen_ternop_insn ( - code_for_pred_widen_mul_neg_scalar (MINUS, e.vector_mode ())); - if (e.op_info->op == OP_TYPE_vv) - return e.use_widen_ternop_insn ( - code_for_pred_widen_mul_neg (MINUS, e.vector_mode ())); - - gcc_unreachable (); - } -}; - -/* Implements below instructions for frm - - vfwmsac -*/ -class vfwmsac_frm : public function_base -{ -public: - bool has_rounding_mode_operand_p () const override { return true; } - - bool has_merge_operand_p () const override { return false; } - - rtx expand (function_expander &e) const override - { - if (e.op_info->op == OP_TYPE_vf) - return e.use_widen_ternop_insn ( - code_for_pred_widen_mul_scalar (MINUS, e.vector_mode ())); - if (e.op_info->op == OP_TYPE_vv) - return e.use_widen_ternop_insn ( - code_for_pred_widen_mul (MINUS, e.vector_mode ())); - - gcc_unreachable (); - } -}; - -/* Implements below instructions for frm - - vfwnmsac -*/ -class vfwnmsac_frm : public function_base -{ -public: - bool has_rounding_mode_operand_p () const override { return true; } - - bool has_merge_operand_p () const override { return false; } - - rtx expand (function_expander &e) const override - { - if (e.op_info->op == OP_TYPE_vf) - return e.use_widen_ternop_insn ( - code_for_pred_widen_mul_neg_scalar (PLUS, e.vector_mode ())); - if (e.op_info->op == OP_TYPE_vv) - return e.use_widen_ternop_insn ( - code_for_pred_widen_mul_neg (PLUS, e.vector_mode ())); - - gcc_unreachable (); - } -}; - -/* Implements below instructions for frm - - vfsqrt -*/ -template -class unop_frm : public function_base -{ -public: - bool has_rounding_mode_operand_p () const override { return true; } - - rtx expand (function_expander &e) const override - { - return e.use_exact_insn (code_for_pred (CODE, e.vector_mode ())); - } -}; - -/* Implements below instructions for frm - - vfrec7 -*/ -class vfrec7_frm : public function_base -{ -public: - bool has_rounding_mode_operand_p () const override { return true; } - - rtx expand (function_expander &e) const override - { - return e.use_exact_insn (code_for_pred (UNSPEC_VFREC7, e.vector_mode ())); - } -}; - /* Implements vrsub. */ class vrsub : public function_base { @@ -678,10 +299,15 @@ public: }; /* Implements vneg/vnot. */ -template +template class unop : public function_base { public: + bool has_rounding_mode_operand_p () const override + { + return FRM_OP == HAS_FRM; + } + rtx expand (function_expander &e) const override { return e.use_exact_insn (code_for_pred (CODE, e.vector_mode ())); @@ -730,7 +356,7 @@ public: } }; -/* Implements vwadd/vwsub/vwmul/vfwadd/vfwsub/vfwmul. */ +/* Implements vwadd/vwsub/vwmul. */ template class widen_binop : public function_base { @@ -760,10 +386,17 @@ public: } } }; -template -class widen_binop : public function_base + +/* Implement vfwadd/vfwsub/vfwmul. */ +template +class widen_binop_fp : public function_base { public: + bool has_rounding_mode_operand_p () const override + { + return FRM_OP == HAS_FRM; + } + rtx expand (function_expander &e) const override { switch (e.op_info->op) @@ -1382,10 +1015,15 @@ public: }; /* Implements vfrsub/vfrdiv. */ -template +template class reverse_binop : public function_base { public: + bool has_rounding_mode_operand_p () const override + { + return FRM_OP == HAS_FRM; + } + rtx expand (function_expander &e) const override { return e.use_exact_insn ( @@ -1393,9 +1031,15 @@ public: } }; +template class vfmacc : public function_base { public: + bool has_rounding_mode_operand_p () const override + { + return FRM_OP == HAS_FRM; + } + bool has_merge_operand_p () const override { return false; } rtx expand (function_expander &e) const override @@ -1411,9 +1055,15 @@ public: } }; +template class vfnmsac : public function_base { public: + bool has_rounding_mode_operand_p () const override + { + return FRM_OP == HAS_FRM; + } + bool has_merge_operand_p () const override { return false; } rtx expand (function_expander &e) const override @@ -1428,9 +1078,15 @@ public: } }; +template class vfmadd : public function_base { public: + bool has_rounding_mode_operand_p () const override + { + return FRM_OP == HAS_FRM; + } + bool has_merge_operand_p () const override { return false; } rtx expand (function_expander &e) const override @@ -1446,9 +1102,15 @@ public: } }; +template class vfnmsub : public function_base { public: + bool has_rounding_mode_operand_p () const override + { + return FRM_OP == HAS_FRM; + } + bool has_merge_operand_p () const override { return false; } rtx expand (function_expander &e) const override @@ -1463,9 +1125,15 @@ public: } }; +template class vfnmacc : public function_base { public: + bool has_rounding_mode_operand_p () const override + { + return FRM_OP == HAS_FRM; + } + bool has_merge_operand_p () const override { return false; } rtx expand (function_expander &e) const override @@ -1480,9 +1148,15 @@ public: } }; +template class vfmsac : public function_base { public: + bool has_rounding_mode_operand_p () const override + { + return FRM_OP == HAS_FRM; + } + bool has_merge_operand_p () const override { return false; } rtx expand (function_expander &e) const override @@ -1498,9 +1172,15 @@ public: } }; +template class vfnmadd : public function_base { public: + bool has_rounding_mode_operand_p () const override + { + return FRM_OP == HAS_FRM; + } + bool has_merge_operand_p () const override { return false; } rtx expand (function_expander &e) const override @@ -1515,9 +1195,15 @@ public: } }; +template class vfmsub : public function_base { public: + bool has_rounding_mode_operand_p () const override + { + return FRM_OP == HAS_FRM; + } + bool has_merge_operand_p () const override { return false; } rtx expand (function_expander &e) const override @@ -1533,9 +1219,15 @@ public: } }; +template class vfwmacc : public function_base { public: + bool has_rounding_mode_operand_p () const override + { + return FRM_OP == HAS_FRM; + } + bool has_merge_operand_p () const override { return false; } rtx expand (function_expander &e) const override @@ -1550,9 +1242,15 @@ public: } }; +template class vfwnmacc : public function_base { public: + bool has_rounding_mode_operand_p () const override + { + return FRM_OP == HAS_FRM; + } + bool has_merge_operand_p () const override { return false; } rtx expand (function_expander &e) const override @@ -1567,9 +1265,15 @@ public: } }; +template class vfwmsac : public function_base { public: + bool has_rounding_mode_operand_p () const override + { + return FRM_OP == HAS_FRM; + } + bool has_merge_operand_p () const override { return false; } rtx expand (function_expander &e) const override @@ -1584,9 +1288,15 @@ public: } }; +template class vfwnmsac : public function_base { public: + bool has_rounding_mode_operand_p () const override + { + return FRM_OP == HAS_FRM; + } + bool has_merge_operand_p () const override { return false; } rtx expand (function_expander &e) const override @@ -1602,10 +1312,15 @@ public: }; /* Implements vfsqrt7/vfrec7/vfclass/vfsgnj/vfsgnjx. */ -template +template class float_misc : public function_base { public: + bool has_rounding_mode_operand_p () const override + { + return FRM_OP == HAS_FRM; + } + rtx expand (function_expander &e) const override { if (e.op_info->op == OP_TYPE_vf) @@ -2446,51 +2161,51 @@ static CONSTEXPR const viota viota_obj; static CONSTEXPR const vid vid_obj; static CONSTEXPR const binop vfadd_obj; static CONSTEXPR const binop vfsub_obj; -static CONSTEXPR const binop_frm vfadd_frm_obj; -static CONSTEXPR const binop_frm vfsub_frm_obj; +static CONSTEXPR const binop vfadd_frm_obj; +static CONSTEXPR const binop vfsub_frm_obj; static CONSTEXPR const reverse_binop vfrsub_obj; -static CONSTEXPR const reverse_binop_frm vfrsub_frm_obj; -static CONSTEXPR const widen_binop vfwadd_obj; -static CONSTEXPR const widen_binop_frm vfwadd_frm_obj; -static CONSTEXPR const widen_binop vfwsub_obj; -static CONSTEXPR const widen_binop_frm vfwsub_frm_obj; +static CONSTEXPR const reverse_binop vfrsub_frm_obj; +static CONSTEXPR const widen_binop_fp vfwadd_obj; +static CONSTEXPR const widen_binop_fp vfwadd_frm_obj; +static CONSTEXPR const widen_binop_fp vfwsub_obj; +static CONSTEXPR const widen_binop_fp vfwsub_frm_obj; static CONSTEXPR const binop vfmul_obj; -static CONSTEXPR const binop_frm vfmul_frm_obj; +static CONSTEXPR const binop vfmul_frm_obj; static CONSTEXPR const binop
vfdiv_obj; -static CONSTEXPR const binop_frm
vfdiv_frm_obj; +static CONSTEXPR const binop vfdiv_frm_obj; static CONSTEXPR const reverse_binop
vfrdiv_obj; -static CONSTEXPR const reverse_binop_frm
vfrdiv_frm_obj; -static CONSTEXPR const widen_binop vfwmul_obj; -static CONSTEXPR const widen_binop_frm vfwmul_frm_obj; -static CONSTEXPR const vfmacc vfmacc_obj; -static CONSTEXPR const vfmacc_frm vfmacc_frm_obj; -static CONSTEXPR const vfnmsac vfnmsac_obj; -static CONSTEXPR const vfnmsac_frm vfnmsac_frm_obj; -static CONSTEXPR const vfmadd vfmadd_obj; -static CONSTEXPR const vfmadd_frm vfmadd_frm_obj; -static CONSTEXPR const vfnmsub vfnmsub_obj; -static CONSTEXPR const vfnmsub_frm vfnmsub_frm_obj; -static CONSTEXPR const vfnmacc vfnmacc_obj; -static CONSTEXPR const vfnmacc_frm vfnmacc_frm_obj; -static CONSTEXPR const vfmsac vfmsac_obj; -static CONSTEXPR const vfmsac_frm vfmsac_frm_obj; -static CONSTEXPR const vfnmadd vfnmadd_obj; -static CONSTEXPR const vfnmadd_frm vfnmadd_frm_obj; -static CONSTEXPR const vfmsub vfmsub_obj; -static CONSTEXPR const vfmsub_frm vfmsub_frm_obj; -static CONSTEXPR const vfwmacc vfwmacc_obj; -static CONSTEXPR const vfwmacc_frm vfwmacc_frm_obj; -static CONSTEXPR const vfwnmacc vfwnmacc_obj; -static CONSTEXPR const vfwnmacc_frm vfwnmacc_frm_obj; -static CONSTEXPR const vfwmsac vfwmsac_obj; -static CONSTEXPR const vfwmsac_frm vfwmsac_frm_obj; -static CONSTEXPR const vfwnmsac vfwnmsac_obj; -static CONSTEXPR const vfwnmsac_frm vfwnmsac_frm_obj; +static CONSTEXPR const reverse_binop vfrdiv_frm_obj; +static CONSTEXPR const widen_binop_fp vfwmul_obj; +static CONSTEXPR const widen_binop_fp vfwmul_frm_obj; +static CONSTEXPR const vfmacc vfmacc_obj; +static CONSTEXPR const vfmacc vfmacc_frm_obj; +static CONSTEXPR const vfnmsac vfnmsac_obj; +static CONSTEXPR const vfnmsac vfnmsac_frm_obj; +static CONSTEXPR const vfmadd vfmadd_obj; +static CONSTEXPR const vfmadd vfmadd_frm_obj; +static CONSTEXPR const vfnmsub vfnmsub_obj; +static CONSTEXPR const vfnmsub vfnmsub_frm_obj; +static CONSTEXPR const vfnmacc vfnmacc_obj; +static CONSTEXPR const vfnmacc vfnmacc_frm_obj; +static CONSTEXPR const vfmsac vfmsac_obj; +static CONSTEXPR const vfmsac vfmsac_frm_obj; +static CONSTEXPR const vfnmadd vfnmadd_obj; +static CONSTEXPR const vfnmadd vfnmadd_frm_obj; +static CONSTEXPR const vfmsub vfmsub_obj; +static CONSTEXPR const vfmsub vfmsub_frm_obj; +static CONSTEXPR const vfwmacc vfwmacc_obj; +static CONSTEXPR const vfwmacc vfwmacc_frm_obj; +static CONSTEXPR const vfwnmacc vfwnmacc_obj; +static CONSTEXPR const vfwnmacc vfwnmacc_frm_obj; +static CONSTEXPR const vfwmsac vfwmsac_obj; +static CONSTEXPR const vfwmsac vfwmsac_frm_obj; +static CONSTEXPR const vfwnmsac vfwnmsac_obj; +static CONSTEXPR const vfwnmsac vfwnmsac_frm_obj; static CONSTEXPR const unop vfsqrt_obj; -static CONSTEXPR const unop_frm vfsqrt_frm_obj; +static CONSTEXPR const unop vfsqrt_frm_obj; static CONSTEXPR const float_misc vfrsqrt7_obj; static CONSTEXPR const float_misc vfrec7_obj; -static CONSTEXPR const vfrec7_frm vfrec7_frm_obj; +static CONSTEXPR const float_misc vfrec7_frm_obj; static CONSTEXPR const binop vfmin_obj; static CONSTEXPR const binop vfmax_obj; static CONSTEXPR const float_misc vfsgnj_obj;