~ubuntu-branches/ubuntu/intrepid/mit-scheme/intrepid-updates

« back to all changes in this revision

Viewing changes to src/compiler/machines/bobcat/flinstr1.scm

  • Committer: Bazaar Package Importer
  • Author(s): Chris Hanson
  • Date: 2002-03-14 17:04:07 UTC
  • Revision ID: james.westby@ubuntu.com-20020314170407-m5lg1d6bdsl9lv0s
Tags: upstream-7.7.0
ImportĀ upstreamĀ versionĀ 7.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#| -*-Scheme-*-
 
2
 
 
3
$Id: flinstr1.scm,v 1.4 2002/02/22 03:14:49 cph Exp $
 
4
 
 
5
Copyright (c) 1988-1989, 1999, 2001-2002 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., 59 Temple Place - Suite 330, Boston, MA
 
20
02111-1307, USA.
 
21
|#
 
22
 
 
23
;;;; Instruction set description for 68881 floating point processor
 
24
;;; Originally provided courtesy of BBN ACI.
 
25
 
 
26
;;; These instructions are not handled: FDBcc FMOVECR FMOVEM FNOP FRESTORE FSAVE
 
27
;;; FScc FSINCOS FTRAPcc
 
28
 
 
29
(declare (usual-integrations))
 
