From 1bfb85bfedc8d97d2d83e4380ec1fdd91f3efa92 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Fri, 19 Jul 2024 15:42:57 -0400 Subject: [PATCH] line: ports +mede --- hoon/codegen/lib/line.hoon | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/hoon/codegen/lib/line.hoon b/hoon/codegen/lib/line.hoon index f882ba9..49c0e96 100644 --- a/hoon/codegen/lib/line.hoon +++ b/hoon/codegen/lib/line.hoon @@ -893,12 +893,30 @@ %3 $(tres t.tres, tree [%both p.i.tres need.i.tres tree]) == - :: XX - :: mede - immediates into need + :: +mede: split immediate into registers of need + :: ++ mede |= [u=@uwoo n=* =need] ^- [@uwoo _gen] - !! + =| todo=(list pole) + =/ tack=(list [n=(unit *) =_need]) [`n need]~ + |- ^- [@uwoo _gen] + ?~ tack + (emit ~ todo %hop u) + ?- -.need.i.tack + %none $(tack t.tack) + %this + ?~ n.i.tack + $(todo [[%poi sass.need.i.tack] todo], tack t.tack) + $(todo [[%imm u.n.i.tack sass.need.i.tack] todo], tack t.tack) + :: + %both + ?~ n.i.tack + $(tack [[~ rite.need.i.tack] [~ left.need.i.tack] t.tack]) + ?@ u.n.i.tack + $(tack [[~ rite.need.i.tack] [~ left.need.i.tack] t.tack]) + $(tack [[`+.u.n.i.tack rite.need.i.tack] [`-.u.n.i.tack left.need.i.tack] t.tack]) + == -- -- =+ ver=%1