From: Matt Birkholz <matt@birkholz.chandler.az.us>
Date: Sat, 24 Aug 2013 22:03:06 +0000 (-0700)
Subject: svm: Add lost flonum-pred-2-args rule.
X-Git-Tag: release-9.2.0~144
X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=8a6a3b7e3699b64f8b3e867d4ca3ea2fbc7c971a;p=mit-scheme.git

svm: Add lost flonum-pred-2-args rule.

The "new" rule escaped the copying from i386/rulflo.scm(?).  Also
added symlink src/lib/compiler, useful when debugging a broken build.
---

diff --git a/src/Setup.sh b/src/Setup.sh
index 20d9a4958..a184ee99f 100755
--- a/src/Setup.sh
+++ b/src/Setup.sh
@@ -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
diff --git a/src/compiler/machines/svm/rules.scm b/src/compiler/machines/svm/rules.scm
index 827c93900..a2543485b 100644
--- a/src/compiler/machines/svm/rules.scm
+++ b/src/compiler/machines/svm/rules.scm
@@ -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)))
 
 (define-rule statement
   (ASSIGN (REGISTER (? target))