Skip to main content

ab_riscv_interpreter/rv32/zk/
zkn.rs

1//! RV32 Zkn extension
2
3pub mod zknd;
4pub mod zkne;
5pub mod zknh;
6
7use crate::rv32::b::zbc::rv32_zbc_helpers;
8use crate::rv32::zk::zbkb::rv32_zbkb_helpers;
9use crate::rv32::zk::zbkx::rv32_zbkx_helpers;
10use crate::rv32::zk::zkn::zknd::rv32_zknd_helpers;
11use crate::rv32::zk::zkn::zkne::rv32_zkne_helpers;
12use crate::rv32::zk::zkn::zknh::rv32_zknh_helpers;
13use crate::{
14    ExecutableInstruction, ExecutableInstructionCsr, ExecutableInstructionOperands, ExecutionError,
15    ExecutionResult, FetchInstructionResult, InstructionFetcher, OpaqueThreadedExecutionResult,
16    RegisterFile, Rs1Rs2OperandValues, Rs1Rs2Operands, ThreadedExecutableInstruction,
17    ThreadedExecutionResult,
18};
19use ab_riscv_macros::instruction_execution;
20use ab_riscv_primitives::prelude::*;
21
22#[instruction_execution]
23const impl<Reg> ExecutableInstructionOperands for Rv32ZknInstruction<Reg> where
24    Reg: Register<Type = u32>
25{
26}
27
28#[instruction_execution]
29const impl<Reg, Env> ExecutableInstructionCsr<Env> for Rv32ZknInstruction<Reg> where
30    Reg: Register<Type = u32>
31{
32}
33
34#[instruction_execution]
35const impl<Reg, Regs, Env, Memory, PC> ExecutableInstruction<Regs, Env, Memory, PC>
36    for Rv32ZknInstruction<Reg>
37where
38    Reg: [const] Register<Type = u32>,
39{
40    #[inline(always)]
41    #[cfg_attr(feature = "no-panic", no_panic_const::no_panic(const))]
42    fn execute(
43        self,
44        Rs1Rs2OperandValues {
45            rs1_value,
46            rs2_value,
47        }: Rs1Rs2OperandValues<<Self::Reg as Register>::Type>,
48        _regs: &mut Regs,
49        _env: &mut Env,
50        _memory: &mut Memory,
51        _program_counter: &mut PC,
52    ) -> ExecutionResult<Self::Reg> {
53        ExecutionResult::ContinueNoWrite
54    }
55}