guile-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile/guile-lightning rod.scm


From: Marius Vollmer
Subject: guile/guile-lightning rod.scm
Date: Mon, 19 Mar 2001 18:00:55 -0800

CVSROOT:        /cvs
Module name:    guile
Changes by:     Marius Vollmer <address@hidden> 01/03/19 18:00:55

Modified files:
        guile-lightning: rod.scm 

Log message:
        * rod.scm: Add "b" instruction as "jmpi" with a label target.
        (unconditional-branch): New instruction type.
        (1rop): Ignore type if it is `#f'.

CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/guile/guile-lightning/rod.scm.diff?r1=1.1.1.1&r2=1.2

Patches:
Index: guile/guile-lightning/rod.scm
diff -u guile/guile-lightning/rod.scm:1.1 guile/guile-lightning/rod.scm:1.2
--- guile/guile-lightning/rod.scm:1.1   Mon Mar 19 15:52:01 2001
+++ guile/guile-lightning/rod.scm       Mon Mar 19 18:00:55 2001
@@ -152,6 +152,8 @@
        (else
        (loop (read-line)))))))
 
+(add-op 'b "jmpi" #f 'unconditional-branch)
+
 (define (@ . args)
   (apply format #t args))
 
@@ -217,11 +219,21 @@
                    (op-name op) (op-type op))
                 (@ "  }\n")
                 (@ "  add_label_ref (label_hash, insn_1, ref);\n"))
+               ((unconditional-branch)
+                (@ "  jit_insn *lab, *ref;\n")
+                (@ "  ASSERT_LEN (1);\n")
+                (@ "  ASSERT_SYM (insn_1);\n")
+                (@ "  lab = get_label_def (label_hash, insn_1);\n")
+                (@ "  if (lab == NULL) lab = jit_forward ();\n")
+                (@ "  ref = jit_~A (lab);\n" (op-name op))
+                (@ "  add_label_ref (label_hash, insn_1, ref);\n"))
                ((1rop)
                 (@ "  int r;\n")
                 (@ "  ASSERT_LEN (1);\n")
                 (@ "  r = AS_REG (insn_1);\n")
-                (@ "  jit_~A_~A (r);\n" (op-name op) (op-type op)))
+                (if (op-type op)
+                    (@ "  jit_~A_~A (r);\n" (op-name op) (op-type op))
+                    (@ "  jit_~A (r);\n" (op-name op) (op-type op))))
                ((2rop)
                 (@ "  int r1, r2;\n")
                 (@ "  ASSERT_LEN (2);\n")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]