From patchwork Fri Aug 18 02:53:55 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: 135971 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b82d:0:b0:3f2:4152:657d with SMTP id z13csp1120459vqi; Thu, 17 Aug 2023 19:54:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFs4ddthGwO1hQvRHDA/CrsImnP9nohMtQam0Dz2uuneXotzCkf9/29PmqruHbCcdCtDJSl X-Received: by 2002:a05:6512:3ba5:b0:4f8:7551:7485 with SMTP id g37-20020a0565123ba500b004f875517485mr874297lfv.5.1692327291984; Thu, 17 Aug 2023 19:54:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692327291; cv=none; d=google.com; s=arc-20160816; b=Z+2tBRjrKVnWxxKX9HXlBkI+5tU7wXq11d0MU7RG1hVHPuTdzOn5kSsBn71vS8ULYD RpR4Q3j/xt2MCBaXhuWMjGiaWRoaNYhq6lGIqvUqqb4NZ8drsUADt79Cebrlntccsm3I VIvDNEsqMUqu84PbJlJBvljVIU6ez4n3G1KhZ+dRprkMs+v+1MQpfVPBrIPDFJkmIUwr JpZGcvLlXJjIQqfyruzJxcu86Z/mW2ntjWg01PIhmm2iGJVcd97e4DQ336fv2pdEKkDp fnNJ4n/4aMtDwqEQfeVvCLhkcHF4CUHvzjs01NUF1pCYk+TRI+5qUy6L4WLgT8WQBfUU yfAQ== 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:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=3zGQ5O0IIkBKPSeoem8jtyT09CVpuyljD1vfFEFfSSs=; fh=9EZcvfVI324lLsRm78AR5trG4A9hqVpSpoTtyXFX1N4=; b=tl5ZuIRZ3T+Q9eQBWrKftAJ0XEwBiJDGAKUsWNw5+Fsc2mZ+/zCUxu6EjtxOyR1pJI xZ8L0Z/zJDItEZNkk5Y+BzOfPh37CBFIJQZkqIVfBc0qUNAp0lSXf+Bum0LSl/T8hAQr fQcW8K3+qNWBLTZRB80qFBFMSA+9ygBx525juukfqnOa/++CpkjkEWx9fNLE/DKOyuFN 617lgwJTUsyMfIh/BjCGtb4twqSJdIBtEiYC4r38H5Q2fhIxrFq/AYRxyxjqCJ5C3Pja j/XXCJmorCzK1asKD/InNMJDuJ5KLVRs1OvKNsg66yf5sLLVv+Kd1NE8mLxGZ+e3Tq+p 9HKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=b0zedahz; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id n12-20020a170906688c00b0099d9806b0aasi589256ejr.731.2023.08.17.19.54.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Aug 2023 19:54:51 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=b0zedahz; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 C3FE03853839 for ; Fri, 18 Aug 2023 02:54:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C3FE03853839 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692327290; bh=3zGQ5O0IIkBKPSeoem8jtyT09CVpuyljD1vfFEFfSSs=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=b0zedahzj91vxWtdzCLrRlg1E5nNJlp3KLqICNWqIaEz8+uu5by/3jqADci4tvEN5 an1HJw0HRpwnYNxKYh7CYwVRSkW3655/LpCcatPu7aRaejZNp/NTWm8MUZDs/zs+iY zfbhGQ68H3jJrJINMsFUcR8CfgdJFZwGWYp2omJY= 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 02F54385B512 for ; Fri, 18 Aug 2023 02:54:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 02F54385B512 X-IronPort-AV: E=McAfee;i="6600,9927,10805"; a="371897424" X-IronPort-AV: E=Sophos;i="6.01,181,1684825200"; d="scan'208";a="371897424" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2023 19:53:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10805"; a="734913981" X-IronPort-AV: E=Sophos;i="6.01,181,1684825200"; d="scan'208";a="734913981" Received: from shvmail02.sh.intel.com ([10.239.244.9]) by orsmga002.jf.intel.com with ESMTP; 17 Aug 2023 19:53:57 -0700 Received: from pli-ubuntu.sh.intel.com (pli-ubuntu.sh.intel.com [10.239.159.47]) by shvmail02.sh.intel.com (Postfix) with ESMTP id C80CA1007BD7; Fri, 18 Aug 2023 10:53:56 +0800 (CST) To: gcc-patches@gcc.gnu.org Cc: juzhe.zhong@rivai.ai, pan2.li@intel.com, yanzhang.wang@intel.com, kito.cheng@gmail.com Subject: [PATCH v1] RISC-V: Refactor RVV class by frm_op_type template arg Date: Fri, 18 Aug 2023 10:53:55 +0800 Message-Id: <20230818025355.3280223-1-pan2.li@intel.com> X-Mailer: git-send-email 2.34.1 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: 1774533782965053334 From: Pan Li 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. --- .../riscv/riscv-vector-builtins-bases.cc | 570 +++++------------- 1 file changed, 142 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..c1f50fdd987 100644 --- a/gcc/config/riscv/riscv-vector-builtins-bases.cc +++ b/gcc/config/riscv/riscv-vector-builtins-bases.cc @@ -262,41 +262,20 @@ 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: case OP_TYPE_vf: return e.use_exact_insn (code_for_pred_scalar (CODE, e.vector_mode ())); case OP_TYPE_vv: @@ -307,365 +286,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 +298,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 +355,7 @@ public: } }; -/* Implements vwadd/vwsub/vwmul/vfwadd/vfwsub/vfwmul. */ +/* Implements vwadd/vwsub/vwmul. */ template class widen_binop : public function_base { @@ -760,10 +385,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 +1014,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 +1030,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 +1054,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 +1077,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 +1101,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 +1124,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 +1147,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 +1171,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 +1194,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 +1218,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 +1241,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 +1264,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 +1287,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 +1311,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 +2160,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;