From patchwork Fri Dec 10 07:56:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 12668919 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CB35AC433EF for ; Fri, 10 Dec 2021 08:26:41 +0000 (UTC) Received: from localhost ([::1]:58292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mvbEm-0000fl-Sb for qemu-devel@archiver.kernel.org; Fri, 10 Dec 2021 03:26:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mvaof-0006Yp-4p for qemu-devel@nongnu.org; Fri, 10 Dec 2021 02:59:41 -0500 Received: from [2607:f8b0:4864:20::62c] (port=39510 helo=mail-pl1-x62c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mvaod-000711-4j for qemu-devel@nongnu.org; Fri, 10 Dec 2021 02:59:40 -0500 Received: by mail-pl1-x62c.google.com with SMTP id z6so5749104plk.6 for ; Thu, 09 Dec 2021 23:59:35 -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=W+JzAAlsoBgX4qQvoCuLRVR+t0J+aH83k6qSVZepZkg=; b=FJ6zXaaKhsfc4OZfELUVg+gHIuRCKSfk/xZ+wI9asIRPN/wBMqZRB1WKmLo8FjYX9N SZobOw1F1YjX4qS1F5pdw/LFP5WmhdZMEoEB1NC400+D2u5HC7CZHSls1CW5cpVc9VtI AnaRSGJdZNPuVquUXf5ydVtTRGVB/HNsskAsQCovjYrq7Ozo6djtSlv+c6GECDgqAU1j VIy5jw6KGaxQWDWEVp/zZZ/2/So/bw2sVkdb8iF0kBybFxbYdZIxBmASHT33KgXW5QS2 uu6VM5cO+BymtONmV+bVonOgvg8I9d+wOczzqTNSmqFL2wm1kr4K58HZNbsTKY+2AqfC /5Yg== 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=W+JzAAlsoBgX4qQvoCuLRVR+t0J+aH83k6qSVZepZkg=; b=3Iq0/lMNyO6VIWLKcE7PJbc9dKvC54OmvxwTSHfs16Mlq/6JDKGrn2r0AqGpNELjVa 0k9uyHxuWgqxucHNDK1BFpQaAw4fwG5hcGAvnCs8CXX2+/QGmtKdNxenCRsUk5FArKY7 xOigfksTaJ+zex9Rx9RFZkTByy6nsiMRrodo0IiUBCPTeF4wH3zxqDq3CeP/1InpASkO M9of0cHEMLiyJGtiXzulMDhBuvYWQoJAhY70uI5uNQVdXJbXOMWmTXMe7Y/zPS3lmh6V YbiyvjOBOqcf0ljP8AHkCgE+HJ9L5MCyFxBFa5PNlPZFsDg0PddK11JD/NkAc+8GjZ85 tDaQ== X-Gm-Message-State: AOAM530gvU0OBB6vG7ThzTUvdoX65NtSTrdHf2oV8kvVc+1o+9PTOipK qkSvUV673lnlaQaTVe/sDKV3GeOw+Ho25lLN X-Google-Smtp-Source: ABdhPJxa7mYOIYsSmtEkFKBGUqOdJTVPXRoaqTD0U6f7MRtch/L9bG7XTkYDzH3fYs4f45m4fL9ObA== X-Received: by 2002:a17:90b:4b01:: with SMTP id lx1mr22161563pjb.38.1639123174919; Thu, 09 Dec 2021 23:59:34 -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 f4sm2087955pfg.34.2021.12.09.23.59.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 23:59:34 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH v11 47/77] target/riscv: rvv-1.0: integer comparison instructions Date: Fri, 10 Dec 2021 15:56:33 +0800 Message-Id: <20211210075704.23951-48-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211210075704.23951-1-frank.chang@sifive.com> References: <20211210075704.23951-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62c (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=frank.chang@sifive.com; helo=mail-pl1-x62c.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 , Alistair Francis , Palmer Dabbelt , LIU Zhiwei Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang * Sign-extend vmselu.vi and vmsgtu.vi immediate values. * Remove "set tail elements to zeros" as tail elements can be unchanged for either VTA to have undisturbed or agnostic setting. Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/insn_trans/trans_rvv.c.inc | 4 ++-- target/riscv/vector_helper.c | 9 --------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index ed4554b6a1..804f423d5b 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -1809,9 +1809,9 @@ GEN_OPIVX_TRANS(vmsgt_vx, opivx_cmp_check) GEN_OPIVI_TRANS(vmseq_vi, IMM_SX, vmseq_vx, opivx_cmp_check) GEN_OPIVI_TRANS(vmsne_vi, IMM_SX, vmsne_vx, opivx_cmp_check) -GEN_OPIVI_TRANS(vmsleu_vi, IMM_ZX, vmsleu_vx, opivx_cmp_check) +GEN_OPIVI_TRANS(vmsleu_vi, IMM_SX, vmsleu_vx, opivx_cmp_check) GEN_OPIVI_TRANS(vmsle_vi, IMM_SX, vmsle_vx, opivx_cmp_check) -GEN_OPIVI_TRANS(vmsgtu_vi, IMM_ZX, vmsgtu_vx, opivx_cmp_check) +GEN_OPIVI_TRANS(vmsgtu_vi, IMM_SX, vmsgtu_vx, opivx_cmp_check) GEN_OPIVI_TRANS(vmsgt_vi, IMM_SX, vmsgt_vx, opivx_cmp_check) /* Vector Integer Min/Max Instructions */ diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index e885d4d353..277a5e4120 100644 --- a/target/riscv/vector_helper.c +++ b/target/riscv/vector_helper.c @@ -1190,8 +1190,6 @@ void HELPER(NAME)(void *vd, void *v0, void *vs1, void *vs2, \ { \ uint32_t vm = vext_vm(desc); \ uint32_t vl = env->vl; \ - uint32_t vlmax = vext_max_elems(desc, \ - ctzl(sizeof(ETYPE))); \ uint32_t i; \ \ for (i = 0; i < vl; i++) { \ @@ -1202,9 +1200,6 @@ void HELPER(NAME)(void *vd, void *v0, void *vs1, void *vs2, \ } \ vext_set_elem_mask(vd, i, DO_OP(s2, s1)); \ } \ - for (; i < vlmax; i++) { \ - vext_set_elem_mask(vd, i, 0); \ - } \ } GEN_VEXT_CMP_VV(vmseq_vv_b, uint8_t, H1, DO_MSEQ) @@ -1243,7 +1238,6 @@ void HELPER(NAME)(void *vd, void *v0, target_ulong s1, void *vs2, \ { \ uint32_t vm = vext_vm(desc); \ uint32_t vl = env->vl; \ - uint32_t vlmax = vext_max_elems(desc, ctzl(sizeof(ETYPE))); \ uint32_t i; \ \ for (i = 0; i < vl; i++) { \ @@ -1254,9 +1248,6 @@ void HELPER(NAME)(void *vd, void *v0, target_ulong s1, void *vs2, \ vext_set_elem_mask(vd, i, \ DO_OP(s2, (ETYPE)(target_long)s1)); \ } \ - for (; i < vlmax; i++) { \ - vext_set_elem_mask(vd, i, 0); \ - } \ } GEN_VEXT_CMP_VX(vmseq_vx_b, uint8_t, H1, DO_MSEQ)