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

SCM Repository

[smlnj] Annotation of /sml/trunk/src/MLRISC/x86/instructions/x86Instr.sml
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 247 - (view) (download)
Original Path: sml/branches/SMLNJ/src/MLRISC/x86/instructions/x86Instr.sml

1 : monnier 247 (* x86Instr.sml -- 32bit, x86 instruction set.
2 :     *
3 :     * COPYRIGHT (c) 1997 Bell Laboratories.
4 :     *
5 :     * $Log: X86Instr.sml,v $
6 :     * Revision 1.2 1998/08/27 14:12:15 george
7 :     * used sethi-ullman number for floating point stack
8 :     *
9 :     * Revision 1.1.1.1 1998/07/22 18:10:32 george
10 :     * X86.1
11 :     *
12 :     *)
13 :     functor X86Instr(structure Const : CONSTANT
14 :     structure Region : REGION) : X86INSTR = struct
15 :     structure C = X86Cells
16 :     structure Constant = Const
17 :     structure Region = Region
18 :    
19 :     type csets = int list * int list * int list
20 :    
21 :     datatype operand =
22 :     Immed of Int32.int
23 :     | ImmedLabel of LabelExp.labexp
24 :     | Const of Constant.const
25 :     | Direct of int
26 :     | FDirect of int
27 :     | Relative of int
28 :     | LabelEA of LabelExp.labexp
29 :     | Displace of {base:int, disp:operand}
30 :     | Indexed of {base:int option, index:int, scale:int, disp:operand}
31 :    
32 :     type ea = operand
33 :    
34 :     datatype binaryOp = ADD | SUB | AND | OR | XOR | SHL | SAR | SHR
35 :    
36 :     datatype multDivOp = UMUL | IDIV | UDIV
37 :    
38 :     datatype unaryOp = DEC | INC | NEG | NOT
39 :    
40 :     datatype move = MOVL | MOVZX | MOVB
41 :    
42 :     datatype cond =
43 :     EQ | NE | LT | LE | GT | GE | B | BE | A | AE | C | NC
44 :     | P | NP | O | NO
45 :    
46 :     datatype fbinOp =
47 :     FADDP | FADD | FSUBP | FSUB | FMULP | FMUL | FDIVP | FDIV
48 :     | FDIVRP | FDIVR | FSUBRP | FSUBR
49 :    
50 :     datatype funOp = FABS | FCHS
51 :    
52 :     (* many of these instructions imply certain register usages *)
53 :     datatype instruction =
54 :     NOP
55 :     | JMP of operand * Label.label list
56 :     | JCC of {cond:cond, opnd:operand}
57 :     | CALL of operand * C.cellset * C.cellset
58 :     | RET
59 :    
60 :     (* integer *)
61 :     | MOVE of {mvOp:move, src:operand, dst:operand}
62 :     | LEA of {r32: int, addr: operand}
63 :     | CMP of {lsrc: operand, rsrc: operand}
64 :     | BINARY of {binOp:binaryOp, src:operand, dst:operand}
65 :     | MULTDIV of {multDivOp:multDivOp, src:operand}
66 :     | MUL3 of {src1:operand, src2:Int32.int option, dst:int}
67 :     | UNARY of {unOp:unaryOp, opnd:operand}
68 :     | PUSH of operand
69 :     | POP of operand
70 :     | CDQ
71 :     | INTO
72 :    
73 :     | COPY of {dst:int list, src:int list, tmp:operand option}
74 :     | FCOPY of {dst:int list, src:int list, tmp:operand option}
75 :    
76 :     (* floating *)
77 :     | FBINARY of {binOp:fbinOp, src:operand, dst:operand}
78 :     | FUNARY of funOp
79 :     | FUCOMPP
80 :     | FXCH
81 :     | FSTP of operand
82 :     | FLD of operand
83 :     | FILD of operand
84 :     | FNSTSW
85 :    
86 :     (* misc *)
87 :     | SAHF
88 :     end
89 :    
90 :    

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