From patchwork Wed Dec 29 02:33:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 12700702 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 634FBC433EF for ; Wed, 29 Dec 2021 02:35:09 +0000 (UTC) Received: from localhost ([::1]:58350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2Oo0-0005J2-89 for qemu-devel@archiver.kernel.org; Tue, 28 Dec 2021 21:35:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2Omt-0002k0-W9 for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:00 -0500 Received: from [2607:f8b0:4864:20::102e] (port=33284 helo=mail-pj1-x102e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2Omr-0004Yc-HE for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:33:58 -0500 Received: by mail-pj1-x102e.google.com with SMTP id x1-20020a17090a2b0100b001b103e48cfaso13832526pjc.0 for ; Tue, 28 Dec 2021 18:33:57 -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=LAvAPksd2XR1GADpEnZcWAIfGyrXexIB9LcFPdrkoG0=; b=lvR67NluFEY1WjoQEoTYw388DLSFFkKexLkP7QChHuZLoPdGaIc5igcL4P1TOlH3Qt XrNCe/zLeaZOWxbDniZ5dGc+06+/PpzTRI27kI+37iqxKPO/zZ9XoczUbe2qrxzM/M58 /izhZb3Cvhwa9KQUViv8yAgJZfuaLpvxenC2CwnapRqExJVgUsFNKZwsLsm0JBrOjJEF hqYFTONgt1P6uz4P92bl6CRj/BWPzNBJ8GXigyupse2plkbxGrifxIHK3cWJ4oKkC2xI iPlJhPQxbsh5fdnKNNnghk8uGyHgLZ7vYD1LYpcVry+PkFcuqXBWn1hFPlB/dz678suv FI/Q== 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=LAvAPksd2XR1GADpEnZcWAIfGyrXexIB9LcFPdrkoG0=; b=6pEfOwwwPkgpMZFVem6jenR9gR6fjOFhhIRwfUD5qFthTWseu59Ypnf+SrC16o7Qb+ pkAVvS4+P31B7MIhtGx1cc6FK9oovalVvLpGquXMCt8GmK1RtqYqT3pXerJtsNrNgQXt K1RDGH+62fuDEduFNcahiQ92ajjahuNW1pBpdxkYMOJKj+eDFWSmGH3d9aGcJBcvUspJ FWYYk1njMJjw2mxofQVEy5zUtIDt2AVt9QJhiPwPJxidPR/+atGhsXmUWoV0WlUnL+Oj PPBX7zpAj2ksAYhmWySCuyYZ7/6TksomfV3dr1AmvsfIUPUu6aHOm3LZqULLfgJiCo1K mDZw== X-Gm-Message-State: AOAM531PTXwhrwc00Wu+gpFMH5QehDj4GQvjctxk5l1iUJFZbKBk5KA9 VdNh5keTHsUnqwd1FbgjuKLTSAPefsNjNgOv X-Google-Smtp-Source: ABdhPJz3fTTuohB4/HETLk0yYBAw0de+tJbMis0cajp+j1f5Xm014NMo2uLUUniVVvflovASg79gnw== X-Received: by 2002:a17:90a:c210:: with SMTP id e16mr9271868pjt.90.1640745236157; Tue, 28 Dec 2021 18:33:56 -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 m3sm22613635pjz.10.2021.12.28.18.33.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:33:55 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 01/17] target/riscv: rvv-1.0: Add Zve64f extension into RISC-V Date: Wed, 29 Dec 2021 10:33:28 +0800 Message-Id: <20211229023348.12606-2-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229023348.12606-1-frank.chang@sifive.com> References: <20211229023348.12606-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102e (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=frank.chang@sifive.com; helo=mail-pj1-x102e.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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: Frank Chang , Palmer Dabbelt , Alistair Francis , Bin Meng , qemu-riscv@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 4 ++++ target/riscv/cpu.h | 1 + target/riscv/cpu_helper.c | 5 ++++- target/riscv/csr.c | 6 +++++- target/riscv/translate.c | 2 ++ 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 6ef3314bce..01239620ca 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -562,6 +562,10 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp) } set_vext_version(env, vext_version); } + if (cpu->cfg.ext_zve64f && !cpu->cfg.ext_f) { + error_setg(errp, "Zve64f extension depends upon RVF."); + return; + } if (cpu->cfg.ext_j) { ext |= RVJ; } diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index dc10f27093..d7b2db2b2f 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -317,6 +317,7 @@ struct RISCVCPU { bool ext_icsr; bool ext_zfh; bool ext_zfhmin; + bool ext_zve64f; char *priv_spec; char *user_spec; diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index 10f3baba53..52d93a41fd 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -69,12 +69,15 @@ static RISCVMXL cpu_get_xl(CPURISCVState *env) void cpu_get_tb_cpu_state(CPURISCVState *env, target_ulong *pc, target_ulong *cs_base, uint32_t *pflags) { + CPUState *cs = env_cpu(env); + RISCVCPU *cpu = RISCV_CPU(cs); + uint32_t flags = 0; *pc = env->pc; *cs_base = 0; - if (riscv_has_ext(env, RVV)) { + if (riscv_has_ext(env, RVV) || cpu->cfg.ext_zve64f) { /* * If env->vl equals to VLMAX, we can use generic vector operation * expanders (GVEC) to accerlate the vector operations. diff --git a/target/riscv/csr.c b/target/riscv/csr.c index 146447eac5..340b9661a8 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -47,7 +47,11 @@ static RISCVException fs(CPURISCVState *env, int csrno) static RISCVException vs(CPURISCVState *env, int csrno) { - if (env->misa_ext & RVV) { + CPUState *cs = env_cpu(env); + RISCVCPU *cpu = RISCV_CPU(cs); + + if (env->misa_ext & RVV || + cpu->cfg.ext_zve64f) { #if !defined(CONFIG_USER_ONLY) if (!env->debugger && !riscv_cpu_vector_enabled(env)) { return RISCV_EXCP_ILLEGAL_INST; diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 5df6c0d800..8c3b0168b7 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -78,6 +78,7 @@ typedef struct DisasContext { bool ext_ifencei; bool ext_zfh; bool ext_zfhmin; + bool ext_zve64f; bool hlsx; /* vector extension */ bool vill; @@ -705,6 +706,7 @@ static void riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) ctx->ext_ifencei = cpu->cfg.ext_ifencei; ctx->ext_zfh = cpu->cfg.ext_zfh; ctx->ext_zfhmin = cpu->cfg.ext_zfhmin; + ctx->ext_zve64f = cpu->cfg.ext_zve64f; ctx->vlen = cpu->cfg.vlen; ctx->elen = cpu->cfg.elen; ctx->mstatus_hs_fs = FIELD_EX32(tb_flags, TB_FLAGS, MSTATUS_HS_FS); From patchwork Wed Dec 29 02:33:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 12700707 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 00437C433EF for ; Wed, 29 Dec 2021 02:39:19 +0000 (UTC) Received: from localhost ([::1]:39054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2Os2-0002x4-SZ for qemu-devel@archiver.kernel.org; Tue, 28 Dec 2021 21:39:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2Omw-0002me-LS for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:03 -0500 Received: from [2607:f8b0:4864:20::1030] (port=53115 helo=mail-pj1-x1030.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2Omv-0004ZF-3B for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:02 -0500 Received: by mail-pj1-x1030.google.com with SMTP id co15so17335709pjb.2 for ; Tue, 28 Dec 2021 18:34:00 -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=qaVaNth+UNNyKKt08kGpoylZGoBah63Av7+61N/IayU=; b=lWVwlYEw5HRZQYlv1817KmX7iCT7vVxJwPvTPedQuROCmBE1QeP5lj7Nn7TrfiNm1/ fvqldqLgRapX4e5GSaS+SoDkVh/RJhzI2Nr8ysPNvgVgSSJvV4+Eh6saCBqSMQ1ICer3 LuGT5MW6JNLIwqRWFMsuGaQjwbKoK9/PvUubticj6nkrhveNhu/q/BCRbDHFu1f96fWr oFDEGz1l0qfgaL5JRKPpVdzrCLyILI4jUrZu8kh1d55Ezwc0uPgFDmEh7olihEKi96zM /CJBkDR4wfBmdVP8ChnMfnvrfMLQsojpxXIAeCPJIbKvhr4f5Co9BXOKQCsb0UUWc1Dt vgCQ== 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=qaVaNth+UNNyKKt08kGpoylZGoBah63Av7+61N/IayU=; b=gvn+TGnA+OMyIAGCQinaWQ6SngclD/V5vsvrT3AR0ljJ8825S2mBEgQA3urlV7TKvx VU8Vmf/q7uPo70sFCXkjmwDCcrn0EpVx1wBJW8bhfCGgE4fcD9oLnL01G6Il3E/fJ449 XtQysC0cszdq0xAZZdlxRzxyc4qVcHHJ28BA0CU4rOsLFyzsNVHax1uIdifavJABIlD4 sT/1uKsxTw5FoOXDapl4epdBi6b9/ru6SC+OvL5RnwLqlgURxlJoefIgXPHuzxcMajH8 xv+RKlYhGugEYo951k1Hu2sjVfimwfAPV/NtRCGgZ/1WoLq2xt8ZBFfsfxfL3JXS30ve h5Vg== X-Gm-Message-State: AOAM530x3L10OId2/9TllXCFA25fHrn/2+MnJNFS4o4EvDyAhkAFXpAO seBnK1zqxJZSayTu/o6KmrITIC/F6EoQRORa X-Google-Smtp-Source: ABdhPJwwm1PapsekaqyoXS8fFgj8SP9TK1fV/Qc8+xJEc8SvckTzwu61R7US/Sp4YQf+bstQ9CH6ZA== X-Received: by 2002:a17:902:c443:b0:148:f689:d924 with SMTP id m3-20020a170902c44300b00148f689d924mr24491062plm.78.1640745239597; Tue, 28 Dec 2021 18:33:59 -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 m3sm22613635pjz.10.2021.12.28.18.33.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:33:59 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 02/17] target/riscv: rvv-1.0: Add Zve64f support for configuration insns Date: Wed, 29 Dec 2021 10:33:29 +0800 Message-Id: <20211229023348.12606-3-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229023348.12606-1-frank.chang@sifive.com> References: <20211229023348.12606-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1030 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=frank.chang@sifive.com; helo=mail-pj1-x1030.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang All Zve* extensions support the vector configuration instructions. Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index 6c285c958b..5b47729a21 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -129,7 +129,8 @@ static bool do_vsetvl(DisasContext *s, int rd, int rs1, TCGv s2) { TCGv s1, dst; - if (!require_rvv(s) || !has_ext(s, RVV)) { + if (!require_rvv(s) || + !(has_ext(s, RVV) || s->ext_zve64f)) { return false; } @@ -164,7 +165,8 @@ static bool do_vsetivli(DisasContext *s, int rd, TCGv s1, TCGv s2) { TCGv dst; - if (!require_rvv(s) || !has_ext(s, RVV)) { + if (!require_rvv(s) || + !(has_ext(s, RVV) || s->ext_zve64f)) { return false; } From patchwork Wed Dec 29 02:33:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 12700703 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 AC583C433F5 for ; Wed, 29 Dec 2021 02:35:42 +0000 (UTC) Received: from localhost ([::1]:58884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2OoX-0005f0-KN for qemu-devel@archiver.kernel.org; Tue, 28 Dec 2021 21:35:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2On1-0002tm-FA for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:07 -0500 Received: from [2607:f8b0:4864:20::1035] (port=53120 helo=mail-pj1-x1035.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2Omz-0004aq-PB for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:07 -0500 Received: by mail-pj1-x1035.google.com with SMTP id co15so17335806pjb.2 for ; Tue, 28 Dec 2021 18:34:04 -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=jEfPTH8U9fZZujs2PcXy4rz3l/B254JUiN9Bojizgh0=; b=d1I75DLAHmy3FIOdaOWLACGCvVWGuFL8kBOl5p5RqcA0lpJiRlKAcQprf9RbN/uKBl Ew++UHuxpsqwrShSND26+XE+TCJxPvUKnv/M3YHBx81dPe9B1iMoit1QO1XbDqVfGpKt kkGQ4kaoC7Ki/qG+2wCerRk38uaNUxCOqN/TmeAqYtP6a9piT/5xnsr3aSV9hcaTCYCl K6PC9FmU2wy7m54zXKzeDbt2hnoal4F3VZlPVfUvq7hdR4YuSUy/6FpI2BAOEMpFZRPZ U/EQgfj1XB9MUpRYRnaFw590TODd188FI1zl/ZZzlpdH65/jBM729MCct0N5KF05zAS3 Xedw== 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=jEfPTH8U9fZZujs2PcXy4rz3l/B254JUiN9Bojizgh0=; b=BZKbtwSNYpmpeQlYmRZ+X05DXDWitzJjeR6Yr28fHGfqQB/pv/29iL4DPEnu/dESQa oYycSsc+1HG/XG6eELOr4naCRKdQbIUKBjR+9kmYBisog76L/yUCGTzSgcIWd6fOt6cq 3pedYblRPecv9WhJK42rd7eK7VEH08Hz5VpNu6HUSsNpvKGTU4eUywhaB2LkdZqBamXx HL6pOz/5IZvchvb7yCdI9zZ5msNO+lEJuDT2qj/7fcKIwQAhfNBRT0JlrdzCY1qc0aZr w8YGAWsQLkSh/TNQPX3Jb2nB7XYWNW5F21BItRMJ+vDhBkVwcrOddFlQzUTCPLE9Ll20 z40A== X-Gm-Message-State: AOAM532X88z5V6umHB3m4KiYDxUrE3em/z7DuXgZ5fTBOyh2bXxhqqVB r/3CiLsCY0R/jz5/jYOd4fQqVYKzi83hSi+B X-Google-Smtp-Source: ABdhPJwxk02zcON4caB+HnpOiluOMcPIWdUJj6lZiTylyX2J5/GtjqDRGG4RHUTNnfGrFU1iipZ2lg== X-Received: by 2002:a17:902:8b89:b0:149:9c7d:2fb6 with SMTP id ay9-20020a1709028b8900b001499c7d2fb6mr1381362plb.68.1640745243061; Tue, 28 Dec 2021 18:34:03 -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 m3sm22613635pjz.10.2021.12.28.18.34.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:34:02 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 03/17] target/riscv: rvv-1.0: Add Zve64f support for load and store insns Date: Wed, 29 Dec 2021 10:33:30 +0800 Message-Id: <20211229023348.12606-4-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229023348.12606-1-frank.chang@sifive.com> References: <20211229023348.12606-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1035 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=frank.chang@sifive.com; helo=mail-pj1-x1035.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang All Zve* extensions support all vector load and store instructions, except Zve64* extensions do not support EEW=64 for index values when XLEN=32. Signed-off-by: Frank Chang --- target/riscv/insn_trans/trans_rvv.c.inc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index 5b47729a21..820a3387db 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -263,10 +263,19 @@ static bool vext_check_st_index(DisasContext *s, int vd, int vs2, int nf, uint8_t eew) { int8_t emul = eew - s->sew + s->lmul; - return (emul >= -3 && emul <= 3) && - require_align(vs2, emul) && - require_align(vd, s->lmul) && - require_nf(vd, nf, s->lmul); + bool ret = (emul >= -3 && emul <= 3) && + require_align(vs2, emul) && + require_align(vd, s->lmul) && + require_nf(vd, nf, s->lmul); +#ifdef TARGET_RISCV32 + /* + * All Zve* extensions support all vector load and store instructions, + * except Zve64* extensions do not support EEW=64 for index values + * when XLEN=32. (Section 18.2) + */ + ret &= (!has_ext(s, RVV) && s->ext_zve64f ? eew != MO_64 : true); +#endif + return ret; } /* From patchwork Wed Dec 29 02:33:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 12700708 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 9AC2BC433F5 for ; Wed, 29 Dec 2021 02:39:26 +0000 (UTC) Received: from localhost ([::1]:39308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2Os9-00037g-Li for qemu-devel@archiver.kernel.org; Tue, 28 Dec 2021 21:39:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2On3-0002zL-Eo for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:09 -0500 Received: from [2607:f8b0:4864:20::636] (port=44788 helo=mail-pl1-x636.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2On1-0004bD-Pp for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:09 -0500 Received: by mail-pl1-x636.google.com with SMTP id h1so11610804pls.11 for ; Tue, 28 Dec 2021 18:34:07 -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=5BjYN/Qmz8BZog3r8YldBNpOG88WmJHhnqNdxU3htQ0=; b=BDP7yl4xphrcJGao37+LWZsGa1Z/zq+du+snSK61nLcUid5UGOuXDRSk+HRLJuCyow qnaCXlAfHa6VvOHu9EfCeoIp0OLO3PLona6Tw1nvYX3UC60FMKGnINTBTz6LR6Qv9IHm FNCgI+oFv0DFXIbG8acIhxPrRzFVZzu3jShHPivN5IpBw2jitTNrtszXxJuuqejHg8TI BE+qM8Nrv4sttOi6Y7aazM94cI9HJjKa3z9kHYHtpe9MLt93t1KUwJy5F+bbulHrOJKf cRaJ8oJPKBQ5xtIzDU9i2i8zg1wNcjs+njBRC+HBxFnBLeDHtgR9P4DpLumNC/zBYtnb Ic4A== 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=5BjYN/Qmz8BZog3r8YldBNpOG88WmJHhnqNdxU3htQ0=; b=NLpU0PXVhtanJkZjB0asX3yuza6qXtQMorSbkT5tUBWmoxO0cEw19vWvv9gkPh9EaK eAMCrzeeCnWTmbuIkTNTe7ZMTJOzPe/y1+alDP37prY2DZEoFjC42EFqw/kHMejAPJTj kprKiYBv19zX/TrbTsVkrvF4M5kALWT/khEu+bBmW1PlFGe7ZxusP/hb7FZ7RYuY/29f RpgkZElPM3YIZnKczk/9ZJ0nF3do+5NkczvuZ4Ei1QzkvNQ/Uw/gh2IwIfq8Mtgz7Stn jQ89xuea7TU+BKRz4TUbMPaiOgmbP4bvZimG8KW/pfj5hf/Qhdw0dOgladKAelkpWiIi W6JQ== X-Gm-Message-State: AOAM532bA2U11J7SFwTr9+ArpVSbWeMd4UYAHnJ977iqKa9PBbkTFUe+ dxVAMw4sgPLeNo6ZaA+196NfzvLVlLlH7J74 X-Google-Smtp-Source: ABdhPJywqCFp0hqFW16bCXf51g/LVJgveRAcNZ0DkzIW9gzaNPgGQuiwdi+qQGq+xpAN1mWHCB5rdg== X-Received: by 2002:a17:90a:207:: with SMTP id c7mr30077491pjc.58.1640745246345; Tue, 28 Dec 2021 18:34:06 -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 m3sm22613635pjz.10.2021.12.28.18.34.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:34:05 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 04/17] target/riscv: rvv-1.0: Add Zve64f support for vmulh variant insns Date: Wed, 29 Dec 2021 10:33:31 +0800 Message-Id: <20211229023348.12606-5-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229023348.12606-1-frank.chang@sifive.com> References: <20211229023348.12606-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::636 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=frank.chang@sifive.com; helo=mail-pl1-x636.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang All Zve* extensions support all vector integer instructions, except that the vmulh integer multiply variants that return the high word of the product (vmulh.vv, vmulh.vx, vmulhu.vv, vmulhu.vx, vmulhsu.vv, vmulhsu.vx) are not included for EEW=64 in Zve64*. Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 39 +++++++++++++++++++++---- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index 820a3387db..658cfbe10e 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -1906,14 +1906,41 @@ GEN_OPIVX_TRANS(vmaxu_vx, opivx_check) GEN_OPIVX_TRANS(vmax_vx, opivx_check) /* Vector Single-Width Integer Multiply Instructions */ + +static bool vmulh_vv_check(DisasContext *s, arg_rmrr *a) +{ + /* + * All Zve* extensions support all vector integer instructions, + * except that the vmulh integer multiply variants + * that return the high word of the product + * (vmulh.vv, vmulh.vx, vmulhu.vv, vmulhu.vx, vmulhsu.vv, vmulhsu.vx) + * are not included for EEW=64 in Zve64*. (Section 18.2) + */ + return opivv_check(s, a) && + (!has_ext(s, RVV) && s->ext_zve64f ? s->sew != MO_64 : true); +} + +static bool vmulh_vx_check(DisasContext *s, arg_rmrr *a) +{ + /* + * All Zve* extensions support all vector integer instructions, + * except that the vmulh integer multiply variants + * that return the high word of the product + * (vmulh.vv, vmulh.vx, vmulhu.vv, vmulhu.vx, vmulhsu.vv, vmulhsu.vx) + * are not included for EEW=64 in Zve64*. (Section 18.2) + */ + return opivx_check(s, a) && + (!has_ext(s, RVV) && s->ext_zve64f ? s->sew != MO_64 : true); +} + GEN_OPIVV_GVEC_TRANS(vmul_vv, mul) -GEN_OPIVV_TRANS(vmulh_vv, opivv_check) -GEN_OPIVV_TRANS(vmulhu_vv, opivv_check) -GEN_OPIVV_TRANS(vmulhsu_vv, opivv_check) +GEN_OPIVV_TRANS(vmulh_vv, vmulh_vv_check) +GEN_OPIVV_TRANS(vmulhu_vv, vmulh_vv_check) +GEN_OPIVV_TRANS(vmulhsu_vv, vmulh_vv_check) GEN_OPIVX_GVEC_TRANS(vmul_vx, muls) -GEN_OPIVX_TRANS(vmulh_vx, opivx_check) -GEN_OPIVX_TRANS(vmulhu_vx, opivx_check) -GEN_OPIVX_TRANS(vmulhsu_vx, opivx_check) +GEN_OPIVX_TRANS(vmulh_vx, vmulh_vx_check) +GEN_OPIVX_TRANS(vmulhu_vx, vmulh_vx_check) +GEN_OPIVX_TRANS(vmulhsu_vx, vmulh_vx_check) /* Vector Integer Divide Instructions */ GEN_OPIVV_TRANS(vdivu_vv, opivv_check) From patchwork Wed Dec 29 02:33:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 12700709 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 09F0EC433F5 for ; Wed, 29 Dec 2021 02:39:51 +0000 (UTC) Received: from localhost ([::1]:39916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2OsY-0003XG-2a for qemu-devel@archiver.kernel.org; Tue, 28 Dec 2021 21:39:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55592) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2On6-0003CZ-NL for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:12 -0500 Received: from [2607:f8b0:4864:20::1029] (port=53109 helo=mail-pj1-x1029.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2On5-0004bz-2C for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:12 -0500 Received: by mail-pj1-x1029.google.com with SMTP id co15so17335963pjb.2 for ; Tue, 28 Dec 2021 18:34:10 -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=bsCcWlWnK/y8bx98uJLBXekQNGdwFDxga/0IN3bxlvI=; b=OJUf/QRwdYLVTuUFPPN1OxWtjelrrZhgetMyqHcoFjXUcHwfbbrDBv0JYcq/6JrC2e Ihxv1T8oFR1t4Vra8KTuOKb/fW2oDNsy4mHeW69TpWo/YI4XTUrd8aqwPzbP5evoP5W9 7BU1g1eZu5AiEz+qFCtkHDvnQeV65kGF+dggLbc/nP55AV6FUl8heUdSSiv9S439f1fb U3O5vLV9IzrhHZQ/JSawKsGVMNGNGD1VpUvdA1/r6SIyC0EeUM0flMVkS8JAa4BQcUsl bZQ5ykRQqPS0/PGY0rjOVXZoo3d82H4N3wFGpr5Vwc0NAERnE1yfrXWAmnIAdhPmQks6 LWow== 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=bsCcWlWnK/y8bx98uJLBXekQNGdwFDxga/0IN3bxlvI=; b=tnm7IjplI0NOOh79VQMFLFiJVz2pBNFoEUzXKF6UAP6u3GBnIHoXYRW9kDwCx4M+Ih i5/XsNUqsPdpdR65RljAUxDBEzVdWG9O1KOwlQ4IVmVlngf79SUBqpo9h16mwXqUv8Fy xYHYCKzkmTkqhkNthenHZqq409+T4MHzHJpY/PBadfrtabV8JQ3wxxOF8KJ5l7naT0jk tDJpfM/LvqPmDBV+K2SA5MlQrftNvfVGZTsthNVn94raFWoEi1YP0/AiBGfMEV9IPjeD QLr1WY7xuytuFq3fUSfUseAD4GmIq4x4xZEasberi+Dodf3NSN1xq39nGr6LgfUTvSrm p9lg== X-Gm-Message-State: AOAM533x/wTQ5iZNshiuVhy+XfBC6Gn8DZguj8qvJrNCcdqlboB6awLT m8twQQ9suy4XXp4xjFDexFPA0YkW55FAJpdC X-Google-Smtp-Source: ABdhPJwqhsZsLbaICCFKRZCWbUW6msj4VNPzggoqfsekmdAidpDjd7XWTlM3WUf9bI+yzV4RNdPptw== X-Received: by 2002:a17:90b:20b:: with SMTP id fy11mr29909676pjb.238.1640745249595; Tue, 28 Dec 2021 18:34:09 -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 m3sm22613635pjz.10.2021.12.28.18.34.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:34:09 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 05/17] target/riscv: rvv-1.0: Add Zve64f support for vsmul.vv and vsmul.vx insns Date: Wed, 29 Dec 2021 10:33:32 +0800 Message-Id: <20211229023348.12606-6-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229023348.12606-1-frank.chang@sifive.com> References: <20211229023348.12606-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1029 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=frank.chang@sifive.com; helo=mail-pj1-x1029.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang All Zve* extensions support all vector fixed-point arithmetic instructions, except that vsmul.vv and vsmul.vx are not supported for EEW=64 in Zve64*. Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 27 +++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index 658cfbe10e..a1e403fe86 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -2121,8 +2121,31 @@ GEN_OPIVX_TRANS(vasub_vx, opivx_check) GEN_OPIVX_TRANS(vasubu_vx, opivx_check) /* Vector Single-Width Fractional Multiply with Rounding and Saturation */ -GEN_OPIVV_TRANS(vsmul_vv, opivv_check) -GEN_OPIVX_TRANS(vsmul_vx, opivx_check) + +static bool vsmul_vv_check(DisasContext *s, arg_rmrr *a) +{ + /* + * All Zve* extensions support all vector fixed-point arithmetic + * instructions, except that vsmul.vv and vsmul.vx are not supported + * for EEW=64 in Zve64*. (Section 18.2) + */ + return opivv_check(s, a) && + (!has_ext(s, RVV) && s->ext_zve64f ? s->sew != MO_64 : true); +} + +static bool vsmul_vx_check(DisasContext *s, arg_rmrr *a) +{ + /* + * All Zve* extensions support all vector fixed-point arithmetic + * instructions, except that vsmul.vv and vsmul.vx are not supported + * for EEW=64 in Zve64*. (Section 18.2) + */ + return opivx_check(s, a) && + (!has_ext(s, RVV) && s->ext_zve64f ? s->sew != MO_64 : true); +} + +GEN_OPIVV_TRANS(vsmul_vv, vsmul_vv_check) +GEN_OPIVX_TRANS(vsmul_vx, vsmul_vx_check) /* Vector Single-Width Scaling Shift Instructions */ GEN_OPIVV_TRANS(vssrl_vv, opivv_check) From patchwork Wed Dec 29 02:33: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: 12700714 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 EFF6AC433F5 for ; Wed, 29 Dec 2021 02:43:40 +0000 (UTC) Received: from localhost ([::1]:50334 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2OwG-00028H-2g for qemu-devel@archiver.kernel.org; Tue, 28 Dec 2021 21:43:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2OnA-0003PB-3i for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:16 -0500 Received: from [2607:f8b0:4864:20::633] (port=38731 helo=mail-pl1-x633.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2On8-0004ch-9a for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:15 -0500 Received: by mail-pl1-x633.google.com with SMTP id c3so1619920pls.5 for ; Tue, 28 Dec 2021 18:34:13 -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=TqjBR2rdF5LZaas3NxvRjCd3bRaUxrMW/OmvY9gd7hc=; b=QeIsN0eZuhkwirT9k+nvBabgcKZ903fJyfJ3xluLawua1TzNP0QPVm/jQ8BR2l2xii qwM0Bb5ocYmARu9kwZ8mITgNtcr+tA+NMBCOyJqDw56c/plLvH+IFpE9rw214zmVaX0J mK6icVBRdYORcbztg0gbFwjR/rpyICajgMMpiOke37SOHiql9sYENLpJat90bKAuA3BV +npenpBc/n1WNu0svF5fr03sGZlHnd6lwM9JJWQP2H93f1jMRj/+0goS2D8yrtNDpEGj F3tHLSt9vSJfIuDddfOEob/vuGZwcTxW3OfVzLn0AKC2sCtJrvNOmnGBq/uB79OhNJeH OSuA== 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=TqjBR2rdF5LZaas3NxvRjCd3bRaUxrMW/OmvY9gd7hc=; b=14RSHSRfBMzAdaJ31oIARDrjkx34CLuRd7dlqHCfXADwoTgeO31qo1WC0Ko8XL2VbC 63vvw0x+DtBD5DqmGQN+MZW/yJHBgJTtB1+o2iBMiNMMhixsZE4NNksM/ehFzO/dx3Mp aXnAxsJLrp6P4B7sMg4w+ebVn3XwY1t31rOzdRHvQE5k/GLPnktO+5s9lKw8I13EowI0 o+Y2rBHc+6eysP9RVNfnLzL3ep/iuQjRFl9LVQr4BH62amZ+UcjIyWwQKuVqWvDGePsx PjmbABqdUhPm/XbZvJTbFJRZ9gZ0ei3Xty1V/lxiALH3pGG9njqPaC7j9pPXGXMmo82z zVUg== X-Gm-Message-State: AOAM531IA8wm2aM+ZczcAi5ebynRg5AkQ3chBTY4frOFYOBNYQ0g0xvx YVA06QbMFIqE05blopJiOPgRXQJuhPi877AL X-Google-Smtp-Source: ABdhPJwKFB4+iK2TcS40HNz00M+uw17eCHTlw3evX1GN4khQoFmG711KiaQM/nJi5WLZbR9M7UeGaw== X-Received: by 2002:a17:902:ea03:b0:148:ea19:557 with SMTP id s3-20020a170902ea0300b00148ea190557mr23950332plg.129.1640745252811; Tue, 28 Dec 2021 18:34:12 -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 m3sm22613635pjz.10.2021.12.28.18.34.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:34:12 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 06/17] target/riscv: rvv-1.0: Add Zve64f support for scalar fp insns Date: Wed, 29 Dec 2021 10:33:33 +0800 Message-Id: <20211229023348.12606-7-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229023348.12606-1-frank.chang@sifive.com> References: <20211229023348.12606-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::633 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=frank.chang@sifive.com; helo=mail-pl1-x633.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang Zve64f extension requires the scalar processor to implement the F extension and implement all vector floating-point instructions for floating-point operands with EEW=32 (i.e., no widening floating-point operations). Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 41 +++++++++++++++++++------ 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index a1e403fe86..0aa8b7918f 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -66,6 +66,17 @@ static bool require_scale_rvf(DisasContext *s) } } +static bool require_zve64f(DisasContext *s) +{ + /* RVV + Zve64f = RVV. */ + if (has_ext(s, RVV)) { + return true; + } + + /* Zve64f doesn't support FP64. (Section 18.2) */ + return s->ext_zve64f ? s->sew <= MO_32 : true; +} + /* Destination vector register group cannot overlap source mask register. */ static bool require_vm(int vm, int vd) { @@ -2204,7 +2215,8 @@ static bool opfvv_check(DisasContext *s, arg_rmrr *a) return require_rvv(s) && require_rvf(s) && vext_check_isa_ill(s) && - vext_check_sss(s, a->rd, a->rs1, a->rs2, a->vm); + vext_check_sss(s, a->rd, a->rs1, a->rs2, a->vm) && + require_zve64f(s); } /* OPFVV without GVEC IR */ @@ -2284,7 +2296,8 @@ static bool opfvf_check(DisasContext *s, arg_rmrr *a) return require_rvv(s) && require_rvf(s) && vext_check_isa_ill(s) && - vext_check_ss(s, a->rd, a->rs2, a->vm); + vext_check_ss(s, a->rd, a->rs2, a->vm) && + require_zve64f(s); } /* OPFVF without GVEC IR */ @@ -2501,7 +2514,8 @@ static bool opfv_check(DisasContext *s, arg_rmr *a) require_rvf(s) && vext_check_isa_ill(s) && /* OPFV instructions ignore vs1 check */ - vext_check_ss(s, a->rd, a->rs2, a->vm); + vext_check_ss(s, a->rd, a->rs2, a->vm) && + require_zve64f(s); } static bool do_opfv(DisasContext *s, arg_rmr *a, @@ -2566,7 +2580,8 @@ static bool opfvv_cmp_check(DisasContext *s, arg_rmrr *a) return require_rvv(s) && require_rvf(s) && vext_check_isa_ill(s) && - vext_check_mss(s, a->rd, a->rs1, a->rs2); + vext_check_mss(s, a->rd, a->rs1, a->rs2) && + require_zve64f(s); } GEN_OPFVV_TRANS(vmfeq_vv, opfvv_cmp_check) @@ -2579,7 +2594,8 @@ static bool opfvf_cmp_check(DisasContext *s, arg_rmrr *a) return require_rvv(s) && require_rvf(s) && vext_check_isa_ill(s) && - vext_check_ms(s, a->rd, a->rs2); + vext_check_ms(s, a->rd, a->rs2) && + require_zve64f(s); } GEN_OPFVF_TRANS(vmfeq_vf, opfvf_cmp_check) @@ -2600,7 +2616,8 @@ static bool trans_vfmv_v_f(DisasContext *s, arg_vfmv_v_f *a) if (require_rvv(s) && require_rvf(s) && vext_check_isa_ill(s) && - require_align(a->rd, s->lmul)) { + require_align(a->rd, s->lmul) && + require_zve64f(s)) { gen_set_rm(s, RISCV_FRM_DYN); TCGv_i64 t1; @@ -3326,7 +3343,8 @@ static bool trans_vfmv_f_s(DisasContext *s, arg_vfmv_f_s *a) { if (require_rvv(s) && require_rvf(s) && - vext_check_isa_ill(s)) { + vext_check_isa_ill(s) && + require_zve64f(s)) { gen_set_rm(s, RISCV_FRM_DYN); unsigned int ofs = (8 << s->sew); @@ -3352,7 +3370,8 @@ static bool trans_vfmv_s_f(DisasContext *s, arg_vfmv_s_f *a) { if (require_rvv(s) && require_rvf(s) && - vext_check_isa_ill(s)) { + vext_check_isa_ill(s) && + require_zve64f(s)) { gen_set_rm(s, RISCV_FRM_DYN); /* The instructions ignore LMUL and vector register group. */ @@ -3403,13 +3422,15 @@ GEN_OPIVI_TRANS(vslidedown_vi, IMM_ZX, vslidedown_vx, slidedown_check) static bool fslideup_check(DisasContext *s, arg_rmrr *a) { return slideup_check(s, a) && - require_rvf(s); + require_rvf(s) && + require_zve64f(s); } static bool fslidedown_check(DisasContext *s, arg_rmrr *a) { return slidedown_check(s, a) && - require_rvf(s); + require_rvf(s) && + require_zve64f(s); } GEN_OPFVF_TRANS(vfslide1up_vf, fslideup_check) From patchwork Wed Dec 29 02:33:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 12700713 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 375A5C433F5 for ; Wed, 29 Dec 2021 02:43:19 +0000 (UTC) Received: from localhost ([::1]:48556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2Ovu-0000wP-BC for qemu-devel@archiver.kernel.org; Tue, 28 Dec 2021 21:43:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2OnD-0003Zj-18 for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:19 -0500 Received: from [2607:f8b0:4864:20::530] (port=41619 helo=mail-pg1-x530.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2OnB-0004dF-HX for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:18 -0500 Received: by mail-pg1-x530.google.com with SMTP id f8so7268471pgf.8 for ; Tue, 28 Dec 2021 18:34:17 -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=63Y4BCN3lQXD6KqJW3XIboe0KMpiBnXkS6TapXO/9NA=; b=CUdgsu97NPEUVVeKcUndM7xnEW3vxt7u4uTECsQAWozZFbzD0j1e4wkemg05kvAjBx 1C03/pP7ji4mNWDAZraA4RK1o0A9cfF45Cpd7AwzNuc+Mb+SvnpQ/Kz7buRH5NBNEGBp tECoMAQBgkO+zpxQcrSlghPCbHEuGfVwSE+F7cZCDWwGe6OjEdDfROXQNqj5fjc+aChl S/PrlG5ZivXcjdSfbUd/ULxzDnGK9Fu+oNGJ57qL1+yPU4eaURuuQJs1iXAbnXVupSbk h/SfMbpuAnHug1OpzRiVupOJZVCx4Z0ut0NNOgcxjI53w+b1+UEdQPfq6prelIHfW5CN F+KA== 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=63Y4BCN3lQXD6KqJW3XIboe0KMpiBnXkS6TapXO/9NA=; b=z4DPnajoLdXuIlAWnEApL4Z4iTULQ+XUuxmr+9U4zOfcIiL46N9rgTlXmq0Mb15FKX lV4PKL6LXmH8h+UXKNz5V8tl/mwxiN43XFzRwbL0CbfJudvpeKxiwpEGll1DK3OjKS9P PcweQ4kf/uukKraeKOnsloUZdRKlWtPQE5Zsaleaubj7h9e6NpK98EaMbPTKqMmdk+XJ E/p2OyGXE1HZYOsz2m5W6zIRiYDUViYFI8hjlXvfTS9LJ5lUJ8b4ydFtyadRf09Z8B+r U9pQYwwdzyigsP5ePp+8aHj+O7sKflz4qs7p47oABkzfC21nLVPSMIHdrk5VPOM5vMWl 8PSg== X-Gm-Message-State: AOAM530G4pxxWERguQG+VuqnFOx812FPvAZ8r6cC0mKwqcV5k8sIqqBP 4c4/ga5XyDUFriA5Zb2+TyGPFzsT9Hof5RL6 X-Google-Smtp-Source: ABdhPJy+iLzEDa1qDqa1f4ZqNkUV3zzFmECXd6NkcT6eEemVzhBGlKo65PFMg4g/qyF8LT15ENPMRw== X-Received: by 2002:a63:2c8e:: with SMTP id s136mr21729045pgs.431.1640745256133; Tue, 28 Dec 2021 18:34:16 -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 m3sm22613635pjz.10.2021.12.28.18.34.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:34:15 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 07/17] target/riscv: rvv-1.0: Add Zve64f support for single-width fp reduction insns Date: Wed, 29 Dec 2021 10:33:34 +0800 Message-Id: <20211229023348.12606-8-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229023348.12606-1-frank.chang@sifive.com> References: <20211229023348.12606-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::530 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=frank.chang@sifive.com; helo=mail-pg1-x530.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang Vector single-width floating-point reduction operations for EEW=32 are supported for Zve64f extension. Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index 0aa8b7918f..d7e288b87f 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -2935,7 +2935,8 @@ GEN_OPIVV_WIDEN_TRANS(vwredsumu_vs, reduction_widen_check) static bool freduction_check(DisasContext *s, arg_rmrr *a) { return reduction_check(s, a) && - require_rvf(s); + require_rvf(s) && + require_zve64f(s); } GEN_OPFVV_TRANS(vfredsum_vs, freduction_check) From patchwork Wed Dec 29 02:33:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 12700712 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 A4B28C433F5 for ; Wed, 29 Dec 2021 02:43:13 +0000 (UTC) Received: from localhost ([::1]:48200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2Ovo-0000hs-8r for qemu-devel@archiver.kernel.org; Tue, 28 Dec 2021 21:43:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2OnG-0003hy-GW for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:22 -0500 Received: from [2607:f8b0:4864:20::62b] (port=40611 helo=mail-pl1-x62b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2OnE-0004da-Qo for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:22 -0500 Received: by mail-pl1-x62b.google.com with SMTP id l15so39298pls.7 for ; Tue, 28 Dec 2021 18:34:20 -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=1cP8poI1ecSTfpKdi4vVjuMlMadCloWz1TdPeYGIdyk=; b=GcKmnsPUnq8GGcmvFmlw+gPQFIA5DiO+i4kdwGa/eNRaMVGqU8tNWm2VxdJcA+H/SU B+72CNG+Sdh7WDW9ojKbS/lkWLRNJElNgFj4k7h5KbipDn8ECku6x3uoFLDyIOQSBYfO 9DTxQbG6LmpErTlZBtzQee+DxnuNe+xT6dIxFklcitkuXhHMqrAigrKoXKIzhTkGDLX+ FS8UKiLIWdzFQdYDw4r5Ew9L7VSKUWG2BXEOLh435qYjL441z8XF1zhtPrxRKy6JViFo xR+AjUaJG8eM4s2yNJaCmiAeoBITdk0nK3JWabfLX7aemPkV0l166T0SNJxWmYyPBYpv gIaA== 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=1cP8poI1ecSTfpKdi4vVjuMlMadCloWz1TdPeYGIdyk=; b=uc654MT50AXL9dDdtHl2na9//iU1ftD862GKmB3Kq6xGoWQqmdclkz7ax6Jru2RiSW aeKo3bpWrHCCIdo0awmEUoD4DTGbu8Hlf/pCoIT5WbKnxihAwD+EgJ8RGB47OaiYyIik 1uycVK/Go5UAwhMhmWmU9VtF9gjIvwlTPOMVcTw9QK2287dfSG7eo61A1geTrooAbE/+ t15bY9LYUlBTpcmeNpj1FWHkXkMamQs2PQiT7mrc0RnU5eeBjbxA61YIdv4nun5Pp8fV J6JI+Bq/Fp6LH7rLg9ileyLw+9Y9VKQ1JVCMDS29laVeoNKju2BknEouJ/HVwRUOVP4w uSuQ== X-Gm-Message-State: AOAM532cndHTCgXLAtEXQ+NTrJdNsKkgmQB9QOSyqWL/MO+qEKo9stwA IVgNMTL75h5dPHFMtD9lFGGYBRtGM3C05DRk X-Google-Smtp-Source: ABdhPJxHCV72bdEkIxy55IVdIf1ZZyQb8SuqAdxMRquEO31OZaS+6X5oSGLu898a82h6lkwEf47ltA== X-Received: by 2002:a17:903:2485:b0:148:a3dc:c22a with SMTP id p5-20020a170903248500b00148a3dcc22amr24310533plw.172.1640745259403; Tue, 28 Dec 2021 18:34:19 -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 m3sm22613635pjz.10.2021.12.28.18.34.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:34:19 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 08/17] target/riscv: rvv-1.0: Add Zve64f support for widening type-convert insns Date: Wed, 29 Dec 2021 10:33:35 +0800 Message-Id: <20211229023348.12606-9-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229023348.12606-1-frank.chang@sifive.com> References: <20211229023348.12606-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62b (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=frank.chang@sifive.com; helo=mail-pl1-x62b.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang Vector widening conversion instructions are provided to and from all supported integer EEWs for Zve64f extension. Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 32 +++++++++++++++++++------ 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index d7e288b87f..9ca8d502b2 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -77,6 +77,17 @@ static bool require_zve64f(DisasContext *s) return s->ext_zve64f ? s->sew <= MO_32 : true; } +static bool require_scale_zve64f(DisasContext *s) +{ + /* RVV + Zve64f = RVV. */ + if (has_ext(s, RVV)) { + return true; + } + + /* Zve64f doesn't support FP64. (Section 18.2) */ + return s->ext_zve64f ? s->sew <= MO_16 : true; +} + /* Destination vector register group cannot overlap source mask register. */ static bool require_vm(int vm, int vd) { @@ -2331,7 +2342,8 @@ static bool opfvv_widen_check(DisasContext *s, arg_rmrr *a) require_scale_rvf(s) && (s->sew != MO_8) && vext_check_isa_ill(s) && - vext_check_dss(s, a->rd, a->rs1, a->rs2, a->vm); + vext_check_dss(s, a->rd, a->rs1, a->rs2, a->vm) && + require_scale_zve64f(s); } /* OPFVV with WIDEN */ @@ -2370,7 +2382,8 @@ static bool opfvf_widen_check(DisasContext *s, arg_rmrr *a) require_scale_rvf(s) && (s->sew != MO_8) && vext_check_isa_ill(s) && - vext_check_ds(s, a->rd, a->rs2, a->vm); + vext_check_ds(s, a->rd, a->rs2, a->vm) && + require_scale_zve64f(s); } /* OPFVF with WIDEN */ @@ -2400,7 +2413,8 @@ static bool opfwv_widen_check(DisasContext *s, arg_rmrr *a) require_scale_rvf(s) && (s->sew != MO_8) && vext_check_isa_ill(s) && - vext_check_dds(s, a->rd, a->rs1, a->rs2, a->vm); + vext_check_dds(s, a->rd, a->rs1, a->rs2, a->vm) && + require_scale_zve64f(s); } /* WIDEN OPFVV with WIDEN */ @@ -2439,7 +2453,8 @@ static bool opfwf_widen_check(DisasContext *s, arg_rmrr *a) require_scale_rvf(s) && (s->sew != MO_8) && vext_check_isa_ill(s) && - vext_check_dd(s, a->rd, a->rs2, a->vm); + vext_check_dd(s, a->rd, a->rs2, a->vm) && + require_scale_zve64f(s); } /* WIDEN OPFVF with WIDEN */ @@ -2698,14 +2713,16 @@ static bool opfv_widen_check(DisasContext *s, arg_rmr *a) static bool opxfv_widen_check(DisasContext *s, arg_rmr *a) { return opfv_widen_check(s, a) && - require_rvf(s); + require_rvf(s) && + require_zve64f(s); } static bool opffv_widen_check(DisasContext *s, arg_rmr *a) { return opfv_widen_check(s, a) && require_scale_rvf(s) && - (s->sew != MO_8); + (s->sew != MO_8) && + require_scale_zve64f(s); } #define GEN_OPFV_WIDEN_TRANS(NAME, CHECK, HELPER, FRM) \ @@ -2756,7 +2773,8 @@ static bool opfxv_widen_check(DisasContext *s, arg_rmr *a) require_scale_rvf(s) && vext_check_isa_ill(s) && /* OPFV widening instructions ignore vs1 check */ - vext_check_ds(s, a->rd, a->rs2, a->vm); + vext_check_ds(s, a->rd, a->rs2, a->vm) && + require_scale_zve64f(s); } #define GEN_OPFXV_WIDEN_TRANS(NAME) \ From patchwork Wed Dec 29 02:33:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 12700716 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 1AAFCC433EF for ; Wed, 29 Dec 2021 02:47:00 +0000 (UTC) Received: from localhost ([::1]:55462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2OzT-0005eF-2O for qemu-devel@archiver.kernel.org; Tue, 28 Dec 2021 21:46:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2OnJ-0003vA-Ua for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:25 -0500 Received: from [2607:f8b0:4864:20::436] (port=39691 helo=mail-pf1-x436.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2OnI-0004eD-A4 for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:25 -0500 Received: by mail-pf1-x436.google.com with SMTP id s15so17565173pfk.6 for ; Tue, 28 Dec 2021 18:34:23 -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=SaewoL+pQeacrjgH2M0YD+Yq4KGUykd58jmJ9cpH35g=; b=XlrwDQZnSk8ECns/6XQixEsNCkxAg2t9NOEskYGiWk63eZ9JJf6cIoCYxO7r6qDmL5 YCZ6AFSSnb0U4SLIAmjN26ZEXjCL6q36LpQPpzoQqNqiwMqfaroWuoZUePbtAn1/rpGD YjUNOdVmOzXbi4H/8HSAeBJPS3gdHJ2WVXLxabOcE0pa4pZ6dP74rP5Oi1synvqmy/Ve QDGciup4oeENSAcfItJvfuK2hOpsWjWOS4+2pGKt991i+rsjAGoyENs3Vksyvgmv1kmS saItF9FidGpye15lu0MqptJgRz6hYuyuQQPj4TWotKdW5XCK/b5jWYAA2frU59ZanhBA GwgA== 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=SaewoL+pQeacrjgH2M0YD+Yq4KGUykd58jmJ9cpH35g=; b=jxeVIYwZevy3Te7N7E9300KNETuLnWgfWBwdntZQGFKpMUEhsyJ70vPLDT8yn2kiPa mJTK0bgYSpjYYz8lkuRMQvOXGK3YSLmDXkgMawZS7GVAD8qWFKryiHck0OkHqCcS3Zcs GDHx2RoVF3uoWl1nvlrt4M1NPdg+Xpsdb1iP8MAtff1cOWhEnQh+vcQMsYj9Tqhse8Fp nsgkga4LG1En7IHjnL+cP8rf89U/En+f5WlasDDqqAmuUMixhzlc0ae/lMcoq9bVFEHG xJ1845wlL02MHVdN8wiVma/yv0+ewE59ge/6N7FXfU/ahYEvS2ftnwUzc9RxVFXfD7ZB lLLQ== X-Gm-Message-State: AOAM531HgtzgR0aGH5JmFWM5lhtI+ls/A+vVKOpD1AAzY98hg87cXgjS bgE+GpbzeSU7syav9MNqm+28qHb9sruVFpGz X-Google-Smtp-Source: ABdhPJwI8KBpMtnOoWisg2cZUZ5JdNJMVSsvNOfZ/YLNnO1y3s3Qf/knMXYPtrfhQ9jjpsOUcdVBEg== X-Received: by 2002:a63:b54d:: with SMTP id u13mr20504695pgo.62.1640745262744; Tue, 28 Dec 2021 18:34:22 -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 m3sm22613635pjz.10.2021.12.28.18.34.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:34:22 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 09/17] target/riscv: rvv-1.0: Add Zve64f support for narrowing type-convert insns Date: Wed, 29 Dec 2021 10:33:36 +0800 Message-Id: <20211229023348.12606-10-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229023348.12606-1-frank.chang@sifive.com> References: <20211229023348.12606-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::436 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=frank.chang@sifive.com; helo=mail-pf1-x436.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang Vector narrowing conversion instructions are provided to and from all supported integer EEWs for Zve64f extension. Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index 9ca8d502b2..230c475d6c 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -2824,14 +2824,16 @@ static bool opfxv_narrow_check(DisasContext *s, arg_rmr *a) { return opfv_narrow_check(s, a) && require_rvf(s) && - (s->sew != MO_64); + (s->sew != MO_64) && + require_zve64f(s); } static bool opffv_narrow_check(DisasContext *s, arg_rmr *a) { return opfv_narrow_check(s, a) && require_scale_rvf(s) && - (s->sew != MO_8); + (s->sew != MO_8) && + require_scale_zve64f(s); } #define GEN_OPFV_NARROW_TRANS(NAME, CHECK, HELPER, FRM) \ @@ -2880,7 +2882,8 @@ static bool opxfv_narrow_check(DisasContext *s, arg_rmr *a) require_scale_rvf(s) && vext_check_isa_ill(s) && /* OPFV narrowing instructions ignore vs1 check */ - vext_check_sd(s, a->rd, a->rs2, a->vm); + vext_check_sd(s, a->rd, a->rs2, a->vm) && + require_scale_zve64f(s); } #define GEN_OPXFV_NARROW_TRANS(NAME, HELPER, FRM) \ From patchwork Wed Dec 29 02:33:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 12700715 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 063E3C433F5 for ; Wed, 29 Dec 2021 02:46:18 +0000 (UTC) Received: from localhost ([::1]:54662 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2Oym-00051q-G6 for qemu-devel@archiver.kernel.org; Tue, 28 Dec 2021 21:46:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55780) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2OnM-00044u-Lz for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:28 -0500 Received: from [2607:f8b0:4864:20::62e] (port=34350 helo=mail-pl1-x62e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2OnL-0004ep-4y for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:28 -0500 Received: by mail-pl1-x62e.google.com with SMTP id x15so14847324plg.1 for ; Tue, 28 Dec 2021 18:34:26 -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=N03Xkux9la2UybCMyY074pwvy5+acptGJ9BHqYtpSWA=; b=ljjLMVnwm3sFudrKReD2vy0qXzF50cr8X15TaBAPe4hSF5z/eOgQQ6b5SkcEP4aZxN G1sfOPhEBAl2SHihCdHvbngVBPxPCKWjbaNuPyqxk2pp7maWAPuOuNANIBhzvOKPrFLb KDaWspspGNLP3v04+0W2TGMks9Z7gh9QrI3ueneSD946CK/Ovrom0s4IYIuBWitTaE6o EC4v3jYHeQYaLhRlsZ0+ItKac4I+BD1EXVqzT0g2mhLH+Rz94DhHY6Lp5zoZtX0Zfe09 GqygkVtvpEfVwY14YB3rPypCVrTDuKloylOfefoDiOwOFaj+IwVwiwyvQvlTwk9YTQoG rjmw== 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=N03Xkux9la2UybCMyY074pwvy5+acptGJ9BHqYtpSWA=; b=x1USyOg32kxvKkKADvXzM+t72/jF9GuC5wt2oWgmzzkCSrEZQ3GW5J2C7u4HKbmoV1 pbXUEFjYM0/aaQGuZWoe+SpAOMlB+AtHnmGT0NOJtjfkxgP9UFfHB1WVOthLLkUS6iyh 7/kyRO+n3X0Foy5F6kKI0lfwBPTwVJ4tTCu0dzxsS7/CxFi3e8/pVbNF+fcaP5v3uSnO pqZ0ldgX//OzdaisOIetl8wJgSHE+G+CtIr4ATMJSyjcQO9EIg7OeSQ2JPalKnRJ+9t1 YtQ7usNmPt91vYtHjdsZ9EybuLBnv39MzE/PdpcI9cbg6N5tkgJiV6YgMYQukgSi9D6o 5nBg== X-Gm-Message-State: AOAM533I1P4ZCnkI4ZUaODmpmFdntUqbxS9RR5B1C1oB4IBow7ElcoZh yW+MfhletSfzT8QbpsPT8oS6QvZMskUR82QX X-Google-Smtp-Source: ABdhPJwugzM4QBlUZalJVypEM3DgZGOTu42By2+F6AmIf9Fq3jM+vsWklqQEBwWT2us+4MBK2ZJKPg== X-Received: by 2002:a17:90b:1956:: with SMTP id nk22mr29453458pjb.38.1640745265694; Tue, 28 Dec 2021 18:34:25 -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 m3sm22613635pjz.10.2021.12.28.18.34.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:34:25 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 10/17] target/riscv: rvv-1.0: Allow Zve64f extension to be turned on Date: Wed, 29 Dec 2021 10:33:37 +0800 Message-Id: <20211229023348.12606-11-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229023348.12606-1-frank.chang@sifive.com> References: <20211229023348.12606-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62e (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=frank.chang@sifive.com; helo=mail-pl1-x62e.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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: Frank Chang , Palmer Dabbelt , Alistair Francis , Bin Meng , qemu-riscv@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 01239620ca..38cd11a8ae 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -636,6 +636,7 @@ static Property riscv_cpu_properties[] = { DEFINE_PROP_BOOL("Zicsr", RISCVCPU, cfg.ext_icsr, true), DEFINE_PROP_BOOL("Zfh", RISCVCPU, cfg.ext_zfh, false), DEFINE_PROP_BOOL("Zfhmin", RISCVCPU, cfg.ext_zfhmin, false), + DEFINE_PROP_BOOL("Zve64f", RISCVCPU, cfg.ext_zve64f, false), DEFINE_PROP_BOOL("mmu", RISCVCPU, cfg.mmu, true), DEFINE_PROP_BOOL("pmp", RISCVCPU, cfg.pmp, true), From patchwork Wed Dec 29 02:33:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 12700704 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 2C18DC433F5 for ; Wed, 29 Dec 2021 02:36:20 +0000 (UTC) Received: from localhost ([::1]:32792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2Op9-0007DE-3s for qemu-devel@archiver.kernel.org; Tue, 28 Dec 2021 21:36:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55812) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2OnP-0004GF-Tc for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:31 -0500 Received: from [2607:f8b0:4864:20::633] (port=43767 helo=mail-pl1-x633.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2OnO-0004fI-5t for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:31 -0500 Received: by mail-pl1-x633.google.com with SMTP id l16so2749571plg.10 for ; Tue, 28 Dec 2021 18:34:29 -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=i/rRBsskKf+pcabivKrRy9d5npCioL1XjUd6hb25l10=; b=nASU4tT04YlJycPDDVwe+hUZGSyhEU5knl2QJrHDiS5VIPLYSUphbVgrOvlG1RYng5 HTRM+OergQYdChNillykjQTFRC7XRQLRUcdwezra5eSXpMYVyf6Vt1j0/ANmh86GO6vy uY53WtZ3IxkiYwPvTugehmHVZiv45AcIA/aJIys0OHmbAgJsDeWFAXlvTc5J+vfOP+He eDvWWBnBjZCd1G6XzyG/bjw7S9QRLGyQKg50f4qhu27hLQKK3fK1kB3LSk6ev0hKlR6N l7U+HMmgvxah2IMgqZp7KAhBVrNbAwVMqAPMFvd2eS/4FokOxiJjbhCIsXzRFu0OdrsC sFOA== 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=i/rRBsskKf+pcabivKrRy9d5npCioL1XjUd6hb25l10=; b=uVtpj9LdAWmva9CoFNr3772AW+u0fWKZIAn3g6JfoQWL1fKG3g6kFNvgDwFCqSCn0l qPl7hW8ha1clk92x+gkaaaTVtBMXzgGcB5mfICvO2jzzn7LQ0Y1nAKcZSVZMB37ZE45o rjMZEfMZcXgrtLhKHsfJ40nPICnLzwHvwFdelFdWULD/te4Scv79La5VBunT/SvKtqgj uY3XTEoRPou74FB0XUdFvnEyBjnx8QMiEUgensoFMWN+QmYyY3gV374ykPiE4kKGn6wS MI+a7DeRD/e9epNfuxO/sUXgby1EWxHPFDTG9Lzj03wWAyx+taTjHyuy6QLslqLXvYRQ bXXQ== X-Gm-Message-State: AOAM5310ALGzaxAHFWspnF5dhGkqY+zNfjzy2iMeOswL1wNO+AG4FuP3 axJkMePktaoxCfT/5S6d9qU3H/BvzY5qTv4i X-Google-Smtp-Source: ABdhPJzLtXKJq2wElXqubkkg0EtDeiGYrBCF4vzGvO2O4+meVvsTy1aUL2j3nwecEFz8cnSuMuubbg== X-Received: by 2002:a17:903:2303:b0:149:50d1:19d0 with SMTP id d3-20020a170903230300b0014950d119d0mr24338575plh.86.1640745268718; Tue, 28 Dec 2021 18:34:28 -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 m3sm22613635pjz.10.2021.12.28.18.34.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:34:28 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 11/17] target/riscv: rvv-1.0: Add Zve32f extension into RISC-V Date: Wed, 29 Dec 2021 10:33:38 +0800 Message-Id: <20211229023348.12606-12-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229023348.12606-1-frank.chang@sifive.com> References: <20211229023348.12606-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::633 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=frank.chang@sifive.com; helo=mail-pl1-x633.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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: Frank Chang , Palmer Dabbelt , Alistair Francis , Bin Meng , qemu-riscv@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 4 ++-- target/riscv/cpu.h | 1 + target/riscv/cpu_helper.c | 2 +- target/riscv/csr.c | 2 +- target/riscv/translate.c | 2 ++ 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 38cd11a8ae..5e98860a09 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -562,8 +562,8 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp) } set_vext_version(env, vext_version); } - if (cpu->cfg.ext_zve64f && !cpu->cfg.ext_f) { - error_setg(errp, "Zve64f extension depends upon RVF."); + if ((cpu->cfg.ext_zve32f || cpu->cfg.ext_zve64f) && !cpu->cfg.ext_f) { + error_setg(errp, "Zve32f/Zve64f extension depends upon RVF."); return; } if (cpu->cfg.ext_j) { diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index d7b2db2b2f..3f3b3bb062 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -317,6 +317,7 @@ struct RISCVCPU { bool ext_icsr; bool ext_zfh; bool ext_zfhmin; + bool ext_zve32f; bool ext_zve64f; char *priv_spec; diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index 52d93a41fd..7d8b34cf1a 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -77,7 +77,7 @@ void cpu_get_tb_cpu_state(CPURISCVState *env, target_ulong *pc, *pc = env->pc; *cs_base = 0; - if (riscv_has_ext(env, RVV) || cpu->cfg.ext_zve64f) { + if (riscv_has_ext(env, RVV) || cpu->cfg.ext_zve32f || cpu->cfg.ext_zve64f) { /* * If env->vl equals to VLMAX, we can use generic vector operation * expanders (GVEC) to accerlate the vector operations. diff --git a/target/riscv/csr.c b/target/riscv/csr.c index 340b9661a8..7bd3a5d1af 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -51,7 +51,7 @@ static RISCVException vs(CPURISCVState *env, int csrno) RISCVCPU *cpu = RISCV_CPU(cs); if (env->misa_ext & RVV || - cpu->cfg.ext_zve64f) { + cpu->cfg.ext_zve32f || cpu->cfg.ext_zve64f) { #if !defined(CONFIG_USER_ONLY) if (!env->debugger && !riscv_cpu_vector_enabled(env)) { return RISCV_EXCP_ILLEGAL_INST; diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 8c3b0168b7..3d89a6650d 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -78,6 +78,7 @@ typedef struct DisasContext { bool ext_ifencei; bool ext_zfh; bool ext_zfhmin; + bool ext_zve32f; bool ext_zve64f; bool hlsx; /* vector extension */ @@ -706,6 +707,7 @@ static void riscv_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) ctx->ext_ifencei = cpu->cfg.ext_ifencei; ctx->ext_zfh = cpu->cfg.ext_zfh; ctx->ext_zfhmin = cpu->cfg.ext_zfhmin; + ctx->ext_zve32f = cpu->cfg.ext_zve32f; ctx->ext_zve64f = cpu->cfg.ext_zve64f; ctx->vlen = cpu->cfg.vlen; ctx->elen = cpu->cfg.elen; From patchwork Wed Dec 29 02:33:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 12700710 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 AC1CDC433F5 for ; Wed, 29 Dec 2021 02:40:40 +0000 (UTC) Received: from localhost ([::1]:41416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2OtL-0004Y9-KZ for qemu-devel@archiver.kernel.org; Tue, 28 Dec 2021 21:40:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2OnS-0004Qh-UA for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:34 -0500 Received: from [2607:f8b0:4864:20::1031] (port=37589 helo=mail-pj1-x1031.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2OnR-0004fh-Aq for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:34 -0500 Received: by mail-pj1-x1031.google.com with SMTP id y16-20020a17090a6c9000b001b13ffaa625so23229208pjj.2 for ; Tue, 28 Dec 2021 18:34:32 -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=F575T9dO+4ZW9fmdR/aCWDdFX/Ryz6qGcvsU7gxpyus=; b=J2S4ZVKJg/H4zv9rtkD7q4vT9e7Ra/F2E2PUclIMif1RsFMkbDSU/oiVWWH/KLrRIe Wnjxs3PPjVB1maDbZqI0hyghwJ2NUtUzhpSl207G0kYF3ABvKSONQA8g67QeUxGg7ANg BtaEm9eI3xt9VJn6lwew1x3TTk+0P9XVm8uxPVj2GiQtzcTeK5ppLi7rSA0B4VG9t6t5 7KGOPl27WNE15LcbaG1nfIcNAsqdx3IvC+UeySca9xO4bDQ+LXSEK9x2oKcG7EdEk0vm h/62bPMlJ48VWFN1sz3aFlr9zYShV4X3KwEDcU48T70MsyCk4+E/TWNzjHfmGRPGN0WR Q7Hg== 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=F575T9dO+4ZW9fmdR/aCWDdFX/Ryz6qGcvsU7gxpyus=; b=5XzRPejVHEGfK8ol55aIUaUthbHFK941kKR4GWqfpOevcr69u8XCXRuA9RSLgzA7yH unQ0oHegOXNy1Rt51VWpOWDmFvYwcRCtHjerXkKnuSAqekgm9iKiNXv+Dq8iG+lHaply VGjFM1yC+3bUBqd/UlryghCNzvFQGwjWPqY8OuYqAlXCltg5JZnuTQ85Yt23d6Sh5b/v 7tfU8w9lr3O09BXi/bY/wXPgJbxpBGFU77wnH3jb47AuqtxP6zYPk8te6tmNLSrjDnqx ag1Go+Nd44GDcwfd2xVHzd3q+MNTlM/+qMRQJGHt6qID7JoqjP4DSba81G8oEcHN1WEX Z2Kw== X-Gm-Message-State: AOAM531YMa5Hu8V6WowMK1mV/2pkQy3+usjncrLW0I2Bdp2RumLx1QDS wDd18UJ3nlrl6Q7VwcfUhKDIMehmiGzCHnpZ X-Google-Smtp-Source: ABdhPJwe/9+R01wjhZE3CF62kE6WGLHTCtYkFft7v8Hs61+impyo75hg20M6hEA+abh43F5HGC/crA== X-Received: by 2002:a17:90a:5b:: with SMTP id 27mr29465918pjb.148.1640745271823; Tue, 28 Dec 2021 18:34:31 -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 m3sm22613635pjz.10.2021.12.28.18.34.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:34:31 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 12/17] target/riscv: rvv-1.0: Add Zve32f support for configuration insns Date: Wed, 29 Dec 2021 10:33:39 +0800 Message-Id: <20211229023348.12606-13-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229023348.12606-1-frank.chang@sifive.com> References: <20211229023348.12606-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1031 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=frank.chang@sifive.com; helo=mail-pj1-x1031.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang All Zve* extensions support the vector configuration instructions. Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index 230c475d6c..c6280c7b0b 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -152,7 +152,7 @@ static bool do_vsetvl(DisasContext *s, int rd, int rs1, TCGv s2) TCGv s1, dst; if (!require_rvv(s) || - !(has_ext(s, RVV) || s->ext_zve64f)) { + !(has_ext(s, RVV) || s->ext_zve32f || s->ext_zve64f)) { return false; } @@ -188,7 +188,7 @@ static bool do_vsetivli(DisasContext *s, int rd, TCGv s1, TCGv s2) TCGv dst; if (!require_rvv(s) || - !(has_ext(s, RVV) || s->ext_zve64f)) { + !(has_ext(s, RVV) || s->ext_zve32f || s->ext_zve64f)) { return false; } From patchwork Wed Dec 29 02:33:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 12700719 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 7E1D0C433EF for ; Wed, 29 Dec 2021 02:49:27 +0000 (UTC) Received: from localhost ([::1]:34034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2P1q-0001nh-Hs for qemu-devel@archiver.kernel.org; Tue, 28 Dec 2021 21:49:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2OnX-0004iM-CN for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:39 -0500 Received: from [2607:f8b0:4864:20::1030] (port=35735 helo=mail-pj1-x1030.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2OnU-0004g5-97 for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:39 -0500 Received: by mail-pj1-x1030.google.com with SMTP id r16-20020a17090a0ad000b001b276aa3aabso10070457pje.0 for ; Tue, 28 Dec 2021 18:34: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=+dbS4H1WPWmTJSeTr7C9MaPGPN8smTAfEpWt29Vshjw=; b=EsVBWphDpC9rSaGDuBUEYGHN1nNriCACIFe9A+Bqq+3UEbBJQ9EDp2HlVmAsvskQ2a iBiqg9tlPa89j99fopbdG8xsKq0tOlmewzGDf3VsN5jXTn+gQ/nTiJX0sh+y0Q1+sHLT 2dwdm4p2WjvLSvizJOZNauAaLLpk0sDKhBUmncgbQ9wx2n6ZqJty+h1gjTX84RFv3OOg DpaO93Zg2bxNNFD/WMMtWaML/uCBr+Ek3PPx7YdS9U++N+cJpLCVY8JGt3E7RwMs8k2d qg/853hPELM9htft6yUVLcD7zeapxVa4ufZwd/W/IxBB10kdnX+LMQK72n/geEv9SLKz wcqw== 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=+dbS4H1WPWmTJSeTr7C9MaPGPN8smTAfEpWt29Vshjw=; b=e8yUtJHA4SEVbg9F7Qi8BX89C3vYz/YPnszVyfUMTLP+BtBoM9xEqnZOBs1pfOhroR +vbtPscE49IN349COMPERX3zeXNdd0cBfIdINU64sLC2dAJZBL43A55E/iuOVff+RUVZ KK1QbqoHqrNXnnwcZeEmHNd1D3ItvxPFODLLmTT+AzN4ujQMjxIC6WrYOqKZZTgE6ghJ TQI5SPe6URUG4abCnwd+95uZcBeTOSkBZVhQ6naZghmzhh/SFxIUM+TohNh44H9KyHPO 7uicjIb4vgUQSeqoFYFhDR04aHgX5/lLZ5kjGCFdIoRzRtnKwBc75pFw13gp3e+9NCRQ hFqA== X-Gm-Message-State: AOAM532fJYAlRTppnEQ7lppnLPQeX+a4Jl6h1MeDPVk1+qhRIC+NSfNQ ugjRvjoaPXxD1zigDE2FIjbTJOLkDcPYWSLe X-Google-Smtp-Source: ABdhPJzD4WfBmvgmxSTxpcitZ2eAIaIaSDYccwKtXeY3bJgsB8mM4DTGV+h3mIs/biK38ZOzxzKDvA== X-Received: by 2002:a17:90a:fb83:: with SMTP id cp3mr29793983pjb.111.1640745274809; Tue, 28 Dec 2021 18:34: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 m3sm22613635pjz.10.2021.12.28.18.34.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:34:34 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 13/17] target/riscv: rvv-1.0: Add Zve32f support for scalar fp insns Date: Wed, 29 Dec 2021 10:33:40 +0800 Message-Id: <20211229023348.12606-14-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229023348.12606-1-frank.chang@sifive.com> References: <20211229023348.12606-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1030 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=frank.chang@sifive.com; helo=mail-pj1-x1030.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang Zve32f extension requires the scalar processor to implement the F extension and implement all vector floating-point instructions for floating-point operands with EEW=32 (i.e., no widening floating-point operations). Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index c6280c7b0b..1f5a75eca7 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -66,6 +66,17 @@ static bool require_scale_rvf(DisasContext *s) } } +static bool require_zve32f(DisasContext *s) +{ + /* RVV + Zve32f = RVV. */ + if (has_ext(s, RVV)) { + return true; + } + + /* Zve32f doesn't support FP64. (Section 18.2) */ + return s->ext_zve32f ? s->sew <= MO_32 : true; +} + static bool require_zve64f(DisasContext *s) { /* RVV + Zve64f = RVV. */ @@ -2227,6 +2238,7 @@ static bool opfvv_check(DisasContext *s, arg_rmrr *a) require_rvf(s) && vext_check_isa_ill(s) && vext_check_sss(s, a->rd, a->rs1, a->rs2, a->vm) && + require_zve32f(s) && require_zve64f(s); } @@ -2308,6 +2320,7 @@ static bool opfvf_check(DisasContext *s, arg_rmrr *a) require_rvf(s) && vext_check_isa_ill(s) && vext_check_ss(s, a->rd, a->rs2, a->vm) && + require_zve32f(s) && require_zve64f(s); } @@ -2530,6 +2543,7 @@ static bool opfv_check(DisasContext *s, arg_rmr *a) vext_check_isa_ill(s) && /* OPFV instructions ignore vs1 check */ vext_check_ss(s, a->rd, a->rs2, a->vm) && + require_zve32f(s) && require_zve64f(s); } @@ -2596,6 +2610,7 @@ static bool opfvv_cmp_check(DisasContext *s, arg_rmrr *a) require_rvf(s) && vext_check_isa_ill(s) && vext_check_mss(s, a->rd, a->rs1, a->rs2) && + require_zve32f(s) && require_zve64f(s); } @@ -2610,6 +2625,7 @@ static bool opfvf_cmp_check(DisasContext *s, arg_rmrr *a) require_rvf(s) && vext_check_isa_ill(s) && vext_check_ms(s, a->rd, a->rs2) && + require_zve32f(s) && require_zve64f(s); } @@ -2632,6 +2648,7 @@ static bool trans_vfmv_v_f(DisasContext *s, arg_vfmv_v_f *a) require_rvf(s) && vext_check_isa_ill(s) && require_align(a->rd, s->lmul) && + require_zve32f(s) && require_zve64f(s)) { gen_set_rm(s, RISCV_FRM_DYN); @@ -3366,6 +3383,7 @@ static bool trans_vfmv_f_s(DisasContext *s, arg_vfmv_f_s *a) if (require_rvv(s) && require_rvf(s) && vext_check_isa_ill(s) && + require_zve32f(s) && require_zve64f(s)) { gen_set_rm(s, RISCV_FRM_DYN); @@ -3393,6 +3411,7 @@ static bool trans_vfmv_s_f(DisasContext *s, arg_vfmv_s_f *a) if (require_rvv(s) && require_rvf(s) && vext_check_isa_ill(s) && + require_zve32f(s) && require_zve64f(s)) { gen_set_rm(s, RISCV_FRM_DYN); @@ -3445,6 +3464,7 @@ static bool fslideup_check(DisasContext *s, arg_rmrr *a) { return slideup_check(s, a) && require_rvf(s) && + require_zve32f(s) && require_zve64f(s); } @@ -3452,6 +3472,7 @@ static bool fslidedown_check(DisasContext *s, arg_rmrr *a) { return slidedown_check(s, a) && require_rvf(s) && + require_zve32f(s) && require_zve64f(s); } From patchwork Wed Dec 29 02:33:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 12700718 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 EBE25C433F5 for ; Wed, 29 Dec 2021 02:49:25 +0000 (UTC) Received: from localhost ([::1]:33852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2P1o-0001fC-PX for qemu-devel@archiver.kernel.org; Tue, 28 Dec 2021 21:49:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2OnZ-0004pO-8S for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:41 -0500 Received: from [2607:f8b0:4864:20::62d] (port=33637 helo=mail-pl1-x62d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2OnX-0004go-If for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:40 -0500 Received: by mail-pl1-x62d.google.com with SMTP id i6so8816519pla.0 for ; Tue, 28 Dec 2021 18:34:39 -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=gVgNP+lNfNGU4BTAjk3ZtDth023tc9GvfIxx/eyTFzE=; b=nZflVh2aCo2WGOYt+XVZqAY+0WepX9wMMTueFs7v/3rVgtj42r3MYE64jetRPeIl6I fVCg1fNln/G6qZMkjj0iezCAR2EFyIpxuueThgwAxoMGtoCQGazD4rtD2zHj6QcRN1zX j5BH6jApuodQB3LJF+4SFLCPM3tOOGCph6nixu0JVgf4D/AyCVw0k9VDzlSzuz+yljHo I0sRxDRGJrr5iL/aFRgEugzMV1P0pVO2Hw60KKH/GNGKDmY2Lz1jtO/poh93OSOquFbd HCIRBpMf8ftZ+hlaQOELL1bLv0Jw2hHYaM/ZU+qBvXt1dcPvO0Q1BElj9nFNNyPltplN gXWw== 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=gVgNP+lNfNGU4BTAjk3ZtDth023tc9GvfIxx/eyTFzE=; b=uvgPjHvhGxW6HvwKAdPgcienDL2afQO8sRST842S91YTwl/zeX1WuT9t85ZIWETsGK wtS1k2q0WNrv/E4ueSdYxz7nkxgGHqvigk4sH47NXsS8tY/rz+MNj9jD3ITAyAK/H8um VpGn7us8PQB4sX7GDfUxt16FmPm5FLfRc19PbaQLYIqum56DyfphMpJsh8jzJB0Qse6F YzUEJwvrghlOB2RAqzz7bFg/LhUxAi9p26Vt8fk2w9+w5P+yG0GQisz/6Ev08dCjIDBe FaFHezqUMwRTxV9ND/0VdMc/U4OQTsQKpel/2TIYVFtqBOKS13cFyul+wNE42q4aOKj4 6jhQ== X-Gm-Message-State: AOAM530Ude/ODEAfVNlsXU1ogrQpQic5xvRxmH0HVwVIRitbxI5HxExS IlFKTVrq/g8yj4FrPm2XyXckKTYYU6GuxlZb X-Google-Smtp-Source: ABdhPJxFD0aLKR3TpIWgC/BipOci+KruiREYpzUvL8RLegEeUGR6tx/B+wePPFlxtexpi2yP7vkHBw== X-Received: by 2002:a17:90a:4f41:: with SMTP id w1mr29848427pjl.222.1640745278121; Tue, 28 Dec 2021 18:34:38 -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 m3sm22613635pjz.10.2021.12.28.18.34.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:34:37 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 14/17] target/riscv: rvv-1.0: Add Zve32f support for single-width fp reduction insns Date: Wed, 29 Dec 2021 10:33:41 +0800 Message-Id: <20211229023348.12606-15-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229023348.12606-1-frank.chang@sifive.com> References: <20211229023348.12606-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62d (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=frank.chang@sifive.com; helo=mail-pl1-x62d.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang Vector single-width floating-point reduction operations for EEW=32 are supported for Zve32f extension. Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index 1f5a75eca7..c3f4dabf36 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -2974,6 +2974,7 @@ static bool freduction_check(DisasContext *s, arg_rmrr *a) { return reduction_check(s, a) && require_rvf(s) && + require_zve32f(s) && require_zve64f(s); } From patchwork Wed Dec 29 02:33:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 12700720 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 BB72DC433F5 for ; Wed, 29 Dec 2021 02:51:21 +0000 (UTC) Received: from localhost ([::1]:37686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2P3g-0004KC-Hb for qemu-devel@archiver.kernel.org; Tue, 28 Dec 2021 21:51:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2Onc-00053j-M3 for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:44 -0500 Received: from [2607:f8b0:4864:20::1036] (port=39493 helo=mail-pj1-x1036.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2Ona-0004hF-Tk for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:44 -0500 Received: by mail-pj1-x1036.google.com with SMTP id z9-20020a17090a7b8900b001b13558eadaso23227050pjc.4 for ; Tue, 28 Dec 2021 18:34:42 -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=Xjd75YbG8F4ei39H9LGmQ6t+9PDsY+VwGpDiNki4ndE=; b=lfM9hLTYAnq+74RAiJTfr9weT+gC1UMI64PElE8X9YDxqX+GFkgRbB4XjOU8noF04G z1xoJdB4Fhrv9dpCqqExgBI4ORHb2JnezdC0/knr05gctpXZDoAVQRNpkMoe+PUB9a6+ ObDgNcYzDND/lZa0Cn7/SbOORY2OlUtJGGR1sqWdYBmkuJgQU7gbzv+wpDdorgEbWYFt RF3ATU2ELB3dDtVzAC3Dkfzm5/Gv310jpvx0QPNNJl30eC4x4lgq79vVbWGTRJpIwWou xaefTONKH5yPbeAl7gdXCTm8uLEaw5LloCPIGTFa37Bqp+HAYS9aSwmqVfLcRI+idh/5 CmmQ== 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=Xjd75YbG8F4ei39H9LGmQ6t+9PDsY+VwGpDiNki4ndE=; b=a6p4ou1zu14FePdBOxLtSfPpEEkcuFV/9i8hrqasJo8zMcLArUHGM/9Xz8eNYR7jDB BDRZV1P/89iDqM006VX6kdaXdtyQd6GAqjHkMDOwu5FMNU+ia32U4446vcl6lE4meoCT x8ugy+kBg/Y93LakqPgQwIj0z3CTULA3CCysP3Jncm4ayaKmluZbJmk9gynMghzmvTHi a0Uzfspb93MxIodTjnPtxD+3JQ/nWMl9BZCU6ciBNz0xLhWyCF5VicaZ0NkEFvi3VJ6Z zOLhVjVLcuHeQed61wjGJYKkXt+mRwtg5WimVOtohv08NUyx+UvztxSAnrPeMdJMkaRa Kg0Q== X-Gm-Message-State: AOAM533PZ6FfxX4O/Pyz7dOd9cNwGNbxOdyUC5wp1hoNMGZrvDl5YJd2 CuuQlMJgXuZQshySlsrid+oiDc0HiCMYVlWP X-Google-Smtp-Source: ABdhPJz3o2/uDihfgF7Yu/oBg87dDv0WntIkO41eFtc3ERN6UYhpxy6B24Fv4XCgkO0/aoBchGaqhA== X-Received: by 2002:a17:902:8605:b0:149:9a25:103c with SMTP id f5-20020a170902860500b001499a25103cmr2519834plo.155.1640745281423; Tue, 28 Dec 2021 18:34:41 -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 m3sm22613635pjz.10.2021.12.28.18.34.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:34:41 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 15/17] target/riscv: rvv-1.0: Add Zve32f support for widening type-convert insns Date: Wed, 29 Dec 2021 10:33:42 +0800 Message-Id: <20211229023348.12606-16-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229023348.12606-1-frank.chang@sifive.com> References: <20211229023348.12606-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1036 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=frank.chang@sifive.com; helo=mail-pj1-x1036.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang Vector widening conversion instructions are provided to and from all supported integer EEWs for Zve32f extension. Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index c3f4dabf36..da0e501f85 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -77,6 +77,17 @@ static bool require_zve32f(DisasContext *s) return s->ext_zve32f ? s->sew <= MO_32 : true; } +static bool require_scale_zve32f(DisasContext *s) +{ + /* RVV + Zve32f = RVV. */ + if (has_ext(s, RVV)) { + return true; + } + + /* Zve32f doesn't support FP64. (Section 18.2) */ + return s->ext_zve64f ? s->sew <= MO_16 : true; +} + static bool require_zve64f(DisasContext *s) { /* RVV + Zve64f = RVV. */ @@ -2356,6 +2367,7 @@ static bool opfvv_widen_check(DisasContext *s, arg_rmrr *a) (s->sew != MO_8) && vext_check_isa_ill(s) && vext_check_dss(s, a->rd, a->rs1, a->rs2, a->vm) && + require_scale_zve32f(s) && require_scale_zve64f(s); } @@ -2396,6 +2408,7 @@ static bool opfvf_widen_check(DisasContext *s, arg_rmrr *a) (s->sew != MO_8) && vext_check_isa_ill(s) && vext_check_ds(s, a->rd, a->rs2, a->vm) && + require_scale_zve32f(s) && require_scale_zve64f(s); } @@ -2427,6 +2440,7 @@ static bool opfwv_widen_check(DisasContext *s, arg_rmrr *a) (s->sew != MO_8) && vext_check_isa_ill(s) && vext_check_dds(s, a->rd, a->rs1, a->rs2, a->vm) && + require_scale_zve32f(s) && require_scale_zve64f(s); } @@ -2467,6 +2481,7 @@ static bool opfwf_widen_check(DisasContext *s, arg_rmrr *a) (s->sew != MO_8) && vext_check_isa_ill(s) && vext_check_dd(s, a->rd, a->rs2, a->vm) && + require_scale_zve32f(s) && require_scale_zve64f(s); } @@ -2731,6 +2746,7 @@ static bool opxfv_widen_check(DisasContext *s, arg_rmr *a) { return opfv_widen_check(s, a) && require_rvf(s) && + require_zve32f(s) && require_zve64f(s); } @@ -2739,6 +2755,7 @@ static bool opffv_widen_check(DisasContext *s, arg_rmr *a) return opfv_widen_check(s, a) && require_scale_rvf(s) && (s->sew != MO_8) && + require_scale_zve32f(s) && require_scale_zve64f(s); } @@ -2791,6 +2808,7 @@ static bool opfxv_widen_check(DisasContext *s, arg_rmr *a) vext_check_isa_ill(s) && /* OPFV widening instructions ignore vs1 check */ vext_check_ds(s, a->rd, a->rs2, a->vm) && + require_scale_zve32f(s) && require_scale_zve64f(s); } From patchwork Wed Dec 29 02:33:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 12700717 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 CC1FFC433F5 for ; Wed, 29 Dec 2021 02:48:05 +0000 (UTC) Received: from localhost ([::1]:58202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2P0W-0007Vu-O3 for qemu-devel@archiver.kernel.org; Tue, 28 Dec 2021 21:48:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56026) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2Onf-0005GH-OM for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:47 -0500 Received: from [2607:f8b0:4864:20::531] (port=33605 helo=mail-pg1-x531.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2One-0004he-1E for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:47 -0500 Received: by mail-pg1-x531.google.com with SMTP id 7so4665881pgn.0 for ; Tue, 28 Dec 2021 18:34:45 -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=jbLe1H2YPzqkbRWWQ+VDyla260n74cDi0uoHKqxIf+k=; b=Slkod0h518utOxYraByj7qZKRVYm2xGMUdmoPL3JS9yuRC8YVdzAMpbBtx53DwbDaO QnJor1rYuN9nU4t8UzBC18OXIihXZCKcqLXgNnbhh2FXbvGI4l6HKoqCdQpTYUt8lB8d vg5qq2W8Xqn01WYCO63EEfLM9T5BmrRS45m/2Ey1Ihv/XNb1Lq5Q2p2X2SZDqU5vWRj4 ytRDANZ81z51PVwdtYSQSNXjB9dCG1WzALlDruebYlK/8ehmIHAsN/DKYZ0Zgr6V11GE 1l5GS9L0eCstXEUv+ilrmz/bbay4ZUBsT3Ihg2EPokQ7fOj5UibQt6Y7TtnyyYkoNXmt N2Pw== 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=jbLe1H2YPzqkbRWWQ+VDyla260n74cDi0uoHKqxIf+k=; b=Fx6dTAY1fmgvJdwu2raUBEIJzIcxYE6GAaguZRj0khzD+fbN/sh2ITYmBBgjiV606m su21SH3H/9bl8cz1cRTLtsM5+WZZHHuXy3vU2BBCCIQCAa0nhXyzR+IEeDt1rnANqEjj aS3ZD32GxTJxnveo/IAVDg1TeYNXZ+tuJilmjFbC+sCohViFQD6pf5JwP75qdsG+n+HK o6cg1V49aaNWGjI0GuGqLue1pbz8so36dNmZmjMoPlCUov4XnarKyg9iNW5P+iHNCqVN v8TT3CeSq1QorUUMTVAr3+SoSFQwqgWn55Qs+ZejoRxGfeIILR5m9ALVd8AT7f4FAqyX s6sg== X-Gm-Message-State: AOAM532aAIDryFITtwE8WVYkfkBIJ58xnXNcFaaLqJJadORJdtAF5IMU 80XdG92oqpYXRY5ePLxgMyRuc42VFzhc7xSZ X-Google-Smtp-Source: ABdhPJwxTBrSoON7JTgbjkdulCtAfIy5MaRegcgq7CtmCPSEjtCs2x5k864lDeA8eSEIeb38hvwWwA== X-Received: by 2002:a63:7f58:: with SMTP id p24mr21873523pgn.109.1640745284647; Tue, 28 Dec 2021 18:34:44 -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 m3sm22613635pjz.10.2021.12.28.18.34.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:34:44 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 16/17] target/riscv: rvv-1.0: Add Zve32f support for narrowing type-convert insns Date: Wed, 29 Dec 2021 10:33:43 +0800 Message-Id: <20211229023348.12606-17-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229023348.12606-1-frank.chang@sifive.com> References: <20211229023348.12606-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::531 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=frank.chang@sifive.com; helo=mail-pg1-x531.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang Vector narrowing conversion instructions are provided to and from all supported integer EEWs for Zve32f extension. Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/insn_trans/trans_rvv.c.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc index da0e501f85..5214cf08db 100644 --- a/target/riscv/insn_trans/trans_rvv.c.inc +++ b/target/riscv/insn_trans/trans_rvv.c.inc @@ -2860,6 +2860,7 @@ static bool opfxv_narrow_check(DisasContext *s, arg_rmr *a) return opfv_narrow_check(s, a) && require_rvf(s) && (s->sew != MO_64) && + require_zve32f(s) && require_zve64f(s); } @@ -2868,6 +2869,7 @@ static bool opffv_narrow_check(DisasContext *s, arg_rmr *a) return opfv_narrow_check(s, a) && require_scale_rvf(s) && (s->sew != MO_8) && + require_scale_zve32f(s) && require_scale_zve64f(s); } @@ -2918,6 +2920,7 @@ static bool opxfv_narrow_check(DisasContext *s, arg_rmr *a) vext_check_isa_ill(s) && /* OPFV narrowing instructions ignore vs1 check */ vext_check_sd(s, a->rd, a->rs2, a->vm) && + require_scale_zve32f(s) && require_scale_zve64f(s); } From patchwork Wed Dec 29 02:33:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Chang X-Patchwork-Id: 12700721 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 2D2B0C433EF for ; Wed, 29 Dec 2021 02:53:31 +0000 (UTC) Received: from localhost ([::1]:39830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2P5m-0005pi-7Q for qemu-devel@archiver.kernel.org; Tue, 28 Dec 2021 21:53:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2Onj-0005X5-Jr for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:51 -0500 Received: from [2607:f8b0:4864:20::531] (port=35723 helo=mail-pg1-x531.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2Onh-0004i3-0P for qemu-devel@nongnu.org; Tue, 28 Dec 2021 21:34:51 -0500 Received: by mail-pg1-x531.google.com with SMTP id v25so17328164pge.2 for ; Tue, 28 Dec 2021 18:34:48 -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=a/1SK78VzpiOsgr0EBerUPE1kdvcozJbIunlylc+UAk=; b=bCs+CeJbVHGEho0BUU7WG63NFsmGGn00dX3t9gtlAhXHE4Fa780nRISC3ahAYXQ54r Y2yoGCN4XOSXsgyd9wBOOJC6SCiOCD8sNhD3t3qH4uo/ft5LpPxHz3m7Qg+jWPaRWKgF zjvICLC1KA3btAzxffGJMSFELh5/sH5+bCYh6yPkHUiDsoYm3+lB6atGZ8B3DlEtBJXV dN8e59+cBzb3JoajbDD6EXjnPDi7fFtNMvXdlcXTVal1Fb5f94RBAyw+R30PbuMYYYW/ AZqKWUu0E8STmKe++x0r5P8uraPxxhL9xi9bydvZBTjaeFqS7ip63+AvpUdicFXFlLHi gEIQ== 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=a/1SK78VzpiOsgr0EBerUPE1kdvcozJbIunlylc+UAk=; b=hNxAoG4PkdI9z6B7gpFR9ndgFNXAYs53pgXIGBxjwhs/sFUdkHpY/skWS9rs0oJxTk Kt6HROktzhIyWHduudEjApNdwcbH2IvLk4mbwwzH5DeiactcR1uATmzptJx+VXanC3T5 L3ehVdbf5yPN48LNKxUTw0jDSgUp7QGPR6Rlyn9KhVnlSBhI0tRmB0STWR1PrcLgswa6 bPkocnKYInL1IuEgriUIbOUUHFCmV3iKvmXueCKOtwT4kCKwNpYAvk8Fv/h/PK3B4ZSh ChJOKFSQ9coGQjl6KGt+3J6bUiJc9MupWHFLTg4YAd0LRj7sxRSIdjN3/LF9V6TfBPzl 8vww== X-Gm-Message-State: AOAM530A4OCvnKjj5DsPllH/6CJCNitL2sJuBn6hPQ0+qHezrmk/8ATk aKeP3eSusZGJBwiNgun1xT9wtbaYXB1D2DEX X-Google-Smtp-Source: ABdhPJxE0ll9A/q8pfh+diU7JBk/vtbtZPvydJwfrY4yS5rUHb2uIZggWOI/uphw2ljKmjVoUWWmeA== X-Received: by 2002:a65:6716:: with SMTP id u22mr21557056pgf.414.1640745287585; Tue, 28 Dec 2021 18:34:47 -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 m3sm22613635pjz.10.2021.12.28.18.34.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Dec 2021 18:34:47 -0800 (PST) From: frank.chang@sifive.com To: qemu-devel@nongnu.org Subject: [PATCH 17/17] target/riscv: rvv-1.0: Allow Zve32f extension to be turned on Date: Wed, 29 Dec 2021 10:33:44 +0800 Message-Id: <20211229023348.12606-18-frank.chang@sifive.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211229023348.12606-1-frank.chang@sifive.com> References: <20211229023348.12606-1-frank.chang@sifive.com> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::531 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=frank.chang@sifive.com; helo=mail-pg1-x531.google.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) 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: Frank Chang , Palmer Dabbelt , Alistair Francis , Bin Meng , qemu-riscv@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Frank Chang Signed-off-by: Frank Chang Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 5e98860a09..2b54c64f56 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -636,6 +636,7 @@ static Property riscv_cpu_properties[] = { DEFINE_PROP_BOOL("Zicsr", RISCVCPU, cfg.ext_icsr, true), DEFINE_PROP_BOOL("Zfh", RISCVCPU, cfg.ext_zfh, false), DEFINE_PROP_BOOL("Zfhmin", RISCVCPU, cfg.ext_zfhmin, false), + DEFINE_PROP_BOOL("Zve32f", RISCVCPU, cfg.ext_zve32f, false), DEFINE_PROP_BOOL("Zve64f", RISCVCPU, cfg.ext_zve64f, false), DEFINE_PROP_BOOL("mmu", RISCVCPU, cfg.mmu, true), DEFINE_PROP_BOOL("pmp", RISCVCPU, cfg.pmp, true),