svm: Add lost flonum-pred-2-args rule.
authorMatt Birkholz <matt@birkholz.chandler.az.us>
Sat, 24 Aug 2013 22:03:06 +0000 (15:03 -0700)
committerMatt Birkholz <matt@birkholz.chandler.az.us>
Sat, 24 Aug 2013 22:03:06 +0000 (15:03 -0700)
The "new" rule escaped the copying from i386/rulflo.scm(?).  Also
added symlink src/lib/compiler, useful when debugging a broken build.

src/Setup.sh
src/compiler/machines/svm/rules.scm

index 20d9a49585bc89358fb281cca987f94f5f677084..a184ee99f9ca2cbe5556bca26a3228f5f21dfde4 100755 (executable)
@@ -84,6 +84,7 @@ maybe_link lib/edwin ../edwin
 maybe_link lib/include ../microcode
 maybe_link lib/optiondb.scm ../etc/optiondb.scm
 maybe_link lib/runtime ../runtime
+maybe_link lib/compiler ../compiler
 maybe_link lib/mit-scheme.h ../microcode/pruxffi.h
 maybe_link lib/ffi ../ffi
 maybe_link lib/ffi-test-shim.so ../ffi/ffi-test-shim.so
index 827c939008bff298ac1fc1525350e1351c26d3b3..a2543485bfd37685d1f3ea9907a4a6359df9bb72 100644 (file)
@@ -460,6 +460,20 @@ USA.
                        (else (error "Unknown flonum predicate:" predicate)))
                      (float-source source1) temp)
     (inst:load-immediate temp constant)))
+
+(define-rule predicate
+  (FLONUM-PRED-2-ARGS (? predicate)
+                     (OBJECT->FLOAT (CONSTANT (? constant)))
+                     (REGISTER (? source)))
+  (QUALIFIER (flo:flonum? constant))
+  (let ((temp (float-temporary)))
+    (simple-branches! (case predicate
+                       ((FLONUM-EQUAL?) 'EQ)
+                       ((FLONUM-LESS?) 'LT)
+                       ((FLONUM-GREATER?) 'GT)
+                       (else (error "Unknown flonum predicate:" predicate)))
+                     temp (float-source source))
+    (inst:load-immediate temp constant)))
 \f
 (define-rule statement
   (ASSIGN (REGISTER (? target))