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/x86Props.sml
ViewVC logotype

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

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

revision 889, Thu Jul 19 20:35:20 2001 UTC revision 984, Wed Nov 21 19:00:08 2001 UTC
# Line 3  Line 3 
3   * COPYRIGHT (c) 1997 Bell Laboratories.   * COPYRIGHT (c) 1997 Bell Laboratories.
4   *)   *)
5    
6  functor X86Props(X86Instr : X86INSTR) : INSN_PROPERTIES =  functor X86Props
7      (structure Instr : X86INSTR
8       structure MLTreeHash : MLTREE_HASH where T = Instr.T
9       structure MLTreeEval : MLTREE_EVAL where T = Instr.T
10      ) : INSN_PROPERTIES =
11  struct  struct
12    structure I = X86Instr    structure I = Instr
13    structure C = I.C    structure C = I.C
   structure LE = I.LabelExp  
14    structure T = I.T    structure T = I.T
15    structure CB = CellsBasis    structure CB = CellsBasis
16    
# Line 103  Line 106 
106    *  Hashing and Equality on operands    *  Hashing and Equality on operands
107    *=====================================================================*)    *=====================================================================*)
108     fun hashOpn(I.Immed i) = Word.fromInt(Int32.toInt i)     fun hashOpn(I.Immed i) = Word.fromInt(Int32.toInt i)
109       | hashOpn(I.ImmedLabel le) = LE.hash le + 0w123       | hashOpn(I.ImmedLabel le) = MLTreeHash.hash le + 0w123
110       | hashOpn(I.Relative i) = Word.fromInt i + 0w1232       | hashOpn(I.Relative i) = Word.fromInt i + 0w1232
111       | hashOpn(I.LabelEA le) = LE.hash le + 0w44444       | hashOpn(I.LabelEA le) = MLTreeHash.hash le + 0w44444
112       | hashOpn(I.Direct r)  = CB.hashCell r       | hashOpn(I.Direct r)  = CB.hashCell r
113       | hashOpn(I.MemReg r)  = CB.hashCell r + 0w2123       | hashOpn(I.MemReg r)  = CB.hashCell r + 0w2123
114       | hashOpn(I.ST f) = CB.hashCell f + 0w88       | hashOpn(I.ST f) = CB.hashCell f + 0w88
# Line 116  Line 119 
119       | hashOpn(I.Indexed {base, index, scale, disp, ...}) =       | hashOpn(I.Indexed {base, index, scale, disp, ...}) =
120           CB.hashCell index + Word.fromInt scale + hashOpn disp           CB.hashCell index + Word.fromInt scale + hashOpn disp
121     fun eqOpn(I.Immed a,I.Immed b) = a = b     fun eqOpn(I.Immed a,I.Immed b) = a = b
122       | eqOpn(I.ImmedLabel a,I.ImmedLabel b) = LE.==(a,b)       | eqOpn(I.ImmedLabel a,I.ImmedLabel b) = MLTreeEval.==(a,b)
123       | eqOpn(I.Relative a,I.Relative b) = a = b       | eqOpn(I.Relative a,I.Relative b) = a = b
124       | eqOpn(I.LabelEA a,I.LabelEA b) = LE.==(a,b)       | eqOpn(I.LabelEA a,I.LabelEA b) = MLTreeEval.==(a,b)
125       | eqOpn(I.Direct a,I.Direct b) = CB.sameColor(a,b)       | eqOpn(I.Direct a,I.Direct b) = CB.sameColor(a,b)
126       | eqOpn(I.MemReg a,I.MemReg b) = CB.sameColor(a,b)       | eqOpn(I.MemReg a,I.MemReg b) = CB.sameColor(a,b)
127       | eqOpn(I.FDirect a,I.FDirect b) = CB.sameColor(a,b)       | eqOpn(I.FDirect a,I.FDirect b) = CB.sameColor(a,b)

Legend:
Removed from v.889  
changed lines
  Added in v.984

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