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 / machines / mips / instr2b.scm < prev    next >
Text File  |  1999-01-02  |  2KB  |  78 lines

  1. #| -*-Scheme-*-
  2.  
  3. $Id: instr2b.scm,v 1.4 1999/01/02 06:06:43 cph Exp $
  4.  
  5. Copyright (c) 1987-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. ;;;; MIPS instruction set, part 2b
  23.  
  24. (declare (usual-integrations))
  25.  
  26. ;;;; Instructions that require branch tensioning: load/store
  27.  
  28. (let-syntax
  29.     ((load/store-instruction
  30.       (macro (keyword opcode)
  31.     `(define-instruction ,keyword
  32.        (((? source/dest-reg) (OFFSET (? offset-ls) (? base-reg)))
  33.         (VARIABLE-WIDTH (delta offset-ls)
  34.               ((#x-8000 #x7fff)
  35.            (LONG (6 ,opcode)
  36.              (5 base-reg)
  37.              (5 source/dest-reg)
  38.              (16 delta SIGNED)))
  39.           ((() ())
  40.            ;; LUI    1,adjusted-left<offset>
  41.            ;; ADDU   1,1,base-reg
  42.            ;; LW     source/dest-reg,right<offset>(1)
  43.            (LONG (6 15)    ; LUI
  44.              (5 0)
  45.              (5 1)
  46.              (16 (adjusted:high delta))
  47.              (6 0)    ; ADD
  48.              (5 1)
  49.              (5 base-reg)
  50.              (5 1)
  51.              (5 0)
  52.              (6 32)
  53.              (6 ,opcode); LW
  54.              (5 1)
  55.              (5 source/dest-reg)
  56.              (16 (adjusted:low delta) SIGNED)))))))))
  57.   (load/store-instruction lb 32)
  58.   (load/store-instruction lbu 36)
  59.   (load/store-instruction lh 33)
  60.   (load/store-instruction lhu 37)
  61.   (load/store-instruction lw 35)
  62.   ;; (load/store-instruction lwc0 48)
  63.   (load/store-instruction lwc1 49)
  64.   ;; (load/store-instruction lwc2 50)
  65.   ;; (load/store-instruction lwc3 51)
  66.   ;; (load/store-instruction lwl 34)
  67.   ;; (load/store-instruction lwr 38)
  68.   (load/store-instruction sb 40)
  69.   (load/store-instruction sh 41)
  70.   (load/store-instruction sw 43)
  71.   ;; (load/store-instruction swc0 56)
  72.   (load/store-instruction swc1 57)
  73.   ;; (load/store-instruction swc2 58)
  74.   ;; (load/store-instruction swc3 59)
  75.   ;; (load/store-instruction swl 42)
  76.   ;; (load/store-instruction swr 46)
  77.   )
  78.