Skip to main content

ab_riscv_interpreter/v/
zvexx.rs

1//! ZveXx extension
2
3pub mod arith;
4pub mod carry;
5pub mod config;
6pub mod fixed_point;
7pub mod load;
8pub mod mask;
9pub mod muldiv;
10pub mod perm;
11pub mod reduction;
12pub mod store;
13pub mod widen_narrow;
14pub mod zvexx_helpers;
15
16use crate::v::vector_registers::VectorRegistersExt;
17use crate::v::zvexx::arith::zvexx_arith_helpers;
18use crate::v::zvexx::carry::zvexx_carry_helpers;
19use crate::v::zvexx::config::zvexx_config_helpers;
20use crate::v::zvexx::fixed_point::zvexx_fixed_point_helpers;
21use crate::v::zvexx::load::zvexx_load_helpers;
22use crate::v::zvexx::mask::zvexx_mask_helpers;
23use crate::v::zvexx::muldiv::zvexx_muldiv_helpers;
24use crate::v::zvexx::perm::zvexx_perm_helpers;
25use crate::v::zvexx::reduction::zvexx_reduction_helpers;
26use crate::v::zvexx::store::zvexx_store_helpers;
27use crate::v::zvexx::widen_narrow::zvexx_widen_narrow_helpers;
28use crate::zicsr::zicsr_helpers;
29use crate::{
30    CsrError, Csrs, ExecutableInstruction, ExecutableInstructionCsr, ExecutableInstructionOperands,
31    ExecutionError, ProgramCounter, RegisterFile, Rs1Rs2OperandValues, Rs1Rs2Operands,
32    VirtualMemory,
33};
34use ab_riscv_macros::instruction_execution;
35use ab_riscv_primitives::prelude::*;
36use core::fmt;
37use core::ops::ControlFlow;
38
39#[instruction_execution]
40impl<Reg> ExecutableInstructionOperands for ZveXxInstruction<Reg> where Reg: Register {}
41
42#[instruction_execution]
43impl<Reg, ExtState, CustomError> ExecutableInstructionCsr<ExtState, CustomError>
44    for ZveXxInstruction<Reg>
45where
46    Reg: Register,
47{
48}
49
50#[instruction_execution]
51impl<Reg, Regs, ExtState, Memory, PC, InstructionHandler, CustomError>
52    ExecutableInstruction<Regs, ExtState, Memory, PC, InstructionHandler, CustomError>
53    for ZveXxInstruction<Reg>
54where
55    Reg: Register,
56{
57    #[inline(always)]
58    fn execute(
59        self,
60        Rs1Rs2OperandValues {
61            rs1_value,
62            rs2_value,
63        }: Rs1Rs2OperandValues<<Self::Reg as Register>::Type>,
64        regs: &mut Regs,
65        ext_state: &mut ExtState,
66        memory: &mut Memory,
67        program_counter: &mut PC,
68        _system_instruction_handler: &mut InstructionHandler,
69    ) -> Result<
70        ControlFlow<(), (Self::Reg, <Self::Reg as Register>::Type)>,
71        ExecutionError<Reg::Type, CustomError>,
72    > {
73        Ok(ControlFlow::Continue(Default::default()))
74    }
75}