Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/MLRISC/sparc/instructions/sparcInstr.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/sparc/instructions/sparcInstr.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 245, Sat Apr 17 18:47:12 1999 UTC revision 411, Fri Sep 3 00:25:03 1999 UTC
# Line 1  Line 1 
 functor SparcInstr(structure Const : CONSTANT  
                    structure Region : REGION  
 (*  
                    structure Annotations : ANNOTATIONS  
 *)  
                   ) : SPARCINSTR =  
 struct  
    structure Constant = Const  
    structure Region   = Region  
    structure C = SparcCells  
1  (*  (*
2     structure A = Annotations   * This file was automatically generated by MDGen
3     * from the machine description file "sparc/sparc.md".
4  *)  *)
5    
    datatype load = LDSB | LDSH | LDUB | LDUH | LD | LDD  
   
    datatype store = STB | STH | ST | STD  
   
    datatype fload = LDF | LDDF | LDFSR  
   
    datatype fstore = STF | STDF | STFSR  
6    
7     datatype ea = Direct of int  signature SPARCINSTR =
8    sig
9       structure C : SPARCCELLS
10       structure Constant: CONSTANT
11       structure Region : REGION
12       datatype load =
13         LDSB
14       | LDSH
15       | LDUB
16       | LDUH
17       | LD
18       | LDX
19       | LDD
20       datatype store =
21         STB
22       | STH
23       | ST
24       | STX
25       | STD
26       datatype fload =
27         LDF
28       | LDDF
29       | LDQF
30       | LDFSR
31       | LDXFSR
32       datatype fstore =
33         STF
34       | STDF
35       | STFSR
36       datatype arith =
37         AND
38       | ANDCC
39       | ANDN
40       | ANDNCC
41       | OR
42       | ORCC
43       | ORN
44       | ORNCC
45       | XOR
46       | XORCC
47       | XNOR
48       | XNORCC
49       | ADD
50       | ADDCC
51       | TADD
52       | TADDCC
53       | TADDTV
54       | TADDTVCC
55       | SUB
56       | SUBCC
57       | TSUB
58       | TSUBCC
59       | TSUBTV
60       | TSUBTVCC
61       | UMUL
62       | UMULCC
63       | SMUL
64       | SMULCC
65       | UDIV
66       | UDIVCC
67       | SDIV
68       | SDIVCC
69       | MULX
70       | SDIVX
71       | UDIVX
72       datatype shift =
73         SLL
74       | SRL
75       | SRA
76       | SLLX
77       | SRLX
78       | SRAX
79       datatype farith1 =
80         FiTOs
81       | FiTOd
82       | FiTOq
83       | FsTOi
84       | FdTOi
85       | FqTOi
86       | FsTOd
87       | FsTOq
88       | FdTOs
89       | FdTOq
90       | FqTOs
91       | FqTOd
92       | FMOVs
93       | FNEGs
94       | FABSs
95       | FMOVd
96       | FNEGd
97       | FABSd
98       | FMOVq
99       | FNEGq
100       | FABSq
101       | FSQRTs
102       | FSQRTd
103       | FSQRTq
104       datatype farith2 =
105         FADDs
106       | FADDd
107       | FADDq
108       | FSUBs
109       | FSUBd
110       | FSUBq
111       | FMULs
112       | FMULd
113       | FMULq
114       | FsMULd
115       | FdMULq
116       | FDIVs
117       | FDIVd
118       | FDIVq
119       datatype fcmp =
120         FCMPs
121       | FCMPd
122       | FCMPq
123       | FCMPEs
124       | FCMPEd
125       | FCMPEq
126       datatype branch =
127         BN
128       | BE
129       | BLE
130       | BL
131       | BLEU
132       | BCS
133       | BNEG
134       | BVS
135       | BA
136       | BNE
137       | BG
138       | BGE
139       | BGU
140       | BCC
141       | BPOS
142       | BVC
143       datatype rcond =
144         RZ
145       | RLEZ
146       | RLZ
147       | RNZ
148       | RGZ
149       | RGEZ
150       datatype cc =
151         ICC
152       | XCC
153       datatype prediction =
154         PT
155       | PN
156       datatype fbranch =
157         FBN
158       | FBNE
159       | FBLG
160       | FBUL
161       | FBL
162       | FBUG
163       | FBG
164       | FBU
165       | FBA
166       | FBE
167       | FBUE
168       | FBGE
169       | FBUGE
170       | FBLE
171       | FBULE
172       | FBO
173       datatype ea =
174         Direct of int
175                 | FDirect of int                 | FDirect of int
176                 | Displace of {base: int, disp: int}                 | Displace of {base: int, disp: int}
177       datatype fsize =
178         S
179       | D
180       | Q
181     datatype operand =     datatype operand =
182        REG of int        REG of int
183      | IMMED of int      | IMMED of int
# Line 31  Line 185 
185      | LO of LabelExp.labexp      | LO of LabelExp.labexp
186      | HI of LabelExp.labexp      | HI of LabelExp.labexp
187      | CONST of Constant.const      | CONST of Constant.const
188       datatype instruction =
189         LOAD of {l:load, d:int, r:int, i:operand, mem:Region.region}
190       | STORE of {s:store, d:int, r:int, i:operand, mem:Region.region}
191       | FLOAD of {l:fload, r:int, i:operand, d:int, mem:Region.region}
192       | FSTORE of {s:fstore, d:int, r:int, i:operand, mem:Region.region}
193       | SETHI of {i:int, d:int}
194       | ARITH of {a:arith, r:int, i:operand, d:int}
195       | SHIFT of {s:shift, r:int, i:operand, d:int}
196       | MOVicc of {b:branch, i:operand, d:int}
197       | MOVfcc of {b:fbranch, i:operand, d:int}
198       | MOVR of {rcond:rcond, r:int, i:operand, d:int}
199       | FMOVicc of {sz:fsize, b:branch, r:int, d:int}
200       | FMOVfcc of {sz:fsize, b:fbranch, r:int, d:int}
201       | Bicc of {b:branch, a:bool, label:Label.label, nop:bool}
202       | FBfcc of {b:fbranch, a:bool, label:Label.label, nop:bool}
203       | BR of {rcond:rcond, p:prediction, r:int, a:bool, label:Label.label
204         , nop:bool}
205       | BP of {b:branch, p:prediction, cc:cc, a:bool, label:Label.label, nop:bool
206         }
207       | JMP of {r:int, i:operand, labs:Label.label list, nop:bool}
208       | JMPL of {r:int, i:operand, d:int, defs:C.cellset, uses:C.cellset, nop:bool
209         , mem:Region.region}
210       | CALL of {defs:C.cellset, uses:C.cellset, label:Label.label, nop:bool
211         , mem:Region.region}
212       | Ticc of {t:branch, cc:cc, r:int, i:operand}
213       | FPop1 of {a:farith1, r:int, d:int}
214       | FPop2 of {a:farith2, r1:int, r2:int, d:int}
215       | FCMP of {cmp:fcmp, r1:int, r2:int, nop:bool}
216       | COPY of {dst:int list, src:int list, impl:instruction list option ref
217         , tmp:ea option}
218       | FCOPY of {dst:int list, src:int list, impl:instruction list option ref
219         , tmp:ea option}
220       | SAVE of {r:int, i:operand, d:int}
221       | RESTORE of {r:int, i:operand, d:int}
222       | RDY of {d:int}
223       | WRY of {r:int, i:operand}
224       | RET of {leaf:bool, nop:bool}
225       | ANNOTATION of {i:instruction, a:Annotations.annotation}
226       | GROUP of Annotations.annotation
227    end
228    
229     datatype arith = ADD | SUB | UMUL | SMUL | UDIV | SDIV  functor SparcInstr(structure Const : CONSTANT
230                    | AND | ANDN | OR | ORN | XOR | XNOR                     structure Region : REGION
231                    | TADD | TADDTV                    ) : SPARCINSTR =
232    struct
233     datatype shift = SLL | SRL | SRA     structure C = SparcCells
234       structure Region = Region
235     datatype farith1 = FiTOd | FdTOi | FiTOs | FsTOi     structure Constant = Const
236                      | FsTOd | FdTOs     datatype load =
237                      | FMOVs | FNEGs | FABSs       LDSB
238                      | FMOVd | FNEGd | FABSd (* composite instructions *)     | LDSH
239                      | FSQRTs | FSQRTd     | LDUB
240       | LDUH
241     datatype farith2 = FADDd | FSUBd | FMULd | FDIVd     | LD
242                      | FADDs | FSUBs | FMULs | FDIVs     | LDX
243       | LDD
244       datatype store =
245         STB
246       | STH
247       | ST
248       | STX
249       | STD
250       datatype fload =
251         LDF
252       | LDDF
253       | LDQF
254       | LDFSR
255       | LDXFSR
256       datatype fstore =
257         STF
258       | STDF
259       | STFSR
260       datatype arith =
261         AND
262       | ANDCC
263       | ANDN
264       | ANDNCC
265       | OR
266       | ORCC
267       | ORN
268       | ORNCC
269       | XOR
270       | XORCC
271       | XNOR
272       | XNORCC
273       | ADD
274       | ADDCC
275       | TADD
276       | TADDCC
277       | TADDTV
278       | TADDTVCC
279       | SUB
280       | SUBCC
281       | TSUB
282       | TSUBCC
283       | TSUBTV
284       | TSUBTVCC
285       | UMUL
286       | UMULCC
287       | SMUL
288       | SMULCC
289       | UDIV
290       | UDIVCC
291       | SDIV
292       | SDIVCC
293       | MULX
294       | SDIVX
295       | UDIVX
296       datatype shift =
297         SLL
298       | SRL
299       | SRA
300       | SLLX
301       | SRLX
302       | SRAX
303       datatype farith1 =
304         FiTOs
305       | FiTOd
306       | FiTOq
307       | FsTOi
308       | FdTOi
309       | FqTOi
310       | FsTOd
311       | FsTOq
312       | FdTOs
313       | FdTOq
314       | FqTOs
315       | FqTOd
316       | FMOVs
317       | FNEGs
318       | FABSs
319       | FMOVd
320       | FNEGd
321       | FABSd
322       | FMOVq
323       | FNEGq
324       | FABSq
325       | FSQRTs
326       | FSQRTd
327       | FSQRTq
328       datatype farith2 =
329         FADDs
330       | FADDd
331       | FADDq
332       | FSUBs
333       | FSUBd
334       | FSUBq
335       | FMULs
336       | FMULd
337       | FMULq
338                      | FsMULd                      | FsMULd
339       | FdMULq
340     datatype fcmp = FCMPd | FCMPEd     | FDIVs
341                   | FCMPs | FCMPEs     | FDIVd
342       | FDIVq
343     datatype branch = BA | BN | BNE | BE | BG | BLE | BGE | BL | BGU     datatype fcmp =
344                     | BLEU | BCC | BCS | BPOS | BNEG | BVC | BVS       FCMPs
345       | FCMPd
346     datatype fbranch = FBA | FBN | FBU | FBG | FBUG | FBL | FBUL     | FCMPq
347                      | FBLG | FBNE | FBE | FBUE | FBGE | FBUGE     | FCMPEs
348                      | FBLE | FBULE | FBO     | FCMPEd
349       | FCMPEq
350       datatype branch =
351         BN
352       | BE
353       | BLE
354       | BL
355       | BLEU
356       | BCS
357       | BNEG
358       | BVS
359       | BA
360       | BNE
361       | BG
362       | BGE
363       | BGU
364       | BCC
365       | BPOS
366       | BVC
367       datatype rcond =
368         RZ
369       | RLEZ
370       | RLZ
371       | RNZ
372       | RGZ
373       | RGEZ
374       datatype cc =
375         ICC
376       | XCC
377       datatype prediction =
378         PT
379       | PN
380       datatype fbranch =
381         FBN
382       | FBNE
383       | FBLG
384       | FBUL
385       | FBL
386       | FBUG
387       | FBG
388       | FBU
389       | FBA
390       | FBE
391       | FBUE
392       | FBGE
393       | FBUGE
394       | FBLE
395       | FBULE
396       | FBO
397       datatype ea =
398         Direct of int
399       | FDirect of int
400       | Displace of {base:int, disp:int}
401       datatype fsize =
402         S
403       | D
404       | Q
405       datatype operand =
406         REG of int
407       | IMMED of int
408       | LAB of LabelExp.labexp
409       | LO of LabelExp.labexp
410       | HI of LabelExp.labexp
411       | CONST of Constant.const
412     datatype instruction =     datatype instruction =
413        LOAD of  { l:load, r:int, i:operand, d:int, mem:Region.region }       LOAD of {l:load, d:int, r:int, i:operand, mem:Region.region}
414     |  STORE of { s:store, d:int, r:int, i:operand, mem:Region.region }     |  STORE of { s:store, d:int, r:int, i:operand, mem:Region.region }
415     |  FLOAD of { l:fload, r:int, i:operand, d:int, mem:Region.region }     |  FLOAD of { l:fload, r:int, i:operand, d:int, mem:Region.region }
416     |  FSTORE of{ s:fstore, d:int, r:int, i:operand, mem:Region.region }     |  FSTORE of{ s:fstore, d:int, r:int, i:operand, mem:Region.region }
417     |  SETHI of { d:int, i:int }     | SETHI of {i:int, d:int}
418     |  ARITH of { a:arith, cc:bool, r:int, i:operand, d:int }     | ARITH of {a:arith, r:int, i:operand, d:int}
419     |  SHIFT of { s:shift, r:int, i:operand, d:int }     |  SHIFT of { s:shift, r:int, i:operand, d:int }
420       | MOVicc of {b:branch, i:operand, d:int}
421       | MOVfcc of {b:fbranch, i:operand, d:int}
422       | MOVR of {rcond:rcond, r:int, i:operand, d:int}
423       | FMOVicc of {sz:fsize, b:branch, r:int, d:int}
424       | FMOVfcc of {sz:fsize, b:fbranch, r:int, d:int}
425     |  Bicc of  { b:branch, a:bool, label:Label.label, nop:bool }     |  Bicc of  { b:branch, a:bool, label:Label.label, nop:bool }
426     |  FBfcc of { b:fbranch, a:bool, label:Label.label, nop:bool }     |  FBfcc of { b:fbranch, a:bool, label:Label.label, nop:bool }
427       | BR of {rcond:rcond, p:prediction, r:int, a:bool, label:Label.label
428         , nop:bool}
429       | BP of {b:branch, p:prediction, cc:cc, a:bool, label:Label.label, nop:bool
430         }
431     |  JMP  of  { r:int, i:operand, labs : Label.label list, nop:bool }     |  JMP  of  { r:int, i:operand, labs : Label.label list, nop:bool }
432     |  JMPL of  { d:int, r:int, i:operand, defs:C.cellset, uses:C.cellset,     | JMPL of {r:int, i:operand, d:int, defs:C.cellset, uses:C.cellset, nop:bool
433                   nop:bool }       , mem:Region.region}
434     |  CALL of  { defs:C.cellset, uses:C.cellset, label:Label.label, nop:bool }     | CALL of {defs:C.cellset, uses:C.cellset, label:Label.label, nop:bool
435     |  Ticc of  { t:branch, r:int, i:operand }       , mem:Region.region}
436       | Ticc of {t:branch, cc:cc, r:int, i:operand}
437     |  FPop1 of { a:farith1, r:int, d:int }     |  FPop1 of { a:farith1, r:int, d:int }
438     |  FPop2 of { a:farith2, r1:int, r2:int, d:int }     |  FPop2 of { a:farith2, r1:int, r2:int, d:int }
439     |  FCMP of  { cmp:fcmp, r1:int, r2:int, nop:bool }     |  FCMP of  { cmp:fcmp, r1:int, r2:int, nop:bool }
440     |  COPY of  { dst:int list, src:int list, impl:instruction list option ref,     | COPY of {dst:int list, src:int list, impl:instruction list option ref
441                   tmp:ea option}       , tmp:ea option}
442     |  FCOPY of { dst:int list, src:int list, impl:instruction list option ref,     | FCOPY of {dst:int list, src:int list, impl:instruction list option ref
443                   tmp:ea option}       , tmp:ea option}
444     |  SAVE of { r:int, i:operand, d:int}     |  SAVE of { r:int, i:operand, d:int}
445     |  RESTORE of {r:int, i:operand, d:int}     |  RESTORE of {r:int, i:operand, d:int}
446     |  RDY of {d:int}     |  RDY of {d:int}
447     |  WRY of {r:int,i:operand}     |  WRY of {r:int,i:operand}
448     |  RET of {leaf:bool,nop:bool}     |  RET of {leaf:bool,nop:bool}
449  (*     | ANNOTATION of {i:instruction, a:Annotations.annotation}
450     |  ANNOTATION of instruction * A.annotation     | GROUP of Annotations.annotation
 *)  
   
   
    fun revCond BA = BN  
      | revCond BN = BA  
      | revCond BNE = BE  
      | revCond BE  = BNE  
      | revCond BG  = BLE  
      | revCond BLE = BG  
      | revCond BGE = BL  
      | revCond BL  = BGE  
      | revCond BGU = BLEU  
      | revCond BLEU = BGU  
      | revCond BCC  = BCS  
      | revCond BCS  = BCC  
      | revCond BPOS = BNEG  
      | revCond BNEG = BPOS  
      | revCond BVC  = BVS  
      | revCond BVS  = BVC  
   
    fun revFcond FBA   = FBN  
      | revFcond FBN   = FBA  
      | revFcond FBU   = FBO  
      | revFcond FBG   = FBULE  
      | revFcond FBUG  = FBLE  
      | revFcond FBL   = FBUGE  
      | revFcond FBUL  = FBGE  
      | revFcond FBLG  = FBUE  
      | revFcond FBNE  = FBE  
      | revFcond FBE   = FBNE  
      | revFcond FBUE  = FBLG  
      | revFcond FBGE  = FBUL  
      | revFcond FBUGE = FBL  
      | revFcond FBLE  = FBUG  
      | revFcond FBULE = FBG  
      | revFcond FBO   = FBU  
451  end  end
452    
 (*  
  * $Log: sparcInstr.sml,v $  
  * Revision 1.2  1998/08/12 13:36:22  leunga  
  *   Fixed the 2.0 + 2.0 == nan bug by treating FCMP as instrs with delay slots  
  *  
  * Revision 1.1.1.1  1998/08/05 19:38:49  george  
  *   Release 110.7.4  
  *  
  *)  

Legend:
Removed from v.245  
changed lines
  Added in v.411

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0