wasmer_compiler_singlepass/common_decl.rs
1#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd)]
2pub enum Size {
3 S8,
4 S16,
5 S32,
6 S64,
7}
8
9impl Size {
10 pub fn bits(&self) -> u32 {
11 8 * self.bytes()
12 }
13
14 pub fn bytes(&self) -> u32 {
15 match self {
16 Size::S8 => 1,
17 Size::S16 => 2,
18 Size::S32 => 4,
19 Size::S64 => 8,
20 }
21 }
22}