From nobody Sun May 19 05:00:09 2024 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 164074415770718.246696769066943; Tue, 28 Dec 2021 18:15:57 -0800 (PST) Received: from localhost ([::1]:46764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2OVR-00052y-11 for importer@patchew.org; Tue, 28 Dec 2021 21:15:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2OSe-000240-2r for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:13:04 -0500 Received: from [2607:f8b0:4864:20::42d] (port=38858 helo=mail-pf1-x42d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2OSc-0001UP-1P for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:13:03 -0500 Received: by mail-pf1-x42d.google.com with SMTP id b22so17520133pfb.5 for ; Tue, 28 Dec 2021 18:13:00 -0800 (PST) Received: from hsinchu16.internal.sifive.com (59-124-168-89.hinet-ip.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id k8sm15693975pjs.53.2021.12.28.18.12.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:12:59 -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 :mime-version:content-transfer-encoding; bh=6QmhziBsG5pFpMldyIeZwYZC1awxwL5wfWwunsysBLg=; b=AULAP8cXv0+NHR1o83OvIQhwBygfaCuT+9lgt9nC5kXF5pmO0VfmEQEphjvIXaOtVh 3sNXPZOgX5bC0PS7/HjvOrgQ6pN6Esu9M4mcjfesD6IS+4Vj1XZgdfLb/+QkAEq7SxAj hJJOHatxOHUgefE9nf6ZgUBmkoo9uvsj3feT84U7QwXZCeHUjxI162kgZYyu0vQK7zHP KRLiztgcI/lge47gnd59656yrLhjBJhH3SCRP/178vLpfp0jpmzuxJHbH6m2675TOfQx 7yIP2TAnPmtvNUY7nAObAED57JvNKv6cVpMBssVn8ciVHa8WukT114Q6YHZXY4WC+pf7 WqOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6QmhziBsG5pFpMldyIeZwYZC1awxwL5wfWwunsysBLg=; b=6kyHGxHwA1YtSTNiutwiIMt8dD2PV/sNGFkIGyDuTyM7h1Gn+vJ+6axNxh+uahhl3N SOUZ+z3q4vPmHnbBVofGtfC+QkL8UAdJuWfAIJEppKFNiJwFOhnLiKm4vWvsmYbxJ9bl o/abCtaRgIseO9n+QcDqux/ygvE6NngVQ+hdd3vB8vNZgsADmVaNI5dKGy39+84KCZF1 nTpwgz/E2EgDygAnuoOeQ6e2d9J3DDtZBRT1E5g7styHQ/Sq9eqpgrt8ExzNm1sI2YbS 55Sh0vOHEhBx/HqCL5xSwJXHdcxB3gz5Ih4Hg7OWJOn+puOtuamZA60BlnG2zRDMHpcK yI+g== X-Gm-Message-State: AOAM532aZZW0oNrgqYzb2aCZyqIN0GcJv/fl9IEOSG1HdTBUCDKyO/g+ L1Ni/nXx4F8rMIruk2EGm0wun6FEWDvhACJo X-Google-Smtp-Source: ABdhPJzILEo0z8Ar3oP4qNQQz3wddmWm21XKAl6YFJZ/wjPXPf/ooxFA3eFsVsXRVTfwLIjVrkaN5w== X-Received: by 2002:a05:6a00:1310:b0:4b9:f9b8:1f47 with SMTP id j16-20020a056a00131000b004b9f9b81f47mr24629372pfu.25.1640743979473; Tue, 28 Dec 2021 18:12:59 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 1/3] target/riscv: rvv-1.0: Call the correct RVF/RVD check funtion for widening fp insns Date: Wed, 29 Dec 2021 10:12:46 +0800 Message-Id: <20211229021250.29804-2-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229021250.29804-1-frank.chang@sifive.com> References: <20211229021250.29804-1-frank.chang@sifive.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::42d (failed) 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::42d; envelope-from=frank.chang@sifive.com; helo=mail-pf1-x42d.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-riscv@nongnu.org, Frank Chang , Bin Meng , Richard Henderson , Palmer Dabbelt , Alistair Francis , LIU Zhiwei Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1640744159408000001 Content-Type: text/plain; charset="utf-8" From: Frank Chang Vector widening floating-point instructions should use require_scale_rvf() instead of require_rvf() to check whether RVF/RVD is enabled. --- target/riscv/insn_trans/trans_rvv.c.inc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_tr= ans/trans_rvv.c.inc index 5e3f7fdb77..8d92243f2b 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -2254,7 +2254,8 @@ GEN_OPFVF_TRANS(vfrsub_vf, opfvf_check) static bool opfvv_widen_check(DisasContext *s, arg_rmrr *a) { return require_rvv(s) && - require_rvf(s) && + require_scale_rvf(s) && + (s->sew !=3D MO_8) && vext_check_isa_ill(s) && vext_check_dss(s, a->rd, a->rs1, a->rs2, a->vm); } @@ -2292,7 +2293,8 @@ GEN_OPFVV_WIDEN_TRANS(vfwsub_vv, opfvv_widen_check) static bool opfvf_widen_check(DisasContext *s, arg_rmrr *a) { return require_rvv(s) && - require_rvf(s) && + require_scale_rvf(s) && + (s->sew !=3D MO_8) && vext_check_isa_ill(s) && vext_check_ds(s, a->rd, a->rs2, a->vm); } @@ -2321,7 +2323,8 @@ GEN_OPFVF_WIDEN_TRANS(vfwsub_vf) static bool opfwv_widen_check(DisasContext *s, arg_rmrr *a) { return require_rvv(s) && - require_rvf(s) && + require_scale_rvf(s) && + (s->sew !=3D MO_8) && vext_check_isa_ill(s) && vext_check_dds(s, a->rd, a->rs1, a->rs2, a->vm); } @@ -2359,7 +2362,8 @@ GEN_OPFWV_WIDEN_TRANS(vfwsub_wv) static bool opfwf_widen_check(DisasContext *s, arg_rmrr *a) { return require_rvv(s) && - require_rvf(s) && + require_scale_rvf(s) && + (s->sew !=3D MO_8) && vext_check_isa_ill(s) && vext_check_dd(s, a->rd, a->rs2, a->vm); } --=20 2.31.1 From nobody Sun May 19 05:00:09 2024 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1640744181496846.9439510043621; Tue, 28 Dec 2021 18:16:21 -0800 (PST) Received: from localhost ([::1]:47252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2OVn-0005M5-G3 for importer@patchew.org; Tue, 28 Dec 2021 21:16:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2OSh-00026Q-9S for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:13:07 -0500 Received: from [2607:f8b0:4864:20::431] (port=41511 helo=mail-pf1-x431.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2OSe-0001W8-H9 for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:13:07 -0500 Received: by mail-pf1-x431.google.com with SMTP id m1so17528571pfk.8 for ; Tue, 28 Dec 2021 18:13:04 -0800 (PST) Received: from hsinchu16.internal.sifive.com (59-124-168-89.hinet-ip.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id k8sm15693975pjs.53.2021.12.28.18.13.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:13:02 -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 :mime-version:content-transfer-encoding; bh=AsGHGTeIg5V51/RNv1WbNiNM59nEQ3ZssuqWKV70IPU=; b=ShIWO7bIV4tirLg4t8iKJ7+O9ktl5KQ7pOGUEjwkT/IXAyVO48cqRpDBlFOYhxd0gn ehIsaod2VumI2LWVda7RMpSKs+6NpH7EAEK8G88tt/I6RyvzcA/MRqO2e4djjhOmYFJV SODLpWjjXM7ze6Yd6C1SF/9dGoDvvwZhF4vcd+JVO/4T4MbGKF8/SEm96cjj3hC5R2up vm0fQSVLgs7o7SuG9rmcszCn41N68yRrGDnw2DKOvGyGD6qbKNrBA5v1GYDGd4fKFHVM CWVOrzISdYSp4WEDHSarWCCQZfWKon4qxGBP0HWh8ydK3bHpQJ0xzXIWM0anW1ISu4vh Cn6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AsGHGTeIg5V51/RNv1WbNiNM59nEQ3ZssuqWKV70IPU=; b=Kfd8tHqgCyG0Syoa0iGftqjqty9cBT8cCKA0F64LUHMZ2Y6zs8GqoG6AWVmXl9xIfc POvVonLLe+QYiIQy08Rq01YWrykh+NjFjM3MPGBuxTFJGGZ8Jwcj+Cde6Foxlg/re3tM Tepd5HjFVLtJLNAtJHlxuX9JfEse2JQPOjBjkMXKHUM/eTeAMCYsgSZZHulfoNeBzt00 vVlZ8dpLCGrAg6OaC7IQPC9594FJRiCUdxza1zIRuTuJTUXk6mc9Fk7dy5bRgTj2QiGR yFtx1VM6TiZafYhR8JPSvVkizMkDt2NQIrt4NxQBWB2uwpgo0yhZXz9GbH7hHedd+1hN F1UA== X-Gm-Message-State: AOAM533o77Fu4fm5BooB8k+5ew0Y7WmzNl8+edCJm+lKr6KHiDvoQoCt bPtkrkL5JWnuDrtXXWH8W5uLtq/6Qio5ODZM X-Google-Smtp-Source: ABdhPJyHx165h0wqM66eLzo0ccOzqbRDzAMQ3U46B5nLyGPd7VtPyWasAdw7NHULJmaA2Aq6+rMAAw== X-Received: by 2002:a63:d446:: with SMTP id i6mr21835794pgj.479.1640743983101; Tue, 28 Dec 2021 18:13:03 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 2/3] target/riscv: rvv-1.0: Call the correct RVF/RVD check funtion for widening fp/int type-convert insns Date: Wed, 29 Dec 2021 10:12:47 +0800 Message-Id: <20211229021250.29804-3-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229021250.29804-1-frank.chang@sifive.com> References: <20211229021250.29804-1-frank.chang@sifive.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::431 (failed) 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::431; envelope-from=frank.chang@sifive.com; helo=mail-pf1-x431.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-riscv@nongnu.org, Frank Chang , Bin Meng , Richard Henderson , Palmer Dabbelt , Alistair Francis , LIU Zhiwei Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1640744184263000001 Content-Type: text/plain; charset="utf-8" From: Frank Chang vfwcvt.xu.f.v, vfwcvt.x.f.v, vfwcvt.rtz.xu.f.v and vfwcvt.rtz.x.f.v convert single-width floating-point to double-width integer. Therefore, should use require_rvf() to check whether RVF/RVD is enabled. vfwcvt.f.xu.v, vfwcvt.f.x.v convert single-width integer to double-width floating-point, and vfwcvt.f.f.v convert double-width floating-point to single-width floating-point. Therefore, should use require_scale_rvf() to check whether RVF/RVD is enabled. --- target/riscv/insn_trans/trans_rvv.c.inc | 34 ++++++++++++++++++------- 1 file changed, 25 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 8d92243f2b..f1b44ccad2 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -2613,16 +2613,27 @@ GEN_OPFV_CVT_TRANS(vfcvt_rtz_x_f_v, vfcvt_x_f_v, RI= SCV_FRM_RTZ) static bool opfv_widen_check(DisasContext *s, arg_rmr *a) { return require_rvv(s) && - require_scale_rvf(s) && - (s->sew !=3D MO_8) && vext_check_isa_ill(s) && vext_check_ds(s, a->rd, a->rs2, a->vm); } =20 -#define GEN_OPFV_WIDEN_TRANS(NAME, HELPER, FRM) \ +static bool opxfv_widen_check(DisasContext *s, arg_rmr *a) +{ + return opfv_widen_check(s, a) && + require_rvf(s); +} + +static bool opffv_widen_check(DisasContext *s, arg_rmr *a) +{ + return opfv_widen_check(s, a) && + require_scale_rvf(s) && + (s->sew !=3D MO_8); +} + +#define GEN_OPFV_WIDEN_TRANS(NAME, CHECK, HELPER, FRM) \ static bool trans_##NAME(DisasContext *s, arg_rmr *a) \ { \ - if (opfv_widen_check(s, a)) { \ + if (CHECK(s, a)) { \ if (FRM !=3D RISCV_FRM_DYN) { \ gen_set_rm(s, RISCV_FRM_DYN); \ } \ @@ -2649,12 +2660,17 @@ static bool trans_##NAME(DisasContext *s, arg_rmr *= a) \ return false; \ } =20 -GEN_OPFV_WIDEN_TRANS(vfwcvt_xu_f_v, vfwcvt_xu_f_v, RISCV_FRM_DYN) -GEN_OPFV_WIDEN_TRANS(vfwcvt_x_f_v, vfwcvt_x_f_v, RISCV_FRM_DYN) -GEN_OPFV_WIDEN_TRANS(vfwcvt_f_f_v, vfwcvt_f_f_v, RISCV_FRM_DYN) +GEN_OPFV_WIDEN_TRANS(vfwcvt_xu_f_v, opxfv_widen_check, vfwcvt_xu_f_v, + RISCV_FRM_DYN) +GEN_OPFV_WIDEN_TRANS(vfwcvt_x_f_v, opxfv_widen_check, vfwcvt_x_f_v, + RISCV_FRM_DYN) +GEN_OPFV_WIDEN_TRANS(vfwcvt_f_f_v, opffv_widen_check, vfwcvt_f_f_v, + RISCV_FRM_DYN) /* Reuse the helper functions from vfwcvt.xu.f.v and vfwcvt.x.f.v */ -GEN_OPFV_WIDEN_TRANS(vfwcvt_rtz_xu_f_v, vfwcvt_xu_f_v, RISCV_FRM_RTZ) -GEN_OPFV_WIDEN_TRANS(vfwcvt_rtz_x_f_v, vfwcvt_x_f_v, RISCV_FRM_RTZ) +GEN_OPFV_WIDEN_TRANS(vfwcvt_rtz_xu_f_v, opxfv_widen_check, vfwcvt_xu_f_v, + RISCV_FRM_RTZ) +GEN_OPFV_WIDEN_TRANS(vfwcvt_rtz_x_f_v, opxfv_widen_check, vfwcvt_x_f_v, + RISCV_FRM_RTZ) =20 static bool opfxv_widen_check(DisasContext *s, arg_rmr *a) { --=20 2.31.1 From nobody Sun May 19 05:00:09 2024 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1640744175462261.2444496549582; Tue, 28 Dec 2021 18:16:15 -0800 (PST) Received: from localhost ([::1]:47238 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2OVi-0005Le-PD for importer@patchew.org; Tue, 28 Dec 2021 21:16:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2OSk-00029H-8T for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:13:11 -0500 Received: from [2607:f8b0:4864:20::429] (port=38855 helo=mail-pf1-x429.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2OSh-0001Wt-TK for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:13:09 -0500 Received: by mail-pf1-x429.google.com with SMTP id b22so17520337pfb.5 for ; Tue, 28 Dec 2021 18:13:07 -0800 (PST) Received: from hsinchu16.internal.sifive.com (59-124-168-89.hinet-ip.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id k8sm15693975pjs.53.2021.12.28.18.13.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:13:06 -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 :mime-version:content-transfer-encoding; bh=lcxkfLDjFOWX3IL1YOje/OBFiAcSnNeG897+Wew0UM0=; b=Rdp8y/wVdvneOQLRKWG6pG2OnOxwWvwFQwNbVAdqXXfHC7ei2fY7F5KJTMbYvdzxTT jd0nkWu2vusDfL0l5Vnn4YWPMjsYxEdZxQj8a94T/Jd4cPEkj2bqTr+algvkLGaA6MWD iD2TAGLTS2dLej/9JrAK+PwVFIRlEU4BlDhh3H5kjT4aGn8h5vBjFzsqUrqRCZAET7mU QpSgDY+gfa2PGYpWozvStY2NPZ4FKCmXolYkrtCumvyCFyl0l8/RKCjr9ZAsI1PFwVj4 Q/hWw7Ibo95e1l0DMBQTEkWEicKMSFzZrXNE/hxgOPLn7gEenkMbEG4EUhsX0bfG2I27 Wrhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lcxkfLDjFOWX3IL1YOje/OBFiAcSnNeG897+Wew0UM0=; b=SooAC2zU3ouvI5vNTupKzNNaCgPGEdssbAvPOOcwIgGYbZKKJnxbUc/EYNtBGuhHkc SXnxHxVyr1gGVI30rTnRuwhcMQphHkI00CgCNob8qpPxVX0WRZKnIBXxPLD6P09ilVPT 9sQpB5WgzJ+T1zKc5T2vZV6M/2H2bMICBePmL2aWQLbp3+KbXwLAQWE9bAMFuiRH2ppD 6feXReKaEmLoHm1d5CGG9KHwLw3CSnh8lhCYW0mOTxj8lNGTJbJJy3aGqyQ9J9HZ6ZO9 na3bgwKQVL5sCywu8XJog6UU+iPs4ilKszzzvnWHxNG6HdJnVe+vDy7PuasdWH8KQ8G1 oaHg== X-Gm-Message-State: AOAM530PVn5bXMG7bPcIxFgZSPkrxkraLEJcibMu03/UhdxEx8k7NhaH UimXXG/0wDPmeveowcjFPdY2sr9isye7MGUk X-Google-Smtp-Source: ABdhPJyhMFw+9/+RE1c5aJX9wcocOBUUJTnwWCnGNffVPhh2gr1TW9QD0qY3gF2ITds7esB8C40wjQ== X-Received: by 2002:a65:680a:: with SMTP id l10mr21315621pgt.52.1640743986508; Tue, 28 Dec 2021 18:13:06 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 3/3] target/riscv: rvv-1.0: Call the correct RVF/RVD check funtion for narrowing fp/int type-convert insns Date: Wed, 29 Dec 2021 10:12:48 +0800 Message-Id: <20211229021250.29804-4-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229021250.29804-1-frank.chang@sifive.com> References: <20211229021250.29804-1-frank.chang@sifive.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::429 (failed) 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::429; envelope-from=frank.chang@sifive.com; helo=mail-pf1-x429.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-riscv@nongnu.org, Frank Chang , Bin Meng , Richard Henderson , Palmer Dabbelt , Alistair Francis , LIU Zhiwei Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1640744178346000001 Content-Type: text/plain; charset="utf-8" From: Frank Chang vfncvt.f.xu.w, vfncvt.f.x.w convert double-width integer to single-width floating-point. Therefore, should use require_rvf() to check whether RVF/RVD is enabled. vfncvt.f.f.w, vfncvt.rod.f.f.w convert double-width floating-point to single-width integer. Therefore, should use require_scale_rvf() to check whether RVF/RVD is enabled. --- target/riscv/insn_trans/trans_rvv.c.inc | 32 ++++++++++++++++++------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_tr= ans/trans_rvv.c.inc index f1b44ccad2..6c285c958b 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -2719,17 +2719,29 @@ GEN_OPFXV_WIDEN_TRANS(vfwcvt_f_x_v) static bool opfv_narrow_check(DisasContext *s, arg_rmr *a) { return require_rvv(s) && - require_rvf(s) && - (s->sew !=3D MO_64) && vext_check_isa_ill(s) && /* OPFV narrowing instructions ignore vs1 check */ vext_check_sd(s, a->rd, a->rs2, a->vm); } =20 -#define GEN_OPFV_NARROW_TRANS(NAME, HELPER, FRM) \ +static bool opfxv_narrow_check(DisasContext *s, arg_rmr *a) +{ + return opfv_narrow_check(s, a) && + require_rvf(s) && + (s->sew !=3D MO_64); +} + +static bool opffv_narrow_check(DisasContext *s, arg_rmr *a) +{ + return opfv_narrow_check(s, a) && + require_scale_rvf(s) && + (s->sew !=3D MO_8); +} + +#define GEN_OPFV_NARROW_TRANS(NAME, CHECK, HELPER, FRM) \ static bool trans_##NAME(DisasContext *s, arg_rmr *a) \ { \ - if (opfv_narrow_check(s, a)) { \ + if (CHECK(s, a)) { \ if (FRM !=3D RISCV_FRM_DYN) { \ gen_set_rm(s, RISCV_FRM_DYN); \ } \ @@ -2756,11 +2768,15 @@ static bool trans_##NAME(DisasContext *s, arg_rmr *= a) \ return false; \ } =20 -GEN_OPFV_NARROW_TRANS(vfncvt_f_xu_w, vfncvt_f_xu_w, RISCV_FRM_DYN) -GEN_OPFV_NARROW_TRANS(vfncvt_f_x_w, vfncvt_f_x_w, RISCV_FRM_DYN) -GEN_OPFV_NARROW_TRANS(vfncvt_f_f_w, vfncvt_f_f_w, RISCV_FRM_DYN) +GEN_OPFV_NARROW_TRANS(vfncvt_f_xu_w, opfxv_narrow_check, vfncvt_f_xu_w, + RISCV_FRM_DYN) +GEN_OPFV_NARROW_TRANS(vfncvt_f_x_w, opfxv_narrow_check, vfncvt_f_x_w, + RISCV_FRM_DYN) +GEN_OPFV_NARROW_TRANS(vfncvt_f_f_w, opffv_narrow_check, vfncvt_f_f_w, + RISCV_FRM_DYN) /* Reuse the helper function from vfncvt.f.f.w */ -GEN_OPFV_NARROW_TRANS(vfncvt_rod_f_f_w, vfncvt_f_f_w, RISCV_FRM_ROD) +GEN_OPFV_NARROW_TRANS(vfncvt_rod_f_f_w, opffv_narrow_check, vfncvt_f_f_w, + RISCV_FRM_ROD) =20 static bool opxfv_narrow_check(DisasContext *s, arg_rmr *a) { --=20 2.31.1