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/x86/instructions/x86Instr.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/x86/instructions/x86Instr.sml

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

revision 247, Sat Apr 17 18:47:13 1999 UTC revision 411, Fri Sep 3 00:25:03 1999 UTC
# Line 1  Line 1 
1  (* x86Instr.sml -- 32bit, x86 instruction set.  (*
2   *   * This file was automatically generated by MDGen
3   * COPYRIGHT (c) 1997 Bell Laboratories.   * from the machine description file "x86/x86.md".
  *  
  * $Log: X86Instr.sml,v $  
  * Revision 1.2  1998/08/27 14:12:15  george  
  *   used sethi-ullman number for floating point stack  
  *  
  * Revision 1.1.1.1  1998/07/22 18:10:32  george  
  *   X86.1  
  *  
4   *)   *)
 functor X86Instr(structure Const : CONSTANT  
                  structure Region : REGION) : X86INSTR = struct  
   structure C = X86Cells  
   structure Constant = Const  
   structure Region = Region  
5    
   type csets = int list * int list * int list  
6    
7    signature X86INSTR =
8    sig
9       structure C : X86CELLS
10       structure Constant: CONSTANT
11       structure Region : REGION
12    datatype operand =    datatype operand =
13       Immed      of Int32.int       Immed      of Int32.int
    | ImmedLabel of LabelExp.labexp  
14     | Const      of Constant.const     | Const      of Constant.const
15       | ImmedLabel of LabelExp.labexp
16       | Relative of int
17       | LabelEA of LabelExp.labexp
18     | Direct     of int     | Direct     of int
19     | FDirect    of int     | FDirect    of int
20       | Displace of {base:int, disp:operand, mem:Region.region}
21       | Indexed of {base:int option, index:int, scale:int, disp:operand, mem:Region.region
22         }
23       type ea = operand
24       datatype binaryOp =
25         ADD
26       | SUB
27       | AND
28       | OR
29       | XOR
30       | SHL
31       | SAR
32       | SHR
33       datatype multDivOp =
34         UMUL
35       | IDIV
36       | UDIV
37       datatype unaryOp =
38         DEC
39       | INC
40       | NEG
41       | NOT
42       datatype move =
43         MOVL
44       | MOVZX
45       | MOVB
46       datatype cond =
47         EQ
48       | NE
49       | LT
50       | LE
51       | GT
52       | GE
53       | B
54       | BE
55       | A
56       | AE
57       | C
58       | NC
59       | P
60       | NP
61       | O
62       | NO
63       datatype fbinOp =
64         FADDP
65       | FADD
66       | FMULP
67       | FMUL
68       | FSUBP
69       | FSUB
70       | FSUBRP
71       | FSUBR
72       | FDIVP
73       | FDIV
74       | FDIVRP
75       | FDIVR
76       datatype funOp =
77         FABS
78       | FCHS
79       datatype instruction =
80         NOP
81       | JMP of (operand * Label.label list)
82       | JCC of {cond:cond, opnd:operand}
83       | CALL of (operand * C.cellset * C.cellset * Region.region)
84       | RET
85       | MOVE of {mvOp:move, src:operand, dst:operand}
86       | LEA of {r32:int, addr:operand}
87       | CMP of {lsrc:operand, rsrc:operand}
88       | BINARY of {binOp:binaryOp, src:operand, dst:operand}
89       | MULTDIV of {multDivOp:multDivOp, src:operand}
90       | MUL3 of {dst:int, src1:operand, src2:Int32.int option}
91       | UNARY of {unOp:unaryOp, opnd:operand}
92       | PUSH of operand
93       | POP of operand
94       | CDQ
95       | INTO
96       | COPY of {dst:int list, src:int list, tmp:operand option}
97       | FCOPY of {dst:int list, src:int list, tmp:operand option}
98       | FBINARY of {binOp:fbinOp, src:operand, dst:operand}
99       | FUNARY of funOp
100       | FUCOMPP
101       | FXCH
102       | FSTP of operand
103       | FLD of operand
104       | FILD of operand
105       | FNSTSW
106       | SAHF
107       | ANNOTATION of {i:instruction, a:Annotations.annotation}
108       | GROUP of Annotations.annotation
109    end
110    
111    functor X86Instr(structure Const : CONSTANT
112                     structure Region : REGION
113                    ) : X86INSTR =
114    struct
115       structure C = X86Cells
116       structure Region = Region
117       structure Constant = Const
118       datatype operand =
119         Immed of Int32.int
120       | Const of Constant.const
121       | ImmedLabel of LabelExp.labexp
122     | Relative   of int     | Relative   of int
123     | LabelEA    of LabelExp.labexp     | LabelEA    of LabelExp.labexp
124     | Displace   of {base:int, disp:operand}     | Direct of int
125     | Indexed    of {base:int option, index:int, scale:int, disp:operand}     | FDirect of int
126       | Displace of {base:int, disp:operand, mem:Region.region}
127       | Indexed of {base:int option, index:int, scale:int, disp:operand, mem:Region.region
128         }
129    type ea = operand    type ea = operand
130       datatype binaryOp =
131    datatype binaryOp = ADD | SUB  | AND | OR | XOR | SHL | SAR | SHR       ADD
132       | SUB
133    datatype multDivOp = UMUL |  IDIV | UDIV     | AND
134       | OR
135    datatype unaryOp = DEC | INC | NEG | NOT     | XOR
136       | SHL
137    datatype move = MOVL | MOVZX | MOVB     | SAR
138       | SHR
139       datatype multDivOp =
140         UMUL
141       | IDIV
142       | UDIV
143       datatype unaryOp =
144         DEC
145       | INC
146       | NEG
147       | NOT
148       datatype move =
149         MOVL
150       | MOVZX
151       | MOVB
152    datatype cond =    datatype cond =
153        EQ | NE  | LT | LE  | GT | GE  | B | BE  | A | AE | C | NC       EQ
154      | P | NP | O | NO     | NE
155       | LT
156       | LE
157       | GT
158       | GE
159       | B
160       | BE
161       | A
162       | AE
163       | C
164       | NC
165       | P
166       | NP
167       | O
168       | NO
169    datatype fbinOp =    datatype fbinOp =
170        FADDP | FADD | FSUBP | FSUB | FMULP | FMUL | FDIVP | FDIV       FADDP
171      | FDIVRP | FDIVR | FSUBRP | FSUBR     | FADD
172       | FMULP
173    datatype funOp = FABS | FCHS     | FMUL
174       | FSUBP
175   (* many of these instructions imply certain register usages *)     | FSUB
176       | FSUBRP
177       | FSUBR
178       | FDIVP
179       | FDIV
180       | FDIVRP
181       | FDIVR
182       datatype funOp =
183         FABS
184       | FCHS
185    datatype instruction =    datatype instruction =
186        NOP        NOP
187      | JMP of operand * Label.label list     | JMP of (operand * Label.label list)
188      | JCC of {cond:cond, opnd:operand}      | JCC of {cond:cond, opnd:operand}
189      | CALL of operand * C.cellset * C.cellset     | CALL of (operand * C.cellset * C.cellset * Region.region)
190      | RET      | RET
   
     (* integer *)  
191      | MOVE of {mvOp:move, src:operand, dst:operand}      | MOVE of {mvOp:move, src:operand, dst:operand}
192      | LEA of {r32: int, addr: operand}      | LEA of {r32: int, addr: operand}
193      | CMP of {lsrc: operand, rsrc: operand}      | CMP of {lsrc: operand, rsrc: operand}
194      | BINARY of {binOp:binaryOp, src:operand, dst:operand}      | BINARY of {binOp:binaryOp, src:operand, dst:operand}
195      | MULTDIV of {multDivOp:multDivOp, src:operand}      | MULTDIV of {multDivOp:multDivOp, src:operand}
196      | MUL3 of {src1:operand, src2:Int32.int option, dst:int}     | MUL3 of {dst:int, src1:operand, src2:Int32.int option}
197      | UNARY of {unOp:unaryOp, opnd:operand}      | UNARY of {unOp:unaryOp, opnd:operand}
198      | PUSH of operand      | PUSH of operand
199      | POP of operand      | POP of operand
200      | CDQ      | CDQ
201      | INTO      | INTO
   
202      | COPY of {dst:int list, src:int list, tmp:operand option}      | COPY of {dst:int list, src:int list, tmp:operand option}
203      | FCOPY of {dst:int list, src:int list, tmp:operand option}      | FCOPY of {dst:int list, src:int list, tmp:operand option}
   
     (* floating *)  
204      | FBINARY of {binOp:fbinOp, src:operand, dst:operand}      | FBINARY of {binOp:fbinOp, src:operand, dst:operand}
205      | FUNARY of funOp      | FUNARY of funOp
206      | FUCOMPP      | FUCOMPP
# Line 82  Line 209 
209      | FLD of operand      | FLD of operand
210      | FILD of operand      | FILD of operand
211      | FNSTSW      | FNSTSW
   
     (* misc *)  
212      | SAHF      | SAHF
213       | ANNOTATION of {i:instruction, a:Annotations.annotation}
214       | GROUP of Annotations.annotation
215  end  end
216    
   

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

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