Replace unbound ascii-char? with char->... stolen from LIAR/x86-64.
authorMatt Birkholz <matt@birchwood-abbey.net>
Mon, 30 Jan 2017 18:47:27 +0000 (11:47 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Mon, 30 Jan 2017 18:47:27 +0000 (11:47 -0700)
src/compiler/machines/svm/rules.scm

index cdb501f68633474f2c65c71a2c409731d4eab3e0..a8b495de256c812927e006194391bca170d83a5c 100644 (file)
@@ -228,9 +228,12 @@ USA.
 (define-rule statement
   (ASSIGN (REGISTER (? target))
          (CHAR->ASCII (CONSTANT (? char))))
-  (QUALIFIER (ascii-char? char))
   (inst:load-immediate (word-target target)
-                      (object-datum char)))
+                      (char->signed-8-bit-immediate char)))
+
+(define (char->signed-8-bit-immediate character)
+  (let ((ascii (char->integer character)))
+    (if (< ascii 128) ascii (- ascii 256))))
 
 (define-rule predicate
   (TYPE-TEST (REGISTER (? source)) (? type))