]>
Witch of Git - jade-rose/blob - toolchain/src/inst.rs
8 pub use self::{decode
::Decode
, encode
::Encode
};
11 use proptest_derive
::Arbitrary
;
13 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
14 #[cfg_attr(test, derive(Arbitrary))]
27 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
28 #[cfg_attr(test, derive(Arbitrary))]
41 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
42 #[cfg_attr(test, derive(Arbitrary))]
55 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
56 #[cfg_attr(test, derive(Arbitrary))]
63 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
64 #[cfg_attr(test, derive(Arbitrary))]
70 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
71 #[cfg_attr(test, derive(Arbitrary))]
73 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
74 #[cfg_attr(test, derive(Arbitrary))]
75 pub struct U3(#[cfg_attr(test, proptest(strategy = "0..=7u8"))] u8);
76 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
77 #[cfg_attr(test, derive(Arbitrary))]
78 pub struct AddImm(#[cfg_attr(test, proptest(strategy = "-64..=127i8"))] i8);
80 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
81 #[cfg_attr(test, derive(Arbitrary))]
90 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
91 #[cfg_attr(test, derive(Arbitrary))]
98 #[derive(Clone, Copy, Debug, PartialEq, Eq)]
99 #[cfg_attr(test, derive(Arbitrary))]
100 #[cfg_attr(test, proptest(no_params))]
115 Mem(LdSt
, Data
, Reg
, bool
),
125 pub fn parse(s
: &str) -> Option
<Self> {
131 pub fn new(x
: u8) -> Option
<Reg
> {
137 pub fn new(x
: u8) -> Option
<U3
> {
139 0..=7 => Some(U3(x
)),
146 pub fn new(x
: i8) -> Option
<AddImm
> {
148 -64..=127 => Some(AddImm(x
)),