machine_check_common/
ir_common.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
4pub enum IrReference {
5 Immutable,
6 None,
7}
8
9#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
10pub struct IrTypeArray {
11 pub index_width: u32,
12 pub element_width: u32,
13}
14
15#[derive(
16 Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, strum::EnumString, strum::Display,
17)]
18pub enum IrMckUnaryOp {
19 #[strum(to_string = "::mck::forward::Bitwise::bit_not")]
20 Not,
21 #[strum(to_string = "::std::ops::Neg::neg")]
22 Neg,
23}
24
25#[derive(
26 Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, strum::EnumString, strum::Display,
27)]
28pub enum IrMckBinaryOp {
29 #[strum(to_string = "::mck::forward::Bitwise::bit_and")]
31 BitAnd,
32 #[strum(to_string = "::mck::forward::Bitwise::bit_or")]
33 BitOr,
34 #[strum(to_string = "::mck::forward::Bitwise::bit_xor")]
35 BitXor,
36 #[strum(to_string = "::mck::forward::HwShift::logic_shl")]
38 LogicShl,
39 #[strum(to_string = "::mck::forward::HwShift::logic_shr")]
40 LogicShr,
41 #[strum(to_string = "::mck::forward::HwShift::arith_shr")]
42 ArithShr,
43 #[strum(to_string = "::mck::forward::HwArith::add")]
45 Add,
46 #[strum(to_string = "::mck::forward::HwArith::sub")]
47 Sub,
48 #[strum(to_string = "::mck::forward::HwArith::mul")]
49 Mul,
50 #[strum(to_string = "::mck::forward::HwArith::udiv")]
51 Udiv,
52 #[strum(to_string = "::mck::forward::HwArith::urem")]
53 Urem,
54 #[strum(to_string = "::mck::forward::HwArith::sdiv")]
55 Sdiv,
56 #[strum(to_string = "::mck::forward::HwArith::srem")]
57 Srem,
58 #[strum(to_string = "::mck::forward::TypedEq::eq")]
60 Eq,
61 #[strum(to_string = "::mck::forward::TypedEq::ne")]
62 Ne,
63 #[strum(to_string = "::mck::forward::TypedCmp::ult")]
65 Ult,
66 #[strum(to_string = "::mck::forward::TypedCmp::ule")]
67 Ule,
68 #[strum(to_string = "::mck::forward::TypedCmp::slt")]
69 Slt,
70 #[strum(to_string = "::mck::forward::TypedCmp::sle")]
71 Sle,
72}
73
74#[derive(Clone, Debug, Hash, strum::EnumString, strum::Display)]
75pub enum IrStdUnaryOp {
76 #[strum(to_string = "::std::ops::Not::not")]
77 Not,
78 #[strum(to_string = "::std::ops::Neg::neg")]
79 Neg,
80}
81
82#[derive(Clone, Debug, Hash, strum::EnumString, strum::Display)]
83pub enum IrStdBinaryOp {
84 #[strum(to_string = "::std::ops::BitAnd::bitand")]
86 BitAnd,
87 #[strum(to_string = "::std::ops::BitOr::bitor")]
88 BitOr,
89 #[strum(to_string = "::std::ops::BitXor::bitxor")]
90 BitXor,
91 #[strum(to_string = "::std::ops::Shl::shl")]
93 Shl,
94 #[strum(to_string = "::std::ops::Shr::shr")]
95 Shr,
96 #[strum(to_string = "::std::ops::Add::add")]
98 Add,
99 #[strum(to_string = "::std::ops::Sub::sub")]
100 Sub,
101 #[strum(to_string = "::std::ops::Mul::mul")]
102 Mul,
103 #[strum(to_string = "::std::ops::Div::div")]
104 Div,
105 #[strum(to_string = "::std::ops::Rem::rem")]
106 Rem,
107 #[strum(to_string = "::std::cmp::PartialEq::eq")]
109 Eq,
110 #[strum(to_string = "::std::cmp::PartialEq::ne")]
111 Ne,
112 #[strum(to_string = "::std::cmp::PartialOrd::lt")]
114 Lt,
115 #[strum(to_string = "::std::cmp::PartialOrd::le")]
116 Le,
117 #[strum(to_string = "::std::cmp::PartialOrd::gt")]
118 Gt,
119 #[strum(to_string = "::std::cmp::PartialOrd::ge")]
120 Ge,
121}