#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/sf/gconst.scm,v 4.10 1991/04/20 06:09:48 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/sf/gconst.scm,v 4.11 1991/05/06 18:46:04 jinx Exp $
Copyright (c) 1987-91 Massachusetts Institute of Technology
MIT in each case. |#
;;;; SCode Optimizer: Global Constants List
+;;; package: (scode-optimizer)
(declare (usual-integrations))
\f
MAKE-CELL
MAKE-CHAR
MAKE-NON-POINTER-OBJECT
+ ;; MODULO ; expanded to primitive. Global defn. is not.
NOT
NULL?
OBJECT-CONSTANT?
PAIR?
PRIMITIVE-PROCEDURE-ARITY
PROCESS-TIME-CLOCK
+ ;; QUOTIENT ; expanded to primitive. Global defn. is not.
READ-BITS!
REAL-TIME-CLOCK
+ ;; REMAINDER ; expanded to primitive. Global defn. is not.
SET-CAR!
SET-CDR!
SET-CELL-CONTENTS!
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/sf/make.scm,v 4.16 1991/04/20 06:21:12 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/sf/make.scm,v 4.17 1991/05/06 18:46:39 jinx Exp $
Copyright (c) 1988-91 Massachusetts Institute of Technology
(package/system-loader "sf" '() 'QUERY)
((package/reference (find-package '(SCODE-OPTIMIZER))
'USUAL-INTEGRATIONS/CACHE!))
-(add-system! (make-system "SF" 4 16 '()))
\ No newline at end of file
+(add-system! (make-system "SF" 4 17 '()))
\ No newline at end of file
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/sf/usiexp.scm,v 4.8 1990/10/24 15:09:57 cph Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/sf/usiexp.scm,v 4.9 1991/05/06 18:46:23 jinx Exp $
-Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology
+Copyright (c) 1988-1991 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
MIT in each case. |#
;;;; SCode Optimizer: Usual Integrations: Combination Expansions
+;;; package: (scode-optimizer expansion)
(declare (usual-integrations)
(automagic-integrations)
(eta-substitution)
(integrate-external "object"))
\f
-;;;; N-ary Arithmetic Predicates
+;;;; Fixed-arity arithmetic primitives
(define (make-combination primitive operands)
(combination/make (constant/make primitive) operands))
(if-expanded (make-combination primitive operands))
(if-not-expanded))))
+(define (binary-arithmetic primitive)
+ (lambda (operands if-expanded if-not-expanded block)
+ block
+ (if (and (pair? operands)
+ (pair? (cdr operands))
+ (null? (cddr operands)))
+ (if-expanded (make-combination primitive operands))
+ (if-not-expanded))))
+
(define zero?-expansion
(unary-arithmetic (ucode-primitive zero?)))
(define -1+-expansion
(unary-arithmetic (ucode-primitive -1+)))
+(define quotient-expansion
+ (binary-arithmetic (ucode-primitive quotient 2)))
+
+(define remainder-expansion
+ (binary-arithmetic (ucode-primitive remainder 2)))
+
+(define modulo-expansion
+ (binary-arithmetic (ucode-primitive modulo 2)))
+\f
+;;;; N-ary Arithmetic Predicates
+
(define (pairwise-test binary-predicate if-left-zero if-right-zero)
(lambda (operands if-expanded if-not-expanded block)
block
int:integer?
list
make-string
+ ;; modulo ; Compiler does not currently open-code it.
negative?
number?
positive?
+ quotient
+ remainder
second
seventh
sixth
exact-integer?-expansion
list-expansion
make-string-expansion
+ ;; modulo-expansion
negative?-expansion
complex?-expansion
positive?-expansion
+ quotient-expansion
+ remainder-expansion
second-expansion
seventh-expansion
sixth-expansion
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/sf/make.scm,v 4.16 1991/04/20 06:21:12 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/sf/make.scm,v 4.17 1991/05/06 18:46:39 jinx Exp $
Copyright (c) 1988-91 Massachusetts Institute of Technology
(package/system-loader "sf" '() 'QUERY)
((package/reference (find-package '(SCODE-OPTIMIZER))
'USUAL-INTEGRATIONS/CACHE!))
-(add-system! (make-system "SF" 4 16 '()))
\ No newline at end of file
+(add-system! (make-system "SF" 4 17 '()))
\ No newline at end of file