Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Xbitmanip instructions #1384

Merged
merged 5 commits into from
Jun 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,6 @@ Spike supports the following RISC-V ISA features:
- Zvfbfmin extension, v0.6
- Zvfbfwma extension, v0.6

As a Spike extension, the remainder of the proposed
[Bit-Manipulation Extensions](https://github.com/riscv/riscv-bitmanip)
is provided under the Spike-custom extension name _Xbitmanip_.
These instructions (and, of course, the extension name) are not RISC-V
standards.

These proposed bit-manipulation extensions can be split into further
groups: Zbp, Zbs, Zbe, Zbf, Zbc, Zbm, Zbr, Zbt. Note that Zbc is
ratified, but the original proposal contained some extra instructions
(64-bit carryless multiplies) which are captured here.

To enable these extensions individually, use the Spike-custom
extension names _XZbp_, _XZbs_, _XZbc_, and so on.

Versioning and APIs
-------------------

Expand Down
34 changes: 1 addition & 33 deletions disasm/disasm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2144,38 +2144,6 @@ void disassembler_t::add_instructions(const isa_parser_t* isa)
}
}

if (isa->extension_enabled(EXT_XZBP)) {
DEFINE_ITYPE_SHIFT(grevi);
DEFINE_ITYPE_SHIFT(gorci);
DEFINE_RTYPE(pack);
DEFINE_RTYPE(packh);
DEFINE_RTYPE(packu);
DEFINE_RTYPE(grev);
DEFINE_RTYPE(gorc);
DEFINE_RTYPE(xperm4);
DEFINE_RTYPE(xperm8);
DEFINE_RTYPE(xperm16);
DEFINE_RTYPE(xperm32);
}

if (isa->extension_enabled(EXT_XZBP) ||
isa->extension_enabled(EXT_XZBE) ||
isa->extension_enabled(EXT_XZBF)) {
if(isa->get_max_xlen() == 64) {
DEFINE_RTYPE(packw);
}
}

if (isa->extension_enabled(EXT_XZBT)) {
DEFINE_R3TYPE(cmix);
DEFINE_R3TYPE(fsr);
DEFINE_R3TYPE(fsri);
if(isa->get_max_xlen() == 64) {
DEFINE_R3TYPE(fsriw);
DEFINE_R3TYPE(fsrw);
}
}

