Added type info for character convertion operations.
authorStephen Adams <edu/mit/csail/zurich/adams>
Fri, 3 Nov 1995 21:11:31 +0000 (21:11 +0000)
committerStephen Adams <edu/mit/csail/zurich/adams>
Fri, 3 Nov 1995 21:11:31 +0000 (21:11 +0000)
v8/src/compiler/midend/typedb.scm

index 9580b5fb7fa9ffbba87d1d32aef785d30cf61c9f..3e161f80b3c4d3236a82ed8a5358dc65af926bf5 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: typedb.scm,v 1.3 1995/10/25 18:35:15 adams Exp $
+$Id: typedb.scm,v 1.4 1995/11/03 21:11:31 adams Exp $
 
 Copyright (c) 1995 Massachusetts Institute of Technology
 
@@ -127,6 +127,39 @@ MIT in each case. |#
   (primitive-procedure-type (list type:any) type:compiled-procedure
                            'function))
 
+\f
+;;; MIT Scheme charatcers have a 7 code-bits + 5 bucky-bits encoding,
+;;; hence some results are fix in bytes:
+
+(define-operator-type (make-primitive-procedure 'CHAR-CODE)
+  (primitive-procedure-type (list type:character) type:unsigned-byte
+                           'function))
+
+(define-operator-type (make-primitive-procedure 'CHAR-BITS)
+  (primitive-procedure-type (list type:character) type:unsigned-byte
+                           'function))
+
+(define-operator-type (make-primitive-procedure 'MAKE-CHAR)
+  (primitive-procedure-type (list type:unsigned-byte type:unsigned-byte)
+                           type:character
+                           'function))
+
+(define-operator-type (make-primitive-procedure 'CHAR->INTEGER)
+  (primitive-procedure-type (list type:character) type:small-fixnum>=0
+                           'function))
+
+(define-operator-type (make-primitive-procedure 'INTEGER->CHAR)
+  (primitive-procedure-type (list type:small-fixnum>=0) type:character
+                           'function))
+
+(define-operator-type (make-primitive-procedure 'CHAR->ASCII)
+  (primitive-procedure-type (list type:character) type:unsigned-byte
+                           'function))
+
+(define-operator-type (make-primitive-procedure 'ASCII->CHAR)
+  (primitive-procedure-type (list type:unsigned-byte type:character)
+                           'function))
+
 
 (let ()