From nobody Wed Nov 27 13:47:21 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=utexas.edu ARC-Seal: i=1; a=rsa-sha256; t=1698368860; cv=none; d=zohomail.com; s=zohoarc; b=GTujmkjgMSzFn1FYCMXqiFmBQiUlF1VcAiREUJoZD78X37mUG9SYdT1jYGPqq5/yygwuT+TOQ+pOAFM3LY2iW9cAxgdG8bHlhn0doL1g0sv35a27+5JIrMjnRdBcFCbup7zVFs8n9bPVVWm/bHK2ICXpvzlxJbxJkD+nu++g4X8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698368860; h=Content-Type:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NmwjGbIcZ/ghsW2/DzEo2a2qfsLm/XHOaENBUllfvb8=; b=AfzI4RzmwT2oFeZBt/n0i0X3JU5rHB97qbx7iJu+4RXbnkV2tkeWRjRbfdbk1AQeSxcNXb4CTfAdMIfTyVoACFjFESxdowE5sBf8fK9JL9rm5bJPWeS1c3OPQGpLjDxMNTcrCr6BAeczirIhkM7qRJkdxnyCd0dT2vva3E+h0aU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1698368860335651.9814390451407; Thu, 26 Oct 2023 18:07:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwBJE-0004Qi-1T; Thu, 26 Oct 2023 21:06:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qw9OH-00016L-Vy for qemu-devel@nongnu.org; Thu, 26 Oct 2023 19:03:50 -0400 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qw9OE-000214-SY for qemu-devel@nongnu.org; Thu, 26 Oct 2023 19:03:49 -0400 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-1d542f05b9aso226296fac.1 for ; Thu, 26 Oct 2023 16:03:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=utexas.edu; s=google; t=1698361419; x=1698966219; darn=nongnu.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=NmwjGbIcZ/ghsW2/DzEo2a2qfsLm/XHOaENBUllfvb8=; b=hwUoJXi8G+3RZAVe8zW9DlemEqJwn2w7SLvj56Q22dPgMeBJXQRNKKOn/kWorCavQG ZvHe1pG3TXZ1NVfeG3P1MllDjI5txVd9fwq9d2k4CQDgiYvizuvaCHCzBq1v296Oa/HL 2QIorqUPVICaoPhHUUln0jVPuDpT4152Ir6ICkwaVfHyBDKmgVUyqxH+z+sSWt5+DI7Z B4MSIrP+7Cj0pzO9mXcuTECH7gxvLCEHyMs2r32LShymYwJGekmAL1k9oNG7m50Tz4o1 tTjoqkQN2qDYgbyKmP3MpxGR/1SaIsc94qA4ozFUBrCMAkQoaYRofCO2C2R2lGExmndX Nyqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698361419; x=1698966219; h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=NmwjGbIcZ/ghsW2/DzEo2a2qfsLm/XHOaENBUllfvb8=; b=tIIcamYGvIVVqaAtu5Dbrq3mQWWNHS1a+ReLis9moj9UCUWyG75J7ndYZs1VhwCnFg 417DC5xj5h1miVJ90M/fOYMI4/rZfWG3nX4uL3E2NGKrkS1RPlKUxxobpc9US2pop7S/ aRdXkfM73JtrIhddCfoO8oORRqOyHMIhTTcBNS5VUJWaJNAm/Wg61p6c1XXO3UVzQ5m3 yFr9BJ+CPJyJQT28ZBxSd1RwZsg4GdPIlNptXXa2k5XcwRXwPs5BtgHVEcjsZQFTd/YL 4o+dukmeCa4EcWqFUcsiaWnpgww+uRRtjWS8HAovGTjqzHw3D7+Zxw4RYUsuxMAllugn nmzw== X-Gm-Message-State: AOJu0YwSuV4KTv+csX6k902OCxugn1Lo6CbM9G0IBSyDYbG5jpCsR8S8 WAQbvwAYBQpTk4kpk4CkQiYNlTZIEhRkwrWhRtIXAH60FeJTTEkbwhE= X-Google-Smtp-Source: AGHT+IFwNkIvE316Yl9mxoyBQ47Ge40FUPNYoaXxgt6Ay2NfnfQynuvADL/i8yQzgFujYyjW5iprIRaUU+i2eScUrPA= X-Received: by 2002:a05:6870:af44:b0:1e9:8ab9:11ca with SMTP id uy4-20020a056870af4400b001e98ab911camr1116241oab.3.1698361419276; Thu, 26 Oct 2023 16:03:39 -0700 (PDT) MIME-Version: 1.0 From: Brendan Sweeney Date: Thu, 26 Oct 2023 18:03:28 -0500 Message-ID: Subject: [PATCH] Support for the RISCV Zalasr extension To: qemu-devel@nongnu.org Cc: palmer@dabbelt.com, liweiwei@iscas.ac.cn Content-Type: multipart/alternative; boundary="00000000000018c2ec0608a695da" Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::2d; envelope-from=turtwig@utexas.edu; helo=mail-oa1-x2d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 26 Oct 2023 21:06:43 -0400 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @utexas.edu) X-ZM-MESSAGEID: 1698368862466100002 Content-Transfer-Encoding: quoted-printable --00000000000018c2ec0608a695da MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 RnJvbSA0YWYxZmNhNmU1Yzk5NTc4YTViODBiODM0YzIyYjcwZjY0MTk2MzlmIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBCcmVuZGFuIFN3ZWVuZXkgPHR1cnR3aWdAdXRleGFzLmVkdT4K RGF0ZTogVGh1LCAyNiBPY3QgMjAyMyAxNzowMToyOSAtMDUwMApTdWJqZWN0OiBbUEFUQ0hdIFN1 cHBvcnQgZm9yIHRoZSBSSVNDViBaYWxhc3IgZXh0ZW5zaW9uCgpTaWduZWQtb2ZmLWJ5OiBCcmVu ZGFuIFN3ZWVuZXkgPHR1cnR3aWdAdXRleGFzLmVkdT4KLS0tCnRhcmdldC9yaXNjdi9jcHUuYyB8 IDIgKwp0YXJnZXQvcmlzY3YvY3B1X2NmZy5oIHwgMSArCnRhcmdldC9ya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pbmMiCiNpbmNsdWRlICJpbnNuX3RyYW5zL3Ry YW5zX3J2emF3cnMuYy5pbmMiCiNpbmNsdWRlICJpbnNuX3RyYW5zL3RyYW5zX3J2emljYm8uYy5p bmMiCisjaW5jbHVkZSAiaW5zbl90cmFucy90cmFuc19ydnphbGFzci5jLmluYyIKI2luY2x1ZGUg Imluc25fdHJhbnMvdHJhbnNfcnZ6ZmEuYy5pbmMiCiNpbmNsdWRlICJpbnNuX3RyYW5zL3RyYW5z X3J2emZoLmMuaW5jIgojaW5jbHVkZSAiaW5zbl90cmFucy90cmFuc19ydmsuYy5pbmMiCi0tCjIu MzIuMSAoQXBwbGUgR2l0LTEzMyk= --00000000000018c2ec0608a695da Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
From 4af1fca6e5c99578a5b80b834c22b70f6419639f Mon Sep 17 0= 0:00:00 2001
From: Brendan Sweeney <turtwig@utexas.edu>
Date: Thu, 26 Oct 2023 17:01:29 -0500Subject: [PATCH] Support for the RISCV Zalasr extension

