MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / lit_math

Function lit_math

crates/ir-to-asm/src/compiler/register_allocator.rs:147–155  ·  view source on GitHub ↗
(dest: &str, lhs: i64, rhs: i64)

Source from the content-addressed store, hash-verified

145
146 fn lit_math(dest: &str, lhs: i64, rhs: i64) -> IrInstruction {
147 IrInstruction::Math {
148 dest: reg(dest),
149 op: IrMathOp::Add,
150 ty: i64_ty(),
151 lhs: IrValue::Integer(lhs),
152 rhs: IrValue::Integer(rhs),
153 }
154 }
155
156 fn alloc_for(func: &IrFunction) -> FunctionContext {
157 let mut ctx = FunctionContext::new(&StdHashMap::new());
158 assign_stack_slots(func, &mut ctx, &StdHashMap::new(), true, false);

Calls 2

regFunction · 0.70
i64_tyFunction · 0.70