who knows

This commit is contained in:
2024-11-26 22:42:39 -05:00
parent 87f755b763
commit 31c197e991
10 changed files with 17 additions and 3 deletions

View File

@@ -1,3 +1,13 @@
trait Add {
fn add(self, other: Self) -> Self
}
impl Add for b32 {
asm fn add(self, other) {
add {out}, {self}, {other}
}
}
fn main() { fn main() {
asm { asm {
li a0, 3 li a0, 3

View File

@@ -0,0 +1,2 @@
pub enum Instruction {
}

View File

@@ -9,6 +9,7 @@ mod elf;
mod program; mod program;
pub mod riscv64; pub mod riscv64;
mod target; mod target;
mod instruction;
pub use program::*; pub use program::*;

0
src/ir/lvl2/mod.rs Normal file
View File

View File

@@ -1,8 +1,9 @@
mod namespace; mod namespace;
mod structure; mod lvl1;
mod lvl2;
mod file; mod file;
pub use namespace::*; pub use namespace::*;
pub use structure::*; pub use lvl1::*;
pub use file::*; pub use file::*;

View File

@@ -33,7 +33,7 @@ impl Debug for Statement {
match self { match self {
Statement::Let(n, e) => { Statement::Let(n, e) => {
f.write_str("let ")?; f.write_str("let ")?;
n.fmt(f); n.fmt(f)?;
f.write_str(" = ")?; f.write_str(" = ")?;
e.fmt(f)?; e.fmt(f)?;
f.write_char(';')?; f.write_char(';')?;