Skip to main content

ab_riscv_primitives/instructions/rv64/zk/
zbkc.rs

1//! RV64 Zbkc extension (subset of Zbc extension)
2
3use crate::instructions::Instruction;
4use crate::instructions::rv64::b::zbc::Rv64ZbcInstruction;
5use crate::registers::general_purpose::Register;
6use ab_riscv_macros::instruction;
7use core::fmt;
8
9/// RISC-V RV64 Zbkc instruction
10#[instruction(
11    reorder = [Clmul, Clmulh],
12    ignore = [Rv64ZbcInstruction],
13    inherit = [Rv64ZbcInstruction],
14)]
15#[derive(Debug, Clone, Copy, PartialEq, Eq)]
16pub enum Rv64ZbkcInstruction<Reg> {}
17
18#[instruction]
19const impl<Reg> Instruction for Rv64ZbkcInstruction<Reg>
20where
21    Reg: [const] Register<Type = u64>,
22{
23    type Reg = Reg;
24
25    #[inline(always)]
26    #[cfg_attr(feature = "no-panic", no_panic_const::no_panic(const))]
27    fn try_decode(instruction: u32) -> Option<Self> {
28        None
29    }
30
31    #[inline(always)]
32    fn alignment() -> u8 {
33        align_of::<u32>() as u8
34    }
35
36    #[inline(always)]
37    fn size(&self) -> u8 {
38        size_of::<u32>() as u8
39    }
40}
41
42#[instruction]
43impl<Reg> fmt::Display for Rv64ZbkcInstruction<Reg>
44where
45    Reg: fmt::Display + Copy,
46{
47    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
48        match self {}
49    }
50}