Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
neri committed Oct 25, 2024
1 parent 3478105 commit 946be90
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 71 deletions.
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,11 @@ version = "0.1.0"

[features]
default = []
# all = ["float"]
# float = []

[dependencies]
wami_macro = {path="./lib/wami_macro"}

bitflags = {version = "2.6.0", default-features = false}
libm = {version="0.2.8"}
num-traits = {version = "0.2.19", default-features = false}
smallvec = {version = "1.13.2", default-features = false}

[workspace]
Expand Down
17 changes: 13 additions & 4 deletions src/cg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use crate::opcode::*;
use crate::*;
use alloc::boxed::Box;
use alloc::vec::Vec;
use bitflags::*;
use core::cell::RefCell;
use core::fmt;
use smallvec::SmallVec;
Expand All @@ -26,9 +25,19 @@ pub struct WasmCodeBlock {
int_codes: Box<[WasmImc]>,
}

bitflags! {
pub struct WasmBlockFlag: usize {
const LEAF_FUNCTION = 0b0000_0000_0000_0001;
pub struct WasmBlockFlag(usize);

impl WasmBlockFlag {
pub const LEAF_FUNCTION: Self = Self(0b0000_0000_0000_0001);

#[inline]
pub const fn contains(&self, other: Self) -> bool {
(self.0 & other.0) == other.0
}

#[inline]
pub fn remove(&mut self, other: Self) {
self.0 &= !other.0;
}
}

Expand Down
Loading

0 comments on commit 946be90

Please sign in to comment.