Signed-off-= by: Brendan Sweeney <turtwig@utexa= s.edu>
---
target/riscv/cpu.c | 2 +
target/riscv/cpu_cfg.h = | 1 +
target/riscv/insn32.decode | 15 +++
target/riscv/insn_trans/tra= ns_rvzalasr.c.inc | 112 +++++++++++++++++++
target/riscv/translate.c | 1= +
5 files changed, 131 insertions(+)
create mode 100644 target/riscv= /insn_trans/trans_rvzalasr.c.inc

diff --git a/target/riscv/cpu.c b/t= arget/riscv/cpu.c
index ac4a6c7eec..a0414bd956 100644
--- a/target/ri= scv/cpu.c
+++ b/target/riscv/cpu.c
@@ -85,6 +85,7 @@ const RISCVIsaEx= tData isa_edata_arr[] =3D {
ISA_EXT_DATA_ENTRY(zihintpause, PRIV_VERSION= _1_10_0, ext_zihintpause),
ISA_EXT_DATA_ENTRY(zmmul, PRIV_VERSION_1_12_0= , ext_zmmul),
ISA_EXT_DATA_ENTRY(zawrs, PRIV_VERSION_1_12_0, ext_zawrs),=
+ ISA_EXT_DATA_ENTRY(zalasr, PRIV_VERSION_1_12_0, ext_zalasr),
ISA_E= XT_DATA_ENTRY(zfa, PRIV_VERSION_1_12_0, ext_zfa),
ISA_EXT_DATA_ENTRY(zfb= fmin, PRIV_VERSION_1_12_0, ext_zfbfmin),
ISA_EXT_DATA_ENTRY(zfh, PRIV_VE= RSION_1_11_0, ext_zfh),
@@ -1248,6 +1249,7 @@ const RISCVCPUMultiExtConf= ig riscv_cpu_extensions[] =3D {
MULTI_EXT_CFG_BOOL("zihintpause&quo= t;, ext_zihintpause, true),
MULTI_EXT_CFG_BOOL("zawrs", ext_za= wrs, true),
MULTI_EXT_CFG_BOOL("zfa", ext_zfa, true),
+ MUL= TI_EXT_CFG_BOOL("zalasr", ext_zalasr, true),
MULTI_EXT_CFG_BOO= L("zfh", ext_zfh, false),
MULTI_EXT_CFG_BOOL("zfhmin"= ;, ext_zfhmin, false),
MULTI_EXT_CFG_BOOL("zve32f", ext_zve32f= , false),
diff --git a/target/riscv/cpu_cfg.h b/target/riscv/cpu_cfg.hindex 0e6a0f245c..8e4f9282fd 100644
--- a/target/riscv/cpu_cfg.h
++= + b/target/riscv/cpu_cfg.h
@@ -76,6 +76,7 @@ struct RISCVCPUConfig {
= bool ext_svpbmt;
bool ext_zdinx;
bool ext_zawrs;
+ bool ext_zalasr= ;
bool ext_zfa;
bool ext_zfbfmin;
bool ext_zfh;
diff --git a/ta= rget/riscv/insn32.decode b/target/riscv/insn32.decode
index 33597fe2bb..= ba95cdf964 100644
--- a/target/riscv/insn32.decode
+++ b/target/riscv= /insn32.decode
@@ -70,6 +70,9 @@
@atom_ld ..... aq:1 rl:1 ..... .....= ... ..... ....... &atomic rs2=3D0 %rs1 %rd
@atom_st ..... aq:1 rl:1 = ..... ........ ..... ....... &atomic %rs2 %rs1 %rd
+@l_aq ..... . rl= :1 ..... ........ ..... ....... &atomic rs2=3D0 %rs1 %rd aq=3D1
+@s_= rl ..... aq:1 . ..... ........ ..... ....... &atomic %rs2 %rs1 rd=3D0 r= l=3D1
+
@r4_rm ..... .. ..... ..... ... ..... ....... %rs3 %rs2 %rs1 = %rm %rd
@r_rm ....... ..... ..... ... ..... ....... %rs2 %rs1 %rm %rd@@ -739,6 +742,18 @@ vsetvl 1000000 ..... ..... 111 ..... 1010111 @r
wr= s_nto 000000001101 00000 000 00000 1110011
wrs_sto 000000011101 00000 00= 0 00000 1110011
+# *** RV32 Zalasr Standard Extension ***
+lb_aq 0011= 0 1 . 00000 ..... 000 ..... 0101111 @l_aq
+lh_aq 00110 1 . 00000 ..... 0= 01 ..... 0101111 @l_aq
+lw_aq 00110 1 . 00000 ..... 010 ..... 0101111 @l= _aq
+sb_rl 00111 . 1 ..... ..... 000 00000 0101111 @s_rl
+sh_rl 00111= . 1 ..... ..... 001 00000 0101111 @s_rl
+sw_rl 00111 . 1 ..... ..... 01= 0 00000 0101111 @s_rl
+
+# *** RV64 Zalasr Standard Extension (in add= ition to RV32 Zalasr) ***
+ld_aq 00110 1 . 00000 ..... 011 ..... 0101111= @l_aq
+sd_rl 00111 . 1 ..... ..... 011 00000 0101111 @s_rl
+
# **= * RV32 Zba Standard Extension ***
sh1add 0010000 .......... 010 ..... 01= 10011 @r
sh2add 0010000 .......... 100 ..... 0110011 @r
diff --git a/= target/riscv/insn_trans/trans_rvzalasr.c.inc b/target/riscv/insn_trans/tran= s_rvzalasr.c.inc
new file mode 100644
index 0000000000..cee81ce8b8--- /dev/null
+++ b/target/riscv/insn_trans/trans_rvzalasr.c.inc
@@ = -0,0 +1,112 @@
+/*
+ * RISC-V translation routines for the Zzlasr Sta= ndard Extension.
+ *
+ * Copyright (c) 2023 Brendan Sweeney, brs@berkeley.edu
+ *
+ * This progra= m is free software; you can redistribute it and/or modify it
+ * under t= he terms and conditions of the GNU General Public License,
+ * version 2= or later, as published by the Free Software Foundation.
+ *
+ * This= program is distributed in the hope it will be useful, but WITHOUT
+ * A= NY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ *= FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for+ * more details.
+ *
+ * You should have received a copy of the GN= U General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>= .
+ */
+
+#define REQUIRE_ZALASR(ctx) do { \
+ if (!ctx->cfg= _ptr->ext_zalasr) { \
+ return false; \
+ } \
+} while (0)
+=
+static bool gen_l_aq(DisasContext *ctx, arg_atomic *a, MemOp mop)
+= {
+ TCGv src1;
+
+ decode_save_opc(ctx);
+ src1 =3D get_address= (ctx, a->rs1, 0);
+ if (a->rl) {
+ tcg_gen_mb(TCG_MO_ALL | TCG_= BAR_STRL);
+ }
+ tcg_gen_qemu_ld_tl(load_val, src1, ctx->mem_idx, = mop);
+ if (a->aq) {
+ tcg_gen_mb(TCG_MO_ALL | TCG_BAR_LDAQ);
+= }
+ /* Put data in load_val. */
+ gen_set_gpr(ctx, a->rd, load_va= l);
+
+ return true;
+}
+
+static bool trans_lb_aq(DisasCont= ext *ctx, arg_lb_aq *a)
+{
+ REQUIRE_ZALASR(ctx);
+ return gen_l_a= q(ctx, a, (MO_ALIGN | MO_SB));
+}
+
+static bool trans_lh_aq(Disas= Context *ctx, arg_lh_aq *a)
+{
+ REQUIRE_ZALASR(ctx);
+ return gen= _l_aq(ctx, a, (MO_ALIGN | MO_TESW));
+}
+
+static bool trans_lw_aq= (DisasContext *ctx, arg_lw_aq *a)
+{
+ REQUIRE_ZALASR(ctx);
+ retu= rn gen_l_aq(ctx, a, (MO_ALIGN | MO_TESL));
+}
+
+static bool trans= _ld_aq(DisasContext *ctx, arg_lw_aq *a)
+{
+ REQUIRE_ZALASR(ctx);
= + REQUIRE_64_OR_128BIT(ctx);
+ return gen_l_aq(ctx, a, (MO_ALIGN | MO_TE= SQ));
+}
+
+static bool gen_s_rl(DisasContext *ctx, arg_atomic *a,= MemOp mop)
+{
+ TCGv src1, src2;
+
+ decode_save_opc(ctx);
= + src1 =3D get_address(ctx, a->rs1, 0);
+
+ src2 =3D get_gpr(ctx, = a->rs2, EXT_NONE);
+
+ if (a->rl) {
+ tcg_gen_mb(TCG_MO_ALL = | TCG_BAR_STRL);
+ }
+ tcg_gen_qemu_st_i64(src2, src1, ctx->mem_id= x, mop);
+ if (a->aq) {
+ tcg_gen_mb(TCG_MO_ALL | TCG_BAR_LDAQ);+ }
+
+ return true;
+}
+
+static bool trans_sb_rl(DisasCo= ntext *ctx, arg_sb_rl *a)
+{
+ REQUIRE_ZALASR(ctx);
+ return gen_s= _rl(ctx, a, (MO_ALIGN | MO_SB));
+}
+
+static bool trans_sh_rl(Dis= asContext *ctx, arg_sh_rl *a)
+{
+ REQUIRE_ZALASR(ctx);
+ return g= en_s_rl(ctx, a, (MO_ALIGN | MO_TESW));
+}
+
+static bool trans_sw_= rl(DisasContext *ctx, arg_sw_rl *a)
+{
+ REQUIRE_ZALASR(ctx);
+ re= turn gen_s_rl(ctx, a, (MO_ALIGN | MO_TESL));
+}
+
+static bool tra= ns_sd_rl(DisasContext *ctx, arg_sd_rl *a)
+{
+ REQUIRE_ZALASR(ctx);+ REQUIRE_64_OR_128BIT(ctx);
+ return gen_s_rl(ctx, a, (MO_ALIGN | MO_= TEUQ));
+}
diff --git a/target/riscv/translate.c b/target/riscv/trans= late.c
index f0be79bb16..bfcf1ff1d8 100644
--- a/target/riscv/transla= te.c
+++ b/target/riscv/translate.c
@@ -1091,6 +1091,7 @@ static uint= 32_t opcode_at(DisasContextBase *dcbase, target_ulong pc)
#include "= ;insn_trans/trans_rvzicond.c.inc"
#include "insn_trans/trans_r= vzawrs.c.inc"
#include "insn_trans/trans_rvzicbo.c.inc"+#include "insn_trans/trans_rvzalasr.c.inc"
#include "i= nsn_trans/trans_rvzfa.c.inc"
#include "insn_trans/trans_rvzfh.= c.inc"
#include "insn_trans/trans_rvk.c.inc"
--
2.3= 2.1 (Apple Git-133)


--00000000000018c2ec0608a695da--