From patchwork Thu Aug 6 10:46:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 1341609 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=lBCm8GXD; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4BMlzH1hTPz9sTM for ; Thu, 6 Aug 2020 21:06:03 +1000 (AEST) Received: from localhost ([::1]:46088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3dii-0007TU-Mg for incoming@patchwork.ozlabs.org; Thu, 06 Aug 2020 07:06:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41242) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3dSN-0003HY-1I for qemu-devel@nongnu.org; Thu, 06 Aug 2020 06:49:07 -0400 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]:34973) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k3dSI-0007wg-3R for qemu-devel@nongnu.org; Thu, 06 Aug 2020 06:49:05 -0400 Received: by mail-pj1-x1043.google.com with SMTP id t6so6295802pjr.0 for ; Thu, 06 Aug 2020 03:49:01 -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=Avnu70PdDYkSdW1ScaLQpwE2+GGkyRo7iSkv1USbDyg=; b=lBCm8GXD7Sw5LX0fF7w2YUT2MbEHxlK2FVzGGuOQ+C+cPHN9i4I0HRXj9d/8o5s9z3 BB/XpHaJ4J7Z+g/vq/DajMQUcBeOcTh8Im8vlu36l7qvEKIX0a6/aH9Y/KoP1Ya9LSr8 laia0Np/ZgupkJwlJbgff1e9c89qY3jYJfd9GkmpUhyoUSwmSv/nMdUrSFftHGDji0Lv jlTH8I+fuIXJq3YHF8Kv3Gu4lTAe2rwiZbPalDy7O0YamMwLFy0jWpJSyB1H4WgYKrd0 7kpcfMOiw70MCTnyzHLChuFnedm6SZvC42r4wlbLf3plKsTjJeq2Eyp2C+P9F9Zjv67a s8Qw== 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=Avnu70PdDYkSdW1ScaLQpwE2+GGkyRo7iSkv1USbDyg=; b=MnGusJ1NN81J80CMIlN6cye8ymzchi6K43erJR78PXNBlLpFy2ekfptxOrXNE4x9gS 8Hv9OLyL49CxKtCAlfy2dyUSXGI10mHVQnCy+ikMswbNc3pOsgrf3gYMnCcR72Nt3Lmg S57yTQa4oF7oKREIVH9eA8/7FB5A4wffaTposGdWf3YtQWKaW+16WnPTw5Z9Ezo2MONc sj4y9oKcbQLKBUJf9caunwRS3e3lD4A3KYkfNOzrpPcQRYKwka2qUILnNaxaNLG7Dd1+ 8AG3/4bNmHo50v1c0Q0+5T5RAIewZHLevmjM2yKE+y82JWOtPlREE+kT/01MLp7ksF7r hmMQ== X-Gm-Message-State: AOAM530q4VXlmv/bgJpkKI7E7hnuh/3bymX5XY8j3FzC5YyL0A15IvJp eR5pe6h/AO5e/mAh3eWny0jo4FSrAR0= X-Google-Smtp-Source: ABdhPJwQ8gTCYNz+1fpDY958t5Yc/yAemBC/CKw5cGoMdpxOluiIWYIPZHYlDRMBmd0BYJNVMlyf0g== X-Received: by 2002:a17:90a:4701:: with SMTP id h1mr7645844pjg.93.1596710940219; Thu, 06 Aug 2020 03:49:00 -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 f18sm6567309pgv.84.2020.08.06.03.48.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2020 03:48:59 -0700 (PDT) From: frank.chang@sifive.com To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Subject: [RFC v3 40/71] target/riscv: rvv-1.0: whole register move instructions Date: Thu, 6 Aug 2020 18:46:37 +0800 Message-Id: <20200806104709.13235-41-frank.chang@sifive.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200806104709.13235-1-frank.chang@sifive.com> References: <20200806104709.13235-1-frank.chang@sifive.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::1043; envelope-from=frank.chang@sifive.com; helo=mail-pj1-x1043.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=ham 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: Frank Chang , Alistair Francis , Palmer Dabbelt , Sagar Karandikar , Bastian Koppelmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang Add the following instructions: * vmv1r.v * vmv2r.v * vmv4r.v * vmv8r.v Signed-off-by: Frank Chang --- target/riscv/insn32.decode | 4 ++++ target/riscv/insn_trans/trans_rvv.inc.c | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/target/riscv/insn32.decode b/target/riscv/insn32.decode index 97fce34fcd8..65ff1688c25 100644 --- a/target/riscv/insn32.decode +++ b/target/riscv/insn32.decode @@ -614,6 +614,10 @@ vrgatherei16_vv 001110 . ..... ..... 000 ..... 1010111 @r_vm vrgather_vx 001100 . ..... ..... 100 ..... 1010111 @r_vm vrgather_vi 001100 . ..... ..... 011 ..... 1010111 @r_vm vcompress_vm 010111 - ..... ..... 010 ..... 1010111 @r +vmv1r_v 100111 1 ..... 00000 011 ..... 1010111 @r2rd +vmv2r_v 100111 1 ..... 00001 011 ..... 1010111 @r2rd +vmv4r_v 100111 1 ..... 00011 011 ..... 1010111 @r2rd +vmv8r_v 100111 1 ..... 00111 011 ..... 1010111 @r2rd vsetvli 0 ........... ..... 111 ..... 1010111 @r2_zimm vsetvl 1000000 ..... ..... 111 ..... 1010111 @r diff --git a/target/riscv/insn_trans/trans_rvv.inc.c b/target/riscv/insn_trans/trans_rvv.inc.c index f5d72d68a79..c3fe5d0eee7 100644 --- a/target/riscv/insn_trans/trans_rvv.inc.c +++ b/target/riscv/insn_trans/trans_rvv.inc.c @@ -3466,3 +3466,28 @@ static bool trans_vcompress_vm(DisasContext *s, arg_r *a) } return false; } + +/* + * Whole Vector Register Move Instructions ignore vtype and vl setting. + * Thus, we don't need to check vill bit. (Section 17.6) + */ +#define GEN_VMV_WHOLE_TRANS(NAME, LEN) \ +static bool trans_##NAME(DisasContext *s, arg_##NAME * a) \ +{ \ + if (require_rvv(s) && \ + QEMU_IS_ALIGNED(a->rd, LEN) && \ + QEMU_IS_ALIGNED(a->rs2, LEN)) { \ + /* EEW = 8 */ \ + tcg_gen_gvec_mov(MO_8, vreg_ofs(s, a->rd), \ + vreg_ofs(s, a->rs2), \ + s->vlen / 8 * LEN, s->vlen / 8 * LEN); \ + mark_vs_dirty(s); \ + return true; \ + } \ + return false; \ +} + +GEN_VMV_WHOLE_TRANS(vmv1r_v, 1) +GEN_VMV_WHOLE_TRANS(vmv2r_v, 2) +GEN_VMV_WHOLE_TRANS(vmv4r_v, 4) +GEN_VMV_WHOLE_TRANS(vmv8r_v, 8)