30
 
 
31
(define FPC #b001)                      ; Floating point chip identifier for
 
32
                                        ;   coprocessor instructions.
 
33
(define-symbol-transformer
 
34
  float-source-format
 
35
  (L . 0)                               ; long word integer
 
36
  (S . 1)                               ; single precision real
 
37
  (X . 2)                               ; extended precision real
 
38
  (P . 3)                               ; packed decimal real
 
39
  (W . 4)                               ; word integer
 
40
  (D . 5)                               ; double precision real
 
41
  (B . 6))                              ; byte integer
 
42
 
 
43
(define-symbol-transformer
 
44
  float-destination-format
 
45
  (L . 0)                               ; long word integer
 
46
  (S . 1)                               ; single precision real
 
47
  (X . 2)                               ; extended precision real
 
48
  (W . 4)                               ; word integer
 
49
  (D . 5)                               ; double precision real
 
50
  (B . 6))                              ; byte integer
 
51
 
 
52
(define-symbol-transformer float-reg
 
53
  (FP0 . 0) (FP1 . 1) (FP2 . 2) (FP3 . 3)
 
54
  (FP4 . 4) (FP5 . 5) (FP6 . 6) (FP7 . 7))
 
55
 
 
56
(define-symbol-transformer float-ctl-reg
 
57
  (FPCR . 4) (FPSR . 2) (FPIAR 1))
 
58
 
 
59
(define-symbol-transformer float-cc
 
60
  (EQ . 1) (NE . 14) (GT . 2) (NGT . 13)
 
61
  (GE . 3) (NGE . 12) (LT . 4) (NLT . 11)
 
62
  (LE . 5) (NLE . 10) (GL . 6) (NGL . 9)
 
63
  (MI . 4) (PL . 3)
 
64
  (GLE . 7) (NGLE . 8) (F . 0) (T . 15))
 
65
 
 
66
(define-instruction FMOVE
 
67
 
 
68
  (((? type float-source-format) (? source ea-d) (? destination float-reg))
 
69
   (WORD (4 #b1111)
 
70
         (3 FPC)
 
71
         (3 #b000)
 
72
         (6 source SOURCE-EA 'L))
 
73
   (EXTENSION-WORD (3 #b010)
 
74
                   (3 type)
 
75
                   (3 destination)
 
76
                   (7 #b0000000)))
 
77
  
 
78
  (((? source float-reg) (? destination float-reg))
 
79
   (WORD (4 #b1111)
 
80
         (3 FPC)
 
81
         (3 #b000)
 
82
         (6 #b000000))
 
83
   (EXTENSION-WORD (3 #b000)
 
84
                   (3 source)
 
85
                   (3 destination)
 
86
                   (7 #b0000000)))
 
87
 
 
88
  (((? type float-destination-format)
 
89
    (? source float-reg)
 
90
    (? destination ea-d&a))
 
91
   (WORD (4 #b1111)
 
92
         (3 FPC)
 
93
         (3 #b000)
 
94
         (6 destination DESTINATION-EA 'L))
 
95
   (EXTENSION-WORD (3 #b011)
 
96
                   (3 type)
 
97
                   (3 source)
 
98
                   (7 #b0000000)))
 
99
 
 
100
  (((P (? k-factor)) (? source float-reg) (? destination ea-d&a))
 
101
   (WORD (4 #b1111)
 
102
         (3 FPC)
 
103
         (3 #b000)
 
104
         (6 destination DESTINATION-EA 'L))
 
105
   (EXTENSION-WORD (3 #b011)
 
106
                   (3 #b011)
 
107
                   (3 source)
 
108
                   (7 k-factor)))
 
109
 
 
110
  (((PD (? k-reg)) (? source float-reg) (? destination ea-d&a))
 
111
   (WORD (4 #b1111)
 
112
         (3 FPC)
 
113
         (3 #b000)
 
114
         (6 destination DESTINATION-EA 'L))
 
115
   (EXTENSION-WORD (3 #b011)
 
116
                   (3 #b111)
 
117
                   (3 source)
 
118
                   (3 k-reg)
 
119
                   (4 #b0000)))
 
120
 
 
121
  ((L (? source ea-d) (? destination float-ctl-reg))
 
122
   (WORD (4 #b1111)
 
123
         (3 FPC)
 
124
         (3 #b000)
 
125
         (6 source SOURCE-EA 'L))
 
126
   (EXTENSION-WORD (3 #b100)
 
127
                   (3 destination)
 
128
                   (10 #b0000000000)))
 
129
 
 
130
  ((L (? source float-ctl-reg) (? destination ea-d))
 
131
   (WORD (4 #b1111)
 
132
         (3 FPC)
 
133
         (3 #b000)
 
134
         (6 destination DESTINATION-EA 'L))
 
135
   (EXTENSION-WORD (3 #b101)
 
136
                   (3 source)
 
137
                   (10 #b0000000000))))
 
138
 
 
139
(let-syntax
 
140
    ((define-unary-flop
 
141
       (sc-macro-transformer
 
142
        (lambda (form environment)
 
143
          environment
 
144
          `(DEFINE-INSTRUCTION ,(cadr form)
 
145
 
 
146
             (((? type float-source-format)
 
147
               (? source ea-d)
 
148
               (? destination float-reg))
 
149
              (WORD (4 #b1111)
 
150
                    (3 FPC)
 
151
                    (3 #b000)
 
152
                    (6 source SOURCE-EA 'L))
 
153
              (EXTENSION-WORD (3 #b010)
 
154
                              (3 type)
 
155
                              (3 destination)
 
156
                              (7 ,(caddr form))))
 
157
 
 
158
             (((? source float-reg) (? destination float-reg))
 
159
              (WORD (4 #b1111)
 
160
                    (3 FPC)
 
161
                    (3 #b000)
 
162
                    (6 #b000000))
 
163
              (EXTENSION-WORD (3 #b000)
 
164
                              (3 source)
 
165
                              (3 destination)
 
166
                              (7 ,(caddr form))))
 
167
 
 
168
             (((? reg float-reg))
 
169
              (WORD (4 #b1111)
 
170
                    (3 FPC)
 
171
                    (3 #b000)
 
172
                    (6 #b000000))
 
173
              (EXTENSION-WORD (3 #b000)
 
174
                              (3 reg)
 
175
                              (3 reg)
 
176
                              (7 ,(caddr form)))))))))
 
177
  (define-unary-flop FABS       #b0011000)
 
178
  (define-unary-flop FACOS      #b0011100)
 
179
  (define-unary-flop FASIN      #b0001100)
 
180
  (define-unary-flop FATAN      #b0001010)
 
181
  (define-unary-flop FATANH     #b0001101)
 
182
  (define-unary-flop FCOS       #b0011101)
 
183
  (define-unary-flop FCOSH      #b0011001)
 
184
  (define-unary-flop FETOX      #b0010000)
 
185
  (define-unary-flop FETOXM1    #b0001000)
 
186
  (define-unary-flop FGETEXP    #b0011110)
 
187
  (define-unary-flop FGETMAN    #b0011111)
 
188
  (define-unary-flop FINT       #b0000001)
 
189
  (define-unary-flop FINTRZ     #b0000011)
 
190
  (define-unary-flop FLOG10     #b0010101)
 
191
  (define-unary-flop FLOG2      #b0010110)
 
192
  (define-unary-flop FLOGN      #b0010100)
 
193
  (define-unary-flop FLOGNP1    #b0000110)
 
194
  (define-unary-flop FNEG       #b0011010)
 
195
  (define-unary-flop FSIN       #b0001110)
 
196
  (define-unary-flop FSINH      #b0000010)
 
197
  (define-unary-flop FSQRT      #b0000100)
 
198
  (define-unary-flop FTAN       #b0001111)
 
199
  (define-unary-flop FTANH      #b0001001)
 
200
  (define-unary-flop FTENTOX    #b0010010)
 
201
  (define-unary-flop FTWOTOX    #b0010001))
 
 
b'\\ No newline at end of file'