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> ExecutableInstructionOperands for Rv64ZknInstruction<Reg> where
23    Reg: Register<Type = u64>
24{
25}
26
27#[instruction_execution]
28const impl<Reg, Env> ExecutableInstructionCsr<Env> for Rv64ZknInstruction<Reg> where
29    Reg: Register<Type = u64>
30{
31}
32
33#[instruction_execution]
34const impl<Reg, Regs, Env, Memory, PC> ExecutableInstruction<Regs, Env, Memory, PC>
35    for Rv64ZknInstruction<Reg>
36where
37    Reg: [const] Register<Type = u64>,
38{
39    #[inline(always)]
40    #[cfg_attr(feature = "no-panic", no_panic_const::no_panic(const))]
41    fn execute(
42        self,
43        Rs1Rs2OperandValues {
44            rs1_value,
45            rs2_value,
46        }: Rs1Rs2OperandValues<<Self::Reg as Register>::Type>,
47        _regs: &mut Regs,
48        _env: &mut Env,
49        _memory: &mut Memory,
50        _program_counter: &mut PC,
51    ) -> ExecutionResult<Self::Reg> {
52        ExecutionResult::ContinueNoWrite
53    }
54}