All of lore.kernel.org
 help / color / mirror / Atom feed
From: Weiwei Li <liweiwei@iscas.ac.cn>
To: richard.henderson@linaro.org, palmer@dabbelt.com,
	alistair.francis@wdc.com, bin.meng@windriver.com,
	qemu-riscv@nongnu.org, qemu-devel@nongnu.org
Cc: wangjunqiang@iscas.ac.cn, lazyparser@gmail.com,
	Weiwei Li <liweiwei@iscas.ac.cn>
Subject: [PATCH v3 0/9] support subsets of code size reduction extension
Date: Thu, 17 Nov 2022 15:03:07 +0800	[thread overview]
Message-ID: <20221117070316.58447-1-liweiwei@iscas.ac.cn> (raw)

This patchset implements RISC-V Zc* extension v1.0.0.RC5.7 version instructions. 

Specification:
https://github.com/riscv/riscv-code-size-reduction/tree/main/Zc-specification

The port is available here:
https://github.com/plctlab/plct-qemu/tree/plct-zce-upstream-v3

To test Zc* implementation, specify cpu argument with 'x-zca=true,x-zcb=true,x-zcf=true,f=true" and "x-zcd=true,d=true" (or "x-zcmp=true,x-zcmt=true" with c or d=false) to enable Zca/Zcb/Zcf and Zcd(or Zcmp,Zcmt) extension support. 

This implementation can pass the basic zc tests from https://github.com/yulong-plct/zc-test

v3:
* update the solution for Zcf to the way of Zcd
* update Zcb to reuse gen_load/store
* use trans function instead of helper for push/pop

v2:
* add check for relationship between Zca/Zcf/Zcd with C/F/D based on related discussion in review of Zc* spec
* separate c.fld{sp}/fsd{sp} with fld{sp}/fsd{sp} before support of zcmp/zcmt

Weiwei Li (9):
  target/riscv: add cfg properties for Zc* extension
  target/riscv: add support for Zca extension
  target/riscv: add support for Zcf extension
  target/riscv: add support for Zcd extension
  target/riscv: add support for Zcb extension
  target/riscv: add support for Zcmp extension
  target/riscv: add support for Zcmt extension
  target/riscv: expose properties for Zc* extension
  disas/riscv.c: add disasm support for Zc*

 disas/riscv.c                             | 287 ++++++++++++++++-
 target/riscv/cpu.c                        |  56 ++++
 target/riscv/cpu.h                        |   8 +
 target/riscv/cpu_bits.h                   |   7 +
 target/riscv/csr.c                        |  35 +++
 target/riscv/helper.h                     |   3 +
 target/riscv/insn16.decode                |  63 +++-
 target/riscv/insn_trans/trans_rvd.c.inc   |  18 ++
 target/riscv/insn_trans/trans_rvf.c.inc   |  26 +-
 target/riscv/insn_trans/trans_rvi.c.inc   |   4 +-
 target/riscv/insn_trans/trans_rvzce.c.inc | 367 ++++++++++++++++++++++
 target/riscv/insn_trans/trans_rvzfh.c.inc |   6 +-
 target/riscv/machine.c                    |  19 ++
 target/riscv/meson.build                  |   3 +-
 target/riscv/translate.c                  |  15 +-
 target/riscv/zce_helper.c                 |  57 ++++
 16 files changed, 953 insertions(+), 21 deletions(-)
 create mode 100644 target/riscv/insn_trans/trans_rvzce.c.inc
 create mode 100644 target/riscv/zce_helper.c

-- 
2.25.1



             reply	other threads:[~2022-11-17  7:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17  7:03 Weiwei Li [this message]
2022-11-17  7:03 ` [PATCH v3 1/9] target/riscv: add cfg properties for Zc* extension Weiwei Li
2022-11-17  8:54   ` Richard Henderson
2022-11-17  7:03 ` [PATCH v3 2/9] target/riscv: add support for Zca extension Weiwei Li
2022-11-17  8:56   ` Richard Henderson
2022-11-17  7:03 ` [PATCH v3 3/9] target/riscv: add support for Zcf extension Weiwei Li
2022-11-17  8:58   ` Richard Henderson
2022-11-17  7:03 ` [PATCH v3 4/9] target/riscv: add support for Zcd extension Weiwei Li
2022-11-17  7:03 ` [PATCH v3 5/9] target/riscv: add support for Zcb extension Weiwei Li
2022-11-17  9:10   ` Richard Henderson
2022-11-17  7:03 ` [PATCH v3 6/9] target/riscv: add support for Zcmp extension Weiwei Li
2022-11-17  9:44   ` Richard Henderson
2022-11-17 11:41     ` weiwei
2022-11-17  7:03 ` [PATCH v3 7/9] target/riscv: add support for Zcmt extension Weiwei Li
2022-11-17  9:56   ` Richard Henderson
2022-11-17 11:44     ` weiwei
2022-11-17 20:57       ` Richard Henderson
2022-11-18  1:46         ` weiwei
2022-11-18  2:51           ` Richard Henderson
2022-11-18  3:51             ` weiwei
2022-11-17  7:03 ` [PATCH v3 8/9] target/riscv: expose properties for Zc* extension Weiwei Li
2022-11-17  7:03 ` [PATCH v3 9/9] disas/riscv.c: add disasm support for Zc* Weiwei Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221117070316.58447-1-liweiwei@iscas.ac.cn \
    --to=liweiwei@iscas.ac.cn \
    --cc=alistair.francis@wdc.com \
    --cc=bin.meng@windriver.com \
    --cc=lazyparser@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=wangjunqiang@iscas.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.