From patchwork Wed Jul 22 09:15:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 11677905 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 39092138A for ; Wed, 22 Jul 2020 09:36:51 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C2F5C2065F for ; Wed, 22 Jul 2020 09:36:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="dSm/mOvq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2F5C2065F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jyBBB-0002rh-Nu for patchwork-qemu-devel@patchwork.kernel.org; Wed, 22 Jul 2020 05:36:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jyAv7-0002aq-4E for qemu-devel@nongnu.org; Wed, 22 Jul 2020 05:20:13 -0400 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:33165) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jyAv1-0005ex-8D for qemu-devel@nongnu.org; Wed, 22 Jul 2020 05:20:12 -0400 Received: by mail-pj1-x1034.google.com with SMTP id gc15so2629874pjb.0 for ; Wed, 22 Jul 2020 02:20:06 -0700 (PDT) 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=rhEqUtw7Wj0hdNldS8LtOT8Lo0+I96iSMbs34itJgVI=; b=dSm/mOvqzqIu8vQvP7NPyTZY5ElwCOqCPrIbewkWFwExlJQ0tSYDh2Xz6CcCJ8HbVX CSMuLg+VRuhSbWZDXrCyXtmsGwQq6M7IMry+T5mRBgqxEPKKz5nOyynBMCnrF98Hr7qN q5n24nB7+R9gB/qlH631exPPTu/bfxdNu9rjX4B2HNrBObFC6Ya6fE96fBEAnZoPmUsQ 8T9EiDSdE6HI73Tl5JlaMSWz4i2mZAPlJ2hFyXv9rOU3vNHZQzKrLQka90+O15AAE5J3 NUEkGhYAWeDTCna+l9nTYr7bAEGApRwixng58PY9R1n1VErsHpOcQGLkq77YE+rjPuQB bLSw== 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=rhEqUtw7Wj0hdNldS8LtOT8Lo0+I96iSMbs34itJgVI=; b=qfRiugR2xscfcBN3B22VBgJDrlTsuwR1J29qnq/vKINGQo1jpaHhOczSzd44sySwq4 QZsJOdUfEk+Yn9//va/77fPKr1vGNgvug045+3VwYY2maSSKmH/nBx2+ieNcxK7iWEhl BYou9nhp4K59k6olx4K36lsMI15gLPTrUgAB12xisGwIGSjd0VKTf3bTBBDdhP85XDkx TwJ2B2Wfd99ZjJtstsMuqs+0AnxCKVl2yeiaT01gkVJC+V9jyjobZ7a5skL5YseoZf4l 0RZhqYb/qcfFwustN0MW18M/m1VZeSHbXuZq1gU4a7J6pX22wykoya/Db7cLCdL7BNok DrvA== X-Gm-Message-State: AOAM533j2QvU8+gqx6WmZelr9VVzQu/0ti/aBFvEHCDoXJHa9zy0892e kB0NTZiWyiuEQQR+BvjY8eznA5zkOT0= X-Google-Smtp-Source: ABdhPJz7fBdIffb7/E2VJ6jare2qSP8X3J/WyJhM4DBS2jh7q7/JorwPwzSmI1m0ZDDG0sk4hN80aw== X-Received: by 2002:a17:90a:db0b:: with SMTP id g11mr9207257pjv.11.1595409605822; Wed, 22 Jul 2020 02:20:05 -0700 (PDT) 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 c125sm22301879pfa.119.2020.07.22.02.20.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2020 02:20:05 -0700 (PDT) From: frank.chang@sifive.com To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Subject: [RFC v2 34/76] target/riscv: rvv-0.9: set-X-first mask bit instructions Date: Wed, 22 Jul 2020 17:15:57 +0800 Message-Id: <20200722091641.8834-35-frank.chang@sifive.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200722091641.8834-1-frank.chang@sifive.com> References: <20200722091641.8834-1-frank.chang@sifive.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=frank.chang@sifive.com; helo=mail-pj1-x1034.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, URIBL_BLOCKED=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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Richard Henderson --- target/riscv/insn32.decode | 6 +++--- target/riscv/insn_trans/trans_rvv.inc.c | 5 ++++- target/riscv/vector_helper.c | 4 ---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.decode index b5b59fe6dd..37b2582981 100644 --- a/target/riscv/insn32.decode +++ b/target/riscv/insn32.decode @@ -575,9 +575,9 @@ vmornot_mm 011100 - ..... ..... 010 ..... 1010111 @r vmxnor_mm 011111 - ..... ..... 010 ..... 1010111 @r vpopc_m 010000 . ..... 10000 010 ..... 1010111 @r2_vm vfirst_m 010000 . ..... 10001 010 ..... 1010111 @r2_vm -vmsbf_m 010110 . ..... 00001 010 ..... 1010111 @r2_vm -vmsif_m 010110 . ..... 00011 010 ..... 1010111 @r2_vm -vmsof_m 010110 . ..... 00010 010 ..... 1010111 @r2_vm +vmsbf_m 010100 . ..... 00001 010 ..... 1010111 @r2_vm +vmsif_m 010100 . ..... 00011 010 ..... 1010111 @r2_vm +vmsof_m 010100 . ..... 00010 010 ..... 1010111 @r2_vm viota_m 010110 . ..... 10000 010 ..... 1010111 @r2_vm vid_v 010110 . 00000 10001 010 ..... 1010111 @r1_vm vext_x_v 001100 1 ..... ..... 010 ..... 1010111 @r diff --git a/target/riscv/insn_trans/trans_rvv.inc.c b/target/riscv/insn_trans/trans_rvv.inc.c index 3ef106ddeb..3834aca9ab 100644 --- a/target/riscv/insn_trans/trans_rvv.inc.c +++ b/target/riscv/insn_trans/trans_rvv.inc.c @@ -3006,7 +3006,10 @@ static bool trans_vfirst_m(DisasContext *s, arg_rmr *a) #define GEN_M_TRANS(NAME) \ static bool trans_##NAME(DisasContext *s, arg_rmr *a) \ { \ - if (vext_check_isa_ill(s)) { \ + if (require_rvv(s) && \ + vext_check_isa_ill(s) && \ + require_vm(a->vm, a->rd) && \ + (a->rd != a->rs2)) { \ uint32_t data = 0; \ gen_helper_gvec_3_ptr *fn = gen_helper_##NAME; \ TCGLabel *over = gen_new_label(); \ diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index 5bda274e70..aeaf3d1cfa 100644 --- a/target/riscv/vector_helper.c +++ b/target/riscv/vector_helper.c @@ -4701,7 +4701,6 @@ enum set_mask_type { static void vmsetm(void *vd, void *v0, void *vs2, CPURISCVState *env, uint32_t desc, enum set_mask_type type) { - uint32_t vlmax = env_archcpu(env)->cfg.vlen; uint32_t vm = vext_vm(desc); uint32_t vl = env->vl; int i; @@ -4731,9 +4730,6 @@ static void vmsetm(void *vd, void *v0, void *vs2, CPURISCVState *env, } } } - for (; i < vlmax; i++) { - vext_set_elem_mask(vd, i, 0); - } } void HELPER(vmsbf_m)(void *vd, void *v0, void *vs2, CPURISCVState *env,