From: Matt Birkholz Date: Mon, 30 Jan 2017 18:47:27 +0000 (-0700) Subject: Replace unbound ascii-char? with char->... stolen from LIAR/x86-64. X-Git-Tag: mit-scheme-pucked-9.2.12~227^2~15 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=cce1e85d5cdd3a79cbadb69cf015132d24c1e7f7;p=mit-scheme.git Replace unbound ascii-char? with char->... stolen from LIAR/x86-64. --- diff --git a/src/compiler/machines/svm/rules.scm b/src/compiler/machines/svm/rules.scm index cdb501f68..a8b495de2 100644 --- a/src/compiler/machines/svm/rules.scm +++ b/src/compiler/machines/svm/rules.scm @@ -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))