home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mitsch75.zip / scheme-7_5_17-src.zip / scheme-7.5.17 / src / compiler / back / asutl.scm < prev    next >
Encoding:
Text File  |  1999-01-02  |  1.7 KB  |  58 lines

  1. #| -*-Scheme-*-
  2.  
  3. $Id: asutl.scm,v 1.3 1999/01/02 06:06:43 cph Exp $
  4.  
  5. Copyright (c) 1992, 1999 Massachusetts Institute of Technology
  6.  
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or (at
  10. your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful, but
  13. WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. |#
  21.  
  22. ;;;; Assembler Utilities
  23. ;;; package: (compiler)
  24.  
  25. (declare (usual-integrations))
  26.  
  27. (define-integrable (back-end:= x y)
  28.   (= x y))
  29.  
  30. (define-integrable (back-end:+ x y)
  31.   (+ x y))
  32.  
  33. (define-integrable (back-end:- x y)
  34.   (- x y))
  35.  
  36. (define-integrable (back-end:* x y)
  37.   (* x y))
  38.  
  39. (define-integrable (back-end:quotient x y)
  40.   (quotient x y))
  41.  
  42. (define-integrable (back-end:expt x y)
  43.   (expt x y))
  44.  
  45. (define-integrable (back-end:< x y)
  46.   (< x y))
  47.  
  48. (define make-non-pointer-literal
  49.   (let ((type-maximum (expt 2 scheme-type-width))
  50.     (type-scale-factor (expt 2 scheme-datum-width)))
  51.     (lambda (type datum)
  52.       (if (not (and (exact-nonnegative-integer? type)
  53.             (< type type-maximum)))
  54.       (error "non-pointer type out of range" type))
  55.       (if (not (and (exact-nonnegative-integer? datum)
  56.             (< datum type-scale-factor)))
  57.       (error "non-pointer datum out of range" datum))
  58.       (+ (* type type-scale-factor) datum))))