diff options
author | Rupert Swarbrick <rswarbrick@gmail.com> | 2022-02-17 22:44:02 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-17 14:44:02 -0800 |
commit | c2f30c33304c96917bdb0ab7e2d4d6a2d71d1d25 (patch) | |
tree | cb63138096f3f5ece762e4ca224cb2830f284bd8 /riscv/insns/crc32c_w.h | |
parent | 8cc6ebead30e00912fa1d254840b6288a16a2a23 (diff) | |
download | spike-c2f30c33304c96917bdb0ab7e2d4d6a2d71d1d25.zip spike-c2f30c33304c96917bdb0ab7e2d4d6a2d71d1d25.tar.gz spike-c2f30c33304c96917bdb0ab7e2d4d6a2d71d1d25.tar.bz2 |
Split Xbitmanip into its proposed component extensions (#918)
Before this patch, spike just had an "Xbitmanip" extension which
covered everything in the proposed bitmanip extension that hadn't been
ratified. The problem is that if you want to model (or verify) a
processor that targetted just some of the proposed bitmanip extension,
you couldn't configure Spike to do that.
For example, the lowRISC Ibex processor has several different
configurations. The "balanced" configuration targetted Zba, Zbb, Zbs,
Zbf and Zbt of the 0.92 spec. With the Zba, Zbb and Zbs ratified,
we'll now be able to use an ISA string like
rv32imc_Zba_Zbb_Zbs_XZbf_XZbt
and Spike will correctly fail to decode instructions like 'bcompress',
which would have been decoded with Xbitmanip.
This patch adds a new custom extension name for each part of the
extension that wasn't fully ratified. These have an 'X' prefix so, for
example, the bit permutation instructions that were proposed as Zbp
can be found under XZbp.
Specifying "Xbitmanip" gets all of these extensions, so its behaviour
should be unchanged.
Note that the slo(i) / sro(i) instructions have been moved from the
proposed Zbb to XZbp. This matches a comment in the Change History
section of v0.93 of the bitmanip spec: it seems that the authors
forgot to also move them in Table 2.1 (which gives the lists of
instructions for each extension). This change won't break anything
that currently exists, but it took quite a while to figure out what
was going on so I thought I'd leave a breadcrumb trail for the next
engineer!
The bulk of the patch is just defining some more entries in the
isa_extension_t enum and rewriting each of the instructions to depend
on the relevant entry. This is mostly a straight textual replacement
but it's slightly more complicated for things like the "pack"
instruction that are defined by several different proposed extensions.
Diffstat (limited to 'riscv/insns/crc32c_w.h')
-rw-r--r-- | riscv/insns/crc32c_w.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/riscv/insns/crc32c_w.h b/riscv/insns/crc32c_w.h index c3ca1a8..8793540 100644 --- a/riscv/insns/crc32c_w.h +++ b/riscv/insns/crc32c_w.h @@ -1,4 +1,4 @@ -require_extension(EXT_XBITMANIP); +require_extension(EXT_XZBR); reg_t x = zext_xlen(RS1); for (int i = 0; i < 32; i++) x = (x >> 1) ^ (0x82F63B78 & ~((x&1)-1)); |