Added FLO: replacements for CIELING, FLOOR, ROUND and TRUNCATE.
authorStephen Adams <edu/mit/csail/zurich/adams>
Sat, 4 Nov 1995 16:57:43 +0000 (16:57 +0000)
committerStephen Adams <edu/mit/csail/zurich/adams>
Sat, 4 Nov 1995 16:57:43 +0000 (16:57 +0000)
v8/src/compiler/midend/typerew.scm

index d9b2f6b5f11c4f3649b82c48e4199d177389adbf..3ab848f3679ea90247c0fce5d23588df0b3db162 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: typerew.scm,v 1.8 1995/11/04 04:38:39 adams Exp $
+$Id: typerew.scm,v 1.9 1995/11/04 16:57:43 adams Exp $
 
 Copyright (c) 1994-1995 Massachusetts Institute of Technology
 
@@ -1264,6 +1264,20 @@ MIT in each case. |#
   (def  'ROUND->EXACT     FLO:ROUND->EXACT)
   (def  'TRUNCATE->EXACT  FLO:TRUNCATE->EXACT))
 
+(let ()
+  (define (def op flo:op)
+    (define-typerew-unary-variants-type-method op
+      type:number        type:real          effect:none
+      type:flonum        type:flonum
+      type:exact-number  type:exact-real)
+    (define-typerew-unary-variants-replacement-method op
+      type:flonum        type:flonum     FLO:op))
+  (def  'CEILING   FLO:CEILING)
+  (def  'FLOOR     FLO:FLOOR)
+  (def  'ROUND     FLO:ROUND)
+  (def  'TRUNCATE  FLO:TRUNCATE))
+
+
 (define-typerew-unary-variants-type-method 'COS
   type:number     type:number       effect:none
   type:exact-zero type:exact-one