From nobody Wed Nov 19 04:35:02 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1614312399; cv=none; d=zohomail.com; s=zohoarc; b=DiSM4scAH/LNXLAPI744cSNJGbiAX42l0q3jQ431/bV0zpw0KY2KOEGBW7dt/S2worLRmnUP5/sg412M+VKawUnOqhXG4PPGTA40Olq0d1eWNiUAERYuWtz6O7I6aCEmJ9g/c5oGN19eEW/V8VSz4/cdJK+AGy9KHVV8UecbjwQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614312399; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=/LJbYaigkYJgDTUepB6KVm2XsQS2TjXtcR24GUBg5MQ=; b=foR+rRBvG4GqJ1v8AVBU9o2JZlSiU+LqY1bMtAIn8hFhIUBbkdz/cAv98rRBN+I3+NYYR11MgggZzXPw/k9FuDnccxlX5vpKkSNoRQC/z7aaG0mUSteSdrjn5YlS8ZhgU875kluoR3ojvGj/V2XUJEfBck+ObLURApi/LZgMhXQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1614312399388930.9399464545297; Thu, 25 Feb 2021 20:06:39 -0800 (PST) Received: from localhost ([::1]:58712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lFUOk-0000Co-16 for importer@patchew.org; Thu, 25 Feb 2021 23:06:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFTjo-0002FR-2r for qemu-devel@nongnu.org; Thu, 25 Feb 2021 22:24:20 -0500 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]:40142) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lFTji-0002VF-I0 for qemu-devel@nongnu.org; Thu, 25 Feb 2021 22:24:18 -0500 Received: by mail-pg1-x52d.google.com with SMTP id b21so5402808pgk.7 for ; Thu, 25 Feb 2021 19:24:14 -0800 (PST) Received: from frankchang-ThinkPad-T490.internal.sifive.com (114-34-229-221.HINET-IP.hinet.net. [114.34.229.221]) by smtp.gmail.com with ESMTPSA id p11sm7083709pjb.31.2021.02.25.19.24.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Feb 2021 19:24:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/LJbYaigkYJgDTUepB6KVm2XsQS2TjXtcR24GUBg5MQ=; b=VM6aOBmBudafrrvaOAhwbyxXX6cgpmMtc4i3IrH14jmHl8xH1Wc179oJOZImkeVUrv Rfauk6kaJyLEUlPNgOH1kF1TuMOpGbBp5+8NXukH3hw/Xq1fEmJdQ53WK03mWSsUcrl9 P1fRmQC+aVD2ETjqDzbtFvnxJmIe3vbXjMffH2cIrqu+mqeOTAbBB+oyFEDhGrGR9exF oEiEfTwDKNUUeGzRS89EqTU0QlC3t5P+LgfgvHyqbDpmdizjMHfbY+C1GS8CMT345vMb l1rPWc+Z8b/zqWvQa9HK5LED+cPlf11HpGIWidcbFmRnsyPGfHiFUg9jiILVb8XQNE2E RjFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/LJbYaigkYJgDTUepB6KVm2XsQS2TjXtcR24GUBg5MQ=; b=CJ0r4yUknXmSV8z+7ficCHlAnBcLxQbnOO6nfj6kFvy0nuoCpm6/XLbY5NB0J6apI/ MSpVka3hq3BmKYKTVbZXozwE3ColMZ6Ja9Rx2MRosvOFfRCOklsaduPUVdkOZ4IqURYQ 8imE4V70/lErnudMeUvYPs/zuf+8eBsjk3LugU9fVcDtroyAC+6NWGJiktM/uL7FvLDZ HnIB/KvkwtXif9YQ1+r+6WioKmyfDHdimVgqplFt9pwGC4kcOzMg3c3jWFIN4CVR4odE fMi7eGiwfEp7VaxcMQ9LQDONBDziKI6RwY6pmC17OJq1oVqB8JKzSR4og5KFm5p11usS 0KOQ== X-Gm-Message-State: AOAM531y3ealr0mgKaYbrAnBRr0ZV/fyjPH47uQWkwy27F57vONG02K2 NCbU3zZCfNU/TKNhT5+qqtK0miBx1XtWfQ== X-Google-Smtp-Source: ABdhPJx7DnzP1jAduSI0qOdgwN29G3HRu7opAzO9OACmzJOaU30ypLPFX0nQt5jbbvqy0yEaHblh0g== X-Received: by 2002:a63:4084:: with SMTP id n126mr1048574pga.80.1614309853171; Thu, 25 Feb 2021 19:24:13 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Subject: [PATCH v7 52/75] target/riscv: rvv-1.0: single-width floating-point reduction Date: Fri, 26 Feb 2021 11:18:36 +0800 Message-Id: <20210226031902.23656-53-frank.chang@sifive.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210226031902.23656-1-frank.chang@sifive.com> References: <20210226031902.23656-1-frank.chang@sifive.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=frank.chang@sifive.com; helo=mail-pg1-x52d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sagar Karandikar , Frank Chang , Bastian Koppelmann , Richard Henderson , Alistair Francis , Palmer Dabbelt , LIU Zhiwei Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/insn_trans/trans_rvv.c.inc | 12 +++++++++--- target/riscv/vector_helper.c | 12 ++++++------ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_tr= ans/trans_rvv.c.inc index 731c4bdd04b..c4ccccb0370 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -2866,9 +2866,15 @@ GEN_OPIVV_WIDEN_TRANS(vwredsum_vs, reduction_widen_c= heck) GEN_OPIVV_WIDEN_TRANS(vwredsumu_vs, reduction_widen_check) =20 /* Vector Single-Width Floating-Point Reduction Instructions */ -GEN_OPFVV_TRANS(vfredsum_vs, reduction_check) -GEN_OPFVV_TRANS(vfredmax_vs, reduction_check) -GEN_OPFVV_TRANS(vfredmin_vs, reduction_check) +static bool freduction_check(DisasContext *s, arg_rmrr *a) +{ + return reduction_check(s, a) && + require_rvf(s); +} + +GEN_OPFVV_TRANS(vfredsum_vs, freduction_check) +GEN_OPFVV_TRANS(vfredmax_vs, freduction_check) +GEN_OPFVV_TRANS(vfredmin_vs, freduction_check) =20 /* Vector Widening Floating-Point Reduction Instructions */ GEN_OPFVV_WIDEN_TRANS(vfwredsum_vs, reduction_check) diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index c5048882e91..e6931466d40 100644 --- a/target/riscv/vector_helper.c +++ b/target/riscv/vector_helper.c @@ -4382,14 +4382,14 @@ GEN_VEXT_FRED(vfredsum_vs_w, uint32_t, uint32_t, H4= , H4, float32_add) GEN_VEXT_FRED(vfredsum_vs_d, uint64_t, uint64_t, H8, H8, float64_add) =20 /* Maximum value */ -GEN_VEXT_FRED(vfredmax_vs_h, uint16_t, uint16_t, H2, H2, float16_maxnum) -GEN_VEXT_FRED(vfredmax_vs_w, uint32_t, uint32_t, H4, H4, float32_maxnum) -GEN_VEXT_FRED(vfredmax_vs_d, uint64_t, uint64_t, H8, H8, float64_maxnum) +GEN_VEXT_FRED(vfredmax_vs_h, uint16_t, uint16_t, H2, H2, float16_maxnum_no= prop) +GEN_VEXT_FRED(vfredmax_vs_w, uint32_t, uint32_t, H4, H4, float32_maxnum_no= prop) +GEN_VEXT_FRED(vfredmax_vs_d, uint64_t, uint64_t, H8, H8, float64_maxnum_no= prop) =20 /* Minimum value */ -GEN_VEXT_FRED(vfredmin_vs_h, uint16_t, uint16_t, H2, H2, float16_minnum) -GEN_VEXT_FRED(vfredmin_vs_w, uint32_t, uint32_t, H4, H4, float32_minnum) -GEN_VEXT_FRED(vfredmin_vs_d, uint64_t, uint64_t, H8, H8, float64_minnum) +GEN_VEXT_FRED(vfredmin_vs_h, uint16_t, uint16_t, H2, H2, float16_minnum_no= prop) +GEN_VEXT_FRED(vfredmin_vs_w, uint32_t, uint32_t, H4, H4, float32_minnum_no= prop) +GEN_VEXT_FRED(vfredmin_vs_d, uint64_t, uint64_t, H8, H8, float64_minnum_no= prop) =20 /* Vector Widening Floating-Point Reduction Instructions */ /* Unordered reduce 2*SEW =3D 2*SEW + sum(promote(SEW)) */ --=20 2.17.1