Commit 3f7be567 authored by Jo Henke's avatar Jo Henke

move clos/cloc/clos1/cloc1 to opcode 6

opcode 4 should be used by 'jeqi' in future
parent 17e63003
Pipeline #23991044 (#8) passed with stage
in 6 minutes and 20 seconds
......@@ -1085,7 +1085,12 @@ invoke: /* nargs and regs ready, maybe gc and execute ob */
ob = (word *)A0;
acc = ip[1];
goto apply;
case 4: { /* opcodes 132, 4, 196, 68 */
case 5: /* mov2 from1 to1 from2 to2 */
A1 = A0;
A3 = A2;
NEXT(4);
case 4: /* FIXME: remove after fasl update */
case 6: { /* opcodes 134, 6, 198, 70 */
word size = *ip++, tmp;
word *ob;
tmp = R[op & 64 ? 1 : *ip++];
......@@ -1096,10 +1101,6 @@ invoke: /* nargs and regs ready, maybe gc and execute ob */
ob[tmp] = R[*ip++];
R[*ip++] = (word)ob;
NEXT(0); }
case 5: /* mov2 from1 to1 from2 to2 */
A1 = A0;
A3 = A2;
NEXT(4);
case 54: /* FIXME: remove after fasl update */
case 7: /* eq? a b r */
A2 = BOOL(A0 == A1);
......@@ -1123,7 +1124,7 @@ invoke: /* nargs and regs ready, maybe gc and execute ob */
ob = V(ob);
A1 = F((hval)ob >> TPOS & 63);
NEXT(2); }
case 16: /* jv[which] a o1 a2 */
case 16: /* jeqi[which] a lo hi */ /* FIXME: move this to op4 after fasl update, and encode offset in big-endian (like most other jump instructions) */
if (A0 == load_imms[op >> 6])
ip += ip[2] << 8 | ip[1];
NEXT(3);
......
......@@ -52,10 +52,10 @@
'((move . 9) ; move a, t: Rt = Ra
(refi . 1) ; refi a, p, t: Rt = Ra[p], p unsigned
(goto . 3) ; jmp a, nargs call Ra with nargs args
(clos . 132) ; clos lp, o, nenv, e0 ... en, t:
(cloc . 4) ; cloc lp, o, nenv, e0 ... en, t:
(clos1 . 196)
(cloc1 . 68)
(clos . 134) ; clos lp, o, nenv, e0 ... en, t:
(cloc . 6) ; cloc lp, o, nenv, e0 ... en, t:
(clos1 . 198)
(cloc1 . 70)
(move2 . 5) ; two moves, 4 args
(jeq . 8) ; jeq a b o1 o2 ip += o if Ra == Rb
(jeqi . 16) ; jeqi a o1 o2 ip += o if Ra == imm[i>>6]
......
......@@ -296,10 +296,6 @@
(lets ((rator nargs bs (get2 (cdr bs))))
(let ((code (list "ob=(word*)R[" rator "];acc=" nargs ";" )))
(values code #n regs)))))
(cons 132 (cify-closer "TCLOS"))
(cons 4 (cify-closer "TPROC"))
(cons 196 (cify-closer-1 "TCLOS"))
(cons 68 (cify-closer-1 "TPROC"))
(cons 5 ;; move2 from1 to1 from2 to2
(λ (bs regs fail)
(lets
......@@ -308,6 +304,10 @@
(regs (put regs to1 (get regs from1 #false)))
(regs (put regs to2 (get regs from2 #false))))
(values (list "R["to1"]=R["from1"];R["to2"]=R["from2"];") bs regs))))
(cons 134 (cify-closer "TCLOS"))
(cons 6 (cify-closer "TPROC"))
(cons 198 (cify-closer-1 "TCLOS"))
(cons 70 (cify-closer-1 "TPROC"))
(cons 7 ;; eq? a b to
(λ (bs regs fail)
(lets ((a b to bs (get3 (cdr bs))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment