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/hppa/instructions/hppaInstr.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/hppa/instructions/hppaInstr.sml

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

revision 410, Fri Sep 3 00:25:03 1999 UTC revision 411, Fri Sep 3 00:25:03 1999 UTC
# Line 1  Line 1 
1  (* hppaInstr.sml  (*
2   *   * This file was automatically generated by MDGen
3   * COPYRIGHT (c) 1996 Bell Laboratories.   * from the machine description file "hppa/hppa.md".
  *  
4   *)   *)
5    
6    
7    signature HPPAINSTR =
8    sig
9       structure C : HPPACELLS
10       structure Constant: CONSTANT
11       structure Region : REGION
12       datatype fmt =
13         SGL
14       | DBL
15       | QUAD
16       datatype loadi =
17         LDW
18       | LDH
19       | LDB
20       datatype store =
21         STW
22       | STH
23       | STB
24       datatype cmplt =
25         ADDR
26       | ADDR_S
27       | ADDR_M
28       | ADDR_SM
29       datatype load =
30         LDWX
31       | LDWX_S
32       | LDWX_M
33       | LDWX_SM
34       | LDHX
35       | LDHX_S
36       | LDHX_M
37       | LDHX_SM
38       | LDBX
39       | LDBX_M
40       datatype cmp =
41         COMBT
42       | COMBF
43       datatype cmpi =
44         COMIBT
45       | COMIBF
46       datatype arith =
47         ADD
48       | ADDL
49       | ADDO
50       | SH1ADD
51       | SH1ADDL
52       | SH1ADDO
53       | SH2ADD
54       | SH2ADDL
55       | SH2ADDO
56       | SH3ADD
57       | SH3ADDL
58       | SH3ADDO
59       | SUB
60       | SUBO
61       | OR
62       | XOR
63       | AND
64       | ANDCM
65       datatype arithi =
66         ADDI
67       | ADDIO
68       | ADDIL
69       | SUBI
70       | SUBIO
71       datatype shiftv =
72         VEXTRU
73       | VEXTRS
74       | ZVDEP
75       datatype shift =
76         EXTRU
77       | EXTRS
78       | ZDEP
79       datatype farith =
80         FADD_S
81       | FADD_D
82       | FADD_Q
83       | FSUB_S
84       | FSUB_D
85       | FSUB_Q
86       | FMPY_S
87       | FMPY_D
88       | FMPY_Q
89       | FDIV_S
90       | FDIV_D
91       | FDIV_Q
92       | XMPYU
93       datatype funary =
94         FCPY_S
95       | FCPY_D
96       | FCPY_Q
97       | FABS_S
98       | FABS_D
99       | FABS_Q
100       | FSQRT_S
101       | FSQRT_D
102       | FSQRT_Q
103       | FRND_S
104       | FRND_D
105       | FRND_Q
106       datatype fcnv =
107         FCNVFF_SD
108       | FCNVFF_SQ
109       | FCNVFF_DS
110       | FCNVFF_DQ
111       | FCNVFF_QS
112       | FCNVFF_QD
113       | FCNVXF_S
114       | FCNVXF_D
115       | FCNVXF_Q
116       | FCNVFX_S
117       | FCNVFX_D
118       | FCNVFX_Q
119       | FCNVFXT_S
120       | FCNVFXT_D
121       | FCNVFXT_Q
122       datatype fstore =
123         FSTDS
124       | FSTWS
125       datatype fstorex =
126         FSTDX
127       | FSTDX_S
128       | FSTDX_M
129       | FSTDX_SM
130       | FSTWX
131       | FSTWX_S
132       | FSTWX_M
133       | FSTWX_SM
134       datatype floadx =
135         FLDDX
136       | FLDDX_S
137       | FLDDX_M
138       | FLDDX_SM
139       | FLDWX
140       | FLDWX_S
141       | FLDWX_M
142       | FLDWX_SM
143       datatype fload =
144         FLDDS
145       | FLDWS
146       datatype bcond =
147         EQ
148       | LT
149       | LE
150       | LTU
151       | LEU
152       | NE
153       | GE
154       | GT
155       | GTU
156       | GEU
157       datatype bitcond =
158         BSET
159       | BCLR
160       datatype fcond =
161         False_
162       | False
163       | ?
164       | !<=>
165       | ==
166       | EQT
167       | ?=
168       | !<>
169       | !?>=
170       | <
171       | ?<
172       | !>=
173       | !?>
174       | <=
175       | ?<=
176       | !>
177       | !?<=
178       | >
179       | ?>
180       | !<=
181       | !?<
182       | >=
183       | ?>=
184       | !<
185       | !?=
186       | <>
187       | !=
188       | NET
189       | !?
190       | <=>
191       | True_
192       | True
193       datatype scond =
194         ALL_ZERO
195       | LEFTMOST_ONE
196       | LEFTMOST_ZERO
197       | RIGHTMOST_ONE
198       | RIGHTMOST_ZERO
199       datatype field_selector =
200         F
201       | S
202       | D
203       | R
204       | T
205       | P
206       datatype ea =
207         Direct of int
208       | FDirect of int
209       | Displace of {base:int, disp:int}
210       datatype operand =
211         IMMED of int
212       | LabExp of (LabelExp.labexp * field_selector)
213       | HILabExp of (LabelExp.labexp * field_selector)
214       | LOLabExp of (LabelExp.labexp * field_selector)
215       | ConstOp of Constant.const
216       datatype instruction =
217         LOADI of {li:loadi, r:int, i:operand, t:int, mem:Region.region}
218       | LOAD of {l:load, r1:int, r2:int, t:int, mem:Region.region}
219       | STORE of {st:store, b:int, d:operand, r:int, mem:Region.region}
220       | ARITH of {a:arith, r1:int, r2:int, t:int}
221       | ARITHI of {ai:arithi, i:operand, r:int, t:int}
222       | COMCLR_LDO of {cc:bcond, r1:int, r2:int, t1:int, i:int, b:int, t2:int
223         }
224       | SHIFTV of {sv:shiftv, r:int, len:int, t:int}
225       | SHIFT of {s:shift, r:int, p:int, len:int, t:int}
226       | BCOND of {cmp:cmp, bc:bcond, r1:int, r2:int, n:bool, nop:bool, t:Label.label
227         , f:Label.label}
228       | BCONDI of {cmpi:cmpi, bc:bcond, i:int, r2:int, n:bool, nop:bool, t:Label.label
229         , f:Label.label}
230       | BB of {bc:bitcond, r:int, p:int, n:bool, nop:bool, t:Label.label, f:Label.label
231         }
232       | B of {lab:Label.label, n:bool}
233       | BV of {x:int, b:int, labs:Label.label list, n:bool}
234       | BLR of {x:int, t:int, labs:Label.label list, n:bool}
235       | BL of {x:operand, t:int, defs:C.cellset, uses:C.cellset, n:bool}
236       | BLE of {d:operand, b:int, sr:int, t:int, defs:C.cellset, uses:C.cellset
237         , mem:Region.region}
238       | LDIL of {i:operand, t:int}
239       | LDO of {i:operand, b:int, t:int}
240       | MTCTL of {r:int, t:int}
241       | FSTORE of {fst:fstore, b:int, d:int, r:int, mem:Region.region}
242       | FSTOREX of {fstx:fstorex, b:int, x:int, r:int, mem:Region.region}
243       | FLOAD of {fl:fload, b:int, d:int, t:int, mem:Region.region}
244       | FLOADX of {flx:floadx, b:int, x:int, t:int, mem:Region.region}
245       | FARITH of {fa:farith, r1:int, r2:int, t:int}
246       | FUNARY of {fu:funary, f:int, t:int}
247       | FCNV of {fcnv:fcnv, f:int, t:int}
248       | FBRANCH of {cc:fcond, fmt:fmt, f1:int, f2:int, t:Label.label, f:Label.label
249         , n:bool, long:bool}
250       | BREAK of {code1:int, code2:int}
251       | NOP
252       | COPY of {dst:int list, src:int list, impl:instruction list option ref
253         , tmp:ea option}
254       | FCOPY of {dst:int list, src:int list, impl:instruction list option ref
255         , tmp:ea option}
256       | ANNOTATION of {i:instruction, a:Annotations.annotation}
257       | GROUP of Annotations.annotation
258    end
259    
260  functor HppaInstr(structure Const : CONSTANT  functor HppaInstr(structure Const : CONSTANT
261                    structure Region : REGION) : HPPAINSTR =                    structure Region : REGION
262                     ) : HPPAINSTR =
263  struct  struct
264    structure C = HppaCells    structure C = HppaCells
   structure Constant = Const  
265    structure Region = Region    structure Region = Region
266       structure Constant = Const
267    type csets = int list * int list     datatype fmt =
268         SGL
269    datatype store = STW | STH | STB     | DBL
270       | QUAD
271    (* All branching is done with nullification *)     datatype loadi =
272    datatype cmp = COMBT | COMBF       LDW
273       | LDH
274    datatype cmpi = COMIBT | COMIBF     | LDB
275       datatype store =
276    datatype load = LDWX | LDHX | LDBX       STW
277       | STH
278    datatype loadi = LDW | LDH | LDB     | STB
279       datatype cmplt =
280    datatype arith = ADD | ADDO | SH1ADD | SH1ADDO       ADDR
281                   | SUB | SUBO | OR  | XOR | AND     | ADDR_S
282       | ADDR_M
283    datatype arithi = ADDI | ADDIO | ADDIL | SUBI | SUBIO     | ADDR_SM
284       datatype load =
285    datatype shiftv = VEXTRU | VEXTRS | ZVDEP       LDWX
286       | LDWX_S
287    datatype shift = EXTRU | EXTRS | ZDEP     | LDWX_M
288       | LDWX_SM
289    datatype farith = FADD | FSUB | FMPY | FDIV | XMPYU     | LDHX
290       | LDHX_S
291    (* FCNVXF --- the source is the LHS single precision floating register *)     | LDHX_M
292    datatype funary = FCPY | FABS | FCNVXF     | LDHX_SM
293       | LDBX
294    datatype fstore = FSTDS | FSTWS     | LDBX_M
295       datatype cmp =
296    datatype fstorex = FSTDX | FSTWX       COMBT
297       | COMBF
298    (* FLDWX and FLDWS -- loads the RHS of the floating register *)     datatype cmpi =
299    datatype floadx = FLDDX | FLDWX       COMIBT
300       | COMIBF
301    datatype fload = FLDDS | FLDWS     datatype arith =
302         ADD
303    datatype bcond = EQ | LT | LE | LTU | LEU | NE | GE | GT | GTU | GEU     | ADDL
304    datatype fcond = ? | !<=> | == | ?= | !<> | !?>= | < | ?< | !>= | !?> |     | ADDO
305                     <= | ?<= | !> | !?<= | > | ?> | !<= | !?< | >= | ?>= |     | SH1ADD
306                     !< | !?= | <> | != | !? | <=>     | SH1ADDL
307       | SH1ADDO
308    datatype scond = ALL_ZERO | LEFTMOST_ONE | LEFTMOST_ZERO | RIGHTMOST_ONE     | SH2ADD
309       | SH2ADDL
310       | SH2ADDO
311       | SH3ADD
312       | SH3ADDL
313       | SH3ADDO
314       | SUB
315       | SUBO
316       | OR
317       | XOR
318       | AND
319       | ANDCM
320       datatype arithi =
321         ADDI
322       | ADDIO
323       | ADDIL
324       | SUBI
325       | SUBIO
326       datatype shiftv =
327         VEXTRU
328       | VEXTRS
329       | ZVDEP
330       datatype shift =
331         EXTRU
332       | EXTRS
333       | ZDEP
334       datatype farith =
335         FADD_S
336       | FADD_D
337       | FADD_Q
338       | FSUB_S
339       | FSUB_D
340       | FSUB_Q
341       | FMPY_S
342       | FMPY_D
343       | FMPY_Q
344       | FDIV_S
345       | FDIV_D
346       | FDIV_Q
347       | XMPYU
348       datatype funary =
349         FCPY_S
350       | FCPY_D
351       | FCPY_Q
352       | FABS_S
353       | FABS_D
354       | FABS_Q
355       | FSQRT_S
356       | FSQRT_D
357       | FSQRT_Q
358       | FRND_S
359       | FRND_D
360       | FRND_Q
361       datatype fcnv =
362         FCNVFF_SD
363       | FCNVFF_SQ
364       | FCNVFF_DS
365       | FCNVFF_DQ
366       | FCNVFF_QS
367       | FCNVFF_QD
368       | FCNVXF_S
369       | FCNVXF_D
370       | FCNVXF_Q
371       | FCNVFX_S
372       | FCNVFX_D
373       | FCNVFX_Q
374       | FCNVFXT_S
375       | FCNVFXT_D
376       | FCNVFXT_Q
377       datatype fstore =
378         FSTDS
379       | FSTWS
380       datatype fstorex =
381         FSTDX
382       | FSTDX_S
383       | FSTDX_M
384       | FSTDX_SM
385       | FSTWX
386       | FSTWX_S
387       | FSTWX_M
388       | FSTWX_SM
389       datatype floadx =
390         FLDDX
391       | FLDDX_S
392       | FLDDX_M
393       | FLDDX_SM
394       | FLDWX
395       | FLDWX_S
396       | FLDWX_M
397       | FLDWX_SM
398       datatype fload =
399         FLDDS
400       | FLDWS
401       datatype bcond =
402         EQ
403       | LT
404       | LE
405       | LTU
406       | LEU
407       | NE
408       | GE
409       | GT
410       | GTU
411       | GEU
412       datatype bitcond =
413         BSET
414       | BCLR
415       datatype fcond =
416         False_
417       | False
418       | ?
419       | !<=>
420       | ==
421       | EQT
422       | ?=
423       | !<>
424       | !?>=
425       | <
426       | ?<
427       | !>=
428       | !?>
429       | <=
430       | ?<=
431       | !>
432       | !?<=
433       | >
434       | ?>
435       | !<=
436       | !?<
437       | >=
438       | ?>=
439       | !<
440       | !?=
441       | <>
442       | !=
443       | NET
444       | !?
445       | <=>
446       | True_
447       | True
448       datatype scond =
449         ALL_ZERO
450       | LEFTMOST_ONE
451       | LEFTMOST_ZERO
452       | RIGHTMOST_ONE
453                   | RIGHTMOST_ZERO                   | RIGHTMOST_ZERO
454       datatype field_selector =
455    datatype field_selector = F | S | D | R | T | P       F
456       | S
457       | D
458       | R
459       | T
460       | P
461    datatype ea =    datatype ea =
462        Direct of int        Direct of int
463      | FDirect of int      | FDirect of int
464      | Displace of {base:int, disp:int}      | Displace of {base:int, disp:int}
   
465    datatype operand =    datatype operand =
466        IMMED of int        IMMED of int
467      | LabExp of LabelExp.labexp * field_selector     | LabExp of (LabelExp.labexp * field_selector)
468      | HILabExp of LabelExp.labexp * field_selector     | HILabExp of (LabelExp.labexp * field_selector)
469      | LOLabExp of LabelExp.labexp * field_selector     | LOLabExp of (LabelExp.labexp * field_selector)
470      | ConstOp of Constant.const      | ConstOp of Constant.const
   
   (* FLDWS, FLDWX = define the R half of the FP register.  
    * FSTWS = uses the R half of the FP register.  
    *)  
471    datatype instruction =    datatype instruction =
472        STORE   of {st:store,   b:int,  d:operand,  r:int, mem:Region.region}       LOADI of {li:loadi, r:int, i:operand, t:int, mem:Region.region}
473      | LOAD    of {l:load,     r1:int, r2:int, t:int, mem:Region.region}      | LOAD    of {l:load,     r1:int, r2:int, t:int, mem:Region.region}
474      | LOADI   of {li:loadi,   i:operand,  r:int,  t:int, mem:Region.region}     | STORE of {st:store, b:int, d:operand, r:int, mem:Region.region}
475      | ARITH   of {a:arith,    r1:int, r2:int, t:int}      | ARITH   of {a:arith,    r1:int, r2:int, t:int}
476      | ARITHI  of {ai:arithi,  i:operand,  r:int,  t:int}      | ARITHI  of {ai:arithi,  i:operand,  r:int,  t:int}
477      | COMCLR  of {cc:bcond,   r1:int, r2:int, t:int}     | COMCLR_LDO of {cc:bcond, r1:int, r2:int, t1:int, i:int, b:int, t2:int
478         }
479      | SHIFTV  of {sv:shiftv,  r:int,  len:int, t:int}      | SHIFTV  of {sv:shiftv,  r:int,  len:int, t:int}
480      | SHIFT   of {s:shift,    r:int,  p:int,  len:int, t:int}      | SHIFT   of {s:shift,    r:int,  p:int,  len:int, t:int}
481      | BCOND   of {cmp: cmp,   bc:bcond,  r1:int, r2:int, n:bool,     | BCOND of {cmp:cmp, bc:bcond, r1:int, r2:int, n:bool, nop:bool, t:Label.label
482                    t:Label.label, f:Label.label}       , f:Label.label}
483      | BCONDI  of {cmpi: cmpi, bc:bcond,  i:int,  r2:int, n:bool,     | BCONDI of {cmpi:cmpi, bc:bcond, i:int, r2:int, n:bool, nop:bool, t:Label.label
484                    t:Label.label, f:Label.label}       , f:Label.label}
485       | BB of {bc:bitcond, r:int, p:int, n:bool, nop:bool, t:Label.label, f:Label.label
486         }
487      | B       of {lab: Label.label, n:bool}      | B       of {lab: Label.label, n:bool}
488      | BV      of {x:int,      b:int,   labs: Label.label list, n:bool}      | BV      of {x:int,      b:int,   labs: Label.label list, n:bool}
489      | BLR     of {x:int,      t:int,   labs: Label.label list, n:bool}      | BLR     of {x:int,      t:int,   labs: Label.label list, n:bool}
490      | BL      of {x:operand,  t:int, defs: C.cellset, uses:C.cellset,n:bool}      | BL      of {x:operand,  t:int, defs: C.cellset, uses:C.cellset,n:bool}
491      | BLE     of {d:operand,  b:int, sr:int, t:int,     | BLE of {d:operand, b:int, sr:int, t:int, defs:C.cellset, uses:C.cellset
492                    defs: C.cellset, uses:C.cellset}       , mem:Region.region}
493      | LDIL    of {i:operand,  t:int}      | LDIL    of {i:operand,  t:int}
494      | LDO     of {i:operand,  b:int,   t:int}      | LDO     of {i:operand,  b:int,   t:int}
495      | MTCTL   of {r:int, t:int}      | MTCTL   of {r:int, t:int}
# Line 100  Line 499 
499      | FLOADX  of {flx:floadx, b:int,   x:int,   t:int, mem:Region.region}      | FLOADX  of {flx:floadx, b:int,   x:int,   t:int, mem:Region.region}
500      | FARITH  of {fa:farith,  r1:int,  r2:int,  t:int}      | FARITH  of {fa:farith,  r1:int,  r2:int,  t:int}
501      | FUNARY  of {fu:funary,  f:int,   t:int}      | FUNARY  of {fu:funary,  f:int,   t:int}
502  (*  The following three instructions have been replaced by FBRANCH.     | FCNV of {fcnv:fcnv, f:int, t:int}
503      This make life much easier for instruction schedulers.     | FBRANCH of {cc:fcond, fmt:fmt, f1:int, f2:int, t:Label.label, f:Label.label
504      | FCMP    of fcond * int * int       , n:bool, long:bool}
505      | FTEST     | BREAK of {code1:int, code2:int}
     | FBCC    of {t:Label.label, f:Label.label, n:bool}  
  *)  
     | FBRANCH of {cc:fcond, f1:int, f2:int,  
                   t:Label.label, f:Label.label, n:bool, long:bool}  
     | BREAK   of int * int  
506      | NOP      | NOP
507      | COPY    of {dst:int list, src:int list,     | COPY of {dst:int list, src:int list, impl:instruction list option ref
508                    impl:instruction list option ref, tmp: ea option}       , tmp:ea option}
509      | FCOPY   of {dst:int list, src:int list,     | FCOPY of {dst:int list, src:int list, impl:instruction list option ref
510                    impl:instruction list option ref, tmp: ea option}       , tmp:ea option}
511       | ANNOTATION of {i:instruction, a:Annotations.annotation}
512       | GROUP of Annotations.annotation
513  end  end
514    
 (*  
  * $Log: hppaInstr.sml,v $  
  * Revision 1.4  1998/10/06 14:04:31  george  
  *   The instruction sequence FCMP, FTEST, FBCC is being replaced  
  *   by the composite instruction FBRANCH.  This makes scheduling and  
  *   other tasks easier.  Also, added BLR and BL in the instruction set.  
  *                                                      [leunga]  
  *  
  * Revision 1.3  1998/05/25 15:10:56  george  
  *   Fixed RCS keywords  
  *  
  *)  

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

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