Skip to main content

ab_riscv_interpreter/rv64/zk/
zkn.rs

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