if (isa->extension_enabled(EXT_ZICBOM)) {
DISASM_INSN("cbo.clean", cbo_clean, 0, {&base_only_address});
DISASM_INSN("cbo.flush", cbo_flush, 0, {&base_only_address});
Expand Down Expand Up @@ -2252,7 +2220,7 @@ disassembler_t::disassembler_t(const isa_parser_t *isa)

// next-highest priority: other instructions in same base ISA
std::string fallback_isa_string = std::string("rv") + std::to_string(isa->get_max_xlen()) +
"gqchv_zfh_zba_zbb_zbc_zbs_zcb_zicbom_zicboz_zkn_zkr_zks_svinval_xbitmanip";
"gqchv_zfh_zba_zbb_zbc_zbs_zcb_zicbom_zicboz_zkn_zkr_zks_svinval";
isa_parser_t fallback_isa(fallback_isa_string.c_str(), DEFAULT_PRIV);
add_instructions(&fallback_isa);

Expand Down
9 changes: 0 additions & 9 deletions riscv/insns/bcompress.h

This file was deleted.

10 changes: 0 additions & 10 deletions riscv/insns/bcompressw.h

This file was deleted.

9 changes: 0 additions & 9 deletions riscv/insns/bdecompress.h

This file was deleted.

10 changes: 0 additions & 10 deletions riscv/insns/bdecompressw.h

This file was deleted.

10 changes: 0 additions & 10 deletions riscv/insns/bfp.h

This file was deleted.

9 changes: 0 additions & 9 deletions riscv/insns/bfpw.h

This file was deleted.

11 changes: 0 additions & 11 deletions riscv/insns/bmatflip.h

This file was deleted.

29 changes: 0 additions & 29 deletions riscv/insns/bmator.h

This file was deleted.

29 changes: 0 additions & 29 deletions riscv/insns/bmatxor.h

This file was deleted.

6 changes: 0 additions & 6 deletions riscv/insns/clmulhw.h

This file was deleted.

6 changes: 0 additions & 6 deletions riscv/insns/clmulrw.h

This file was deleted.

6 changes: 0 additions & 6 deletions riscv/insns/clmulw.h

This file was deleted.

2 changes: 1 addition & 1 deletion riscv/insns/cmix.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require_either_extension(EXT_ZBPBO, EXT_XZBT);
require_extension(EXT_ZBPBO);
WRITE_RD((RS1 & RS2) | (RS3 & ~RS2));
2 changes: 0 additions & 2 deletions riscv/insns/cmov.h

This file was deleted.

5 changes: 0 additions & 5 deletions riscv/insns/crc32_b.h

This file was deleted.

6 changes: 0 additions & 6 deletions riscv/insns/crc32_d.h

This file was deleted.

5 changes: 0 additions & 5 deletions riscv/insns/crc32_h.h

This file was deleted.

5 changes: 0 additions & 5 deletions riscv/insns/crc32_w.h

This file was deleted.

5 changes: 0 additions & 5 deletions riscv/insns/crc32c_b.h

This file was deleted.

6 changes: 0 additions & 6 deletions riscv/insns/crc32c_d.h

This file was deleted.

5 changes: 0 additions & 5 deletions riscv/insns/crc32c_h.h

This file was deleted.

5 changes: 0 additions & 5 deletions riscv/insns/crc32c_w.h

This file was deleted.

9 changes: 0 additions & 9 deletions riscv/insns/fsl.h

This file was deleted.

10 changes: 0 additions & 10 deletions riscv/insns/fslw.h

This file was deleted.

3 changes: 2 additions & 1 deletion riscv/insns/fsr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require_either_extension(xlen == 32 ? EXT_ZBPBO : EXT_XZBT, EXT_XZBT);
require_rv32;
require_extension(EXT_ZBPBO);
int shamt = RS2 & (2*xlen-1);
reg_t a = RS1, b = RS3;
if (shamt >= xlen) {
Expand Down
3 changes: 2 additions & 1 deletion riscv/insns/fsri.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require_either_extension(xlen == 32 ? EXT_ZBPBO : EXT_XZBT, EXT_XZBT);
require_rv32;
require_extension(EXT_ZBPBO);
int shamt = SHAMT & (2*xlen-1);
reg_t a = RS1, b = RS3;
if (shamt >= xlen) {
Expand Down
10 changes: 0 additions & 10 deletions riscv/insns/fsriw.h

This file was deleted.

2 changes: 1 addition & 1 deletion riscv/insns/fsrw.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require_rv64;
require_either_extension(EXT_ZBPBO, EXT_XZBT);
require_extension(EXT_ZBPBO);
int shamt = RS2 & 63;
reg_t a = RS1, b = RS3;
if (shamt >= 32) {
Expand Down
10 changes: 0 additions & 10 deletions riscv/insns/gorc.h

This file was deleted.

3 changes: 1 addition & 2 deletions riscv/insns/gorci.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Zbb contains orc.b but not general gorci
require(((SHAMT == 7) && p->extension_enabled(EXT_ZBB))
|| p->extension_enabled(EXT_XZBP));
require(((SHAMT == 7) && p->extension_enabled(EXT_ZBB)));
require(SHAMT < xlen);
reg_t x = RS1;
int shamt = SHAMT;
Expand Down
11 changes: 0 additions & 11 deletions riscv/insns/gorciw.h

This file was deleted.

10 changes: 0 additions & 10 deletions riscv/insns/gorcw.h

This file was deleted.

10 changes: 0 additions & 10 deletions riscv/insns/grev.h

This file was deleted.

3 changes: 1 addition & 2 deletions riscv/insns/grevi.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ int shamt = SHAMT;
require(((shamt == xlen - 8) && (p->extension_enabled(EXT_ZBB) || p->extension_enabled(EXT_ZBKB))) //rev8
|| ((shamt == 7) && p->extension_enabled(EXT_ZBKB)) // rev8.b
|| ((shamt == 8) && p->extension_enabled(EXT_ZPN)) // rev8.h
|| ((shamt == xlen - 1) && p->extension_enabled(EXT_ZPN)) // rev
|| p->extension_enabled(EXT_XZBP));
|| ((shamt == xlen - 1) && p->extension_enabled(EXT_ZPN)));
require(shamt < xlen);
reg_t x = RS1;
if (shamt & 1) x = ((x & 0x5555555555555555LL) << 1) | ((x & 0xAAAAAAAAAAAAAAAALL) >> 1);
Expand Down
Loading