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 / sparc / instr2b.scm < prev    next >
Encoding:
Text File  |  1999-01-02  |  2.3 KB  |  81 lines

  1. #| -*-Scheme-*-
  2.  
  3. $Id: instr2b.scm,v 1.2 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. ;;;; SPARC 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-fff #xfff)
  35.            (LONG (2 3)
  36.              (5 source/dest-reg)
  37.              (6 ,opcode)
  38.              (5 base-reg)
  39.              (1 1)
  40.              (13 delta SIGNED)))
  41.           ((() ())
  42.            ;; SETHI  1, %hi(offset)
  43.            ;; OR     1, 1, %lo(offset)
  44.            ;; LD     source/dest-reg,1,base-reg
  45.            (LONG (2 0)        ; SETHI
  46.              (5 1)
  47.              (3 4)
  48.              (22 (high-bits delta))
  49.              
  50.              (2 2)        ; OR
  51.              (5 1)
  52.              (6 2)
  53.              (5 1)
  54.              (1 1)
  55.              (13 (low-bits delta))
  56.  
  57.              (2 3)        ; LD
  58.              (5 source/dest-reg)
  59.              (6 ,opcode)
  60.              (5 1)
  61.              (1 0)
  62.              (8 0)
  63.              (5 base-reg)))))))))
  64.   (load/store-instruction ldsb 9)
  65.   (load/store-instruction ldsh 10)
  66.   (load/store-instruction ldub 1)
  67.   (load/store-instruction lduh 2)
  68.   (load/store-instruction ld 0)
  69.   (load/store-instruction ldd 3)
  70.   (load/store-instruction stb 5)
  71.   (load/store-instruction sth 6)
  72.   (load/store-instruction st 4)
  73.   (load/store-instruction std 7)
  74.   (load/store-instruction ldf 32)
  75.   (load/store-instruction lddf 35)
  76.   (load/store-instruction ldfsr 33)
  77.   (load/store-instruction stf 36)
  78.   (load/store-instruction ltdf 39)
  79.   (load/store-instruction stfsr 37)
  80.   )
  81.