trudging through the snow

This commit is contained in:
2025-05-06 23:27:30 -04:00
parent 9368d6dcd0
commit 0016ede873
29 changed files with 1375 additions and 1085 deletions

View File

@@ -1,14 +1,16 @@
use crate::{compiler::arch::riscv::*, ir::UIdent};
use std::fmt::Debug;
pub type RV64Instruction = LinkerInstruction<RegRef, UIdent>;
use crate::{compiler::arch::riscv::*, ir::IdentID};
pub type RV64Instruction<V = IdentID> = LinkerInstruction<RegRef<V>, V>;
#[derive(Copy, Clone)]
pub enum RegRef {
Var(UIdent),
Reg(Reg),
pub enum RegRef<V = IdentID, R = Reg> {
Var(V),
Reg(R),
}
impl std::fmt::Debug for RegRef {
impl<V: Debug, R: Debug> Debug for RegRef<V, R> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::Var(v) => write!(f, "{{{:?}}}", v),
@@ -16,4 +18,3 @@ impl std::fmt::Debug for RegRef {
}
}
}