Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/low-il/low-il.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/low-il/low-il.sml

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

revision 2838, Tue Nov 25 03:40:24 2014 UTC revision 2870, Wed Feb 25 21:47:43 2015 UTC
# Line 38  Line 38 
38        | IMul        | IMul
39        | IDiv        | IDiv
40        | INeg        | INeg
41          | R of ty
42        | IndexTensor of int * ty * ty        | IndexTensor of int * ty * ty
43        | ProjectTensor of int * int * ty * ty        | ProjectTensor of int * int * ty * ty
44        | addSca        | addSca
45        | subSca        | subSca
46        | prodSca        | prodSca
47        | divSca        | divSca
48          | powRat of ty
49          | powInt
50        | addVec of int        | addVec of int
51        | subVec of int        | subVec of int
52        | prodVec of int        | prodVec of int
# Line 103  Line 106 
106        | resultArity IMul = 1        | resultArity IMul = 1
107        | resultArity IDiv = 1        | resultArity IDiv = 1
108        | resultArity INeg = 1        | resultArity INeg = 1
109          | resultArity (R _) = 1
110        | resultArity (IndexTensor _) = 1        | resultArity (IndexTensor _) = 1
111        | resultArity (ProjectTensor _) = 1        | resultArity (ProjectTensor _) = 1
112        | resultArity addSca = 1        | resultArity addSca = 1
113        | resultArity subSca = 1        | resultArity subSca = 1
114        | resultArity prodSca = 1        | resultArity prodSca = 1
115        | resultArity divSca = 1        | resultArity divSca = 1
116          | resultArity (powRat _) = 1
117          | resultArity powInt = 1
118        | resultArity (addVec _) = 1        | resultArity (addVec _) = 1
119        | resultArity (subVec _) = 1        | resultArity (subVec _) = 1
120        | resultArity (prodVec _) = 1        | resultArity (prodVec _) = 1
# Line 168  Line 174 
174        | arity IMul = 2        | arity IMul = 2
175        | arity IDiv = 2        | arity IDiv = 2
176        | arity INeg = 1        | arity INeg = 1
177          | arity (R _) = 1
178        | arity (IndexTensor _) = 2        | arity (IndexTensor _) = 2
179        | arity (ProjectTensor _) = 2        | arity (ProjectTensor _) = 2
180        | arity addSca = 2        | arity addSca = 2
181        | arity subSca = 2        | arity subSca = 2
182        | arity prodSca = 2        | arity prodSca = 2
183        | arity divSca = 2        | arity divSca = 2
184          | arity (powRat _) = 2
185          | arity powInt = 2
186        | arity (addVec _) = 2        | arity (addVec _) = 2
187        | arity (subVec _) = 2        | arity (subVec _) = 2
188        | arity (prodVec _) = 2        | arity (prodVec _) = 2
# Line 240  Line 249 
249        | same (IMul, IMul) = true        | same (IMul, IMul) = true
250        | same (IDiv, IDiv) = true        | same (IDiv, IDiv) = true
251        | same (INeg, INeg) = true        | same (INeg, INeg) = true
252          | same (R(a0), R(b0)) = samety(a0, b0)
253        | same (IndexTensor(a0,a1,a2), IndexTensor(b0,b1,b2)) = sameint(a0, b0) andalso samety(a1, b1) andalso samety(a2, b2)        | same (IndexTensor(a0,a1,a2), IndexTensor(b0,b1,b2)) = sameint(a0, b0) andalso samety(a1, b1) andalso samety(a2, b2)
254        | same (ProjectTensor(a0,a1,a2,a3), ProjectTensor(b0,b1,b2,b3)) = sameint(a0, b0) andalso sameint(a1, b1) andalso samety(a2, b2) andalso samety(a3, b3)        | same (ProjectTensor(a0,a1,a2,a3), ProjectTensor(b0,b1,b2,b3)) = sameint(a0, b0) andalso sameint(a1, b1) andalso samety(a2, b2) andalso samety(a3, b3)
255        | same (addSca, addSca) = true        | same (addSca, addSca) = true
256        | same (subSca, subSca) = true        | same (subSca, subSca) = true
257        | same (prodSca, prodSca) = true        | same (prodSca, prodSca) = true
258        | same (divSca, divSca) = true        | same (divSca, divSca) = true
259          | same (powRat(a0), powRat(b0)) = samety(a0, b0)
260          | same (powInt, powInt) = true
261        | same (addVec(a0), addVec(b0)) = sameint(a0, b0)        | same (addVec(a0), addVec(b0)) = sameint(a0, b0)
262        | same (subVec(a0), subVec(b0)) = sameint(a0, b0)        | same (subVec(a0), subVec(b0)) = sameint(a0, b0)
263        | same (prodVec(a0), prodVec(b0)) = sameint(a0, b0)        | same (prodVec(a0), prodVec(b0)) = sameint(a0, b0)
# Line 306  Line 318 
318        | hash IMul = 0w7        | hash IMul = 0w7
319        | hash IDiv = 0w11        | hash IDiv = 0w11
320        | hash INeg = 0w13        | hash INeg = 0w13
321        | hash (IndexTensor(a0,a1,a2)) = 0w17 + hashint a0 + hashty a1 + hashty a2        | hash (R(a0)) = 0w17 + hashty a0
322        | hash (ProjectTensor(a0,a1,a2,a3)) = 0w19 + hashint a0 + hashint a1 + hashty a2 + hashty a3        | hash (IndexTensor(a0,a1,a2)) = 0w19 + hashint a0 + hashty a1 + hashty a2
323        | hash addSca = 0w23        | hash (ProjectTensor(a0,a1,a2,a3)) = 0w23 + hashint a0 + hashint a1 + hashty a2 + hashty a3
324        | hash subSca = 0w29        | hash addSca = 0w29
325        | hash prodSca = 0w31        | hash subSca = 0w31
326        | hash divSca = 0w37        | hash prodSca = 0w37
327        | hash (addVec(a0)) = 0w41 + hashint a0        | hash divSca = 0w41
328        | hash (subVec(a0)) = 0w43 + hashint a0        | hash (powRat(a0)) = 0w43 + hashty a0
329        | hash (prodVec(a0)) = 0w47 + hashint a0        | hash powInt = 0w47
330        | hash (prodScaV(a0)) = 0w53 + hashint a0        | hash (addVec(a0)) = 0w53 + hashint a0
331        | hash (sumVec(a0)) = 0w59 + hashint a0        | hash (subVec(a0)) = 0w59 + hashint a0
332        | hash (dotVec(a0)) = 0w61 + hashint a0        | hash (prodVec(a0)) = 0w61 + hashint a0
333        | hash (Abs(a0)) = 0w67 + hashty a0        | hash (prodScaV(a0)) = 0w67 + hashint a0
334        | hash (LT(a0)) = 0w71 + hashty a0        | hash (sumVec(a0)) = 0w71 + hashint a0
335        | hash (LTE(a0)) = 0w73 + hashty a0        | hash (dotVec(a0)) = 0w73 + hashint a0
336        | hash (EQ(a0)) = 0w79 + hashty a0        | hash (Abs(a0)) = 0w79 + hashty a0
337        | hash (NEQ(a0)) = 0w83 + hashty a0        | hash (LT(a0)) = 0w83 + hashty a0
338        | hash (GT(a0)) = 0w89 + hashty a0        | hash (LTE(a0)) = 0w89 + hashty a0
339        | hash (GTE(a0)) = 0w97 + hashty a0        | hash (EQ(a0)) = 0w97 + hashty a0
340        | hash Not = 0w101        | hash (NEQ(a0)) = 0w101 + hashty a0
341        | hash Max = 0w103        | hash (GT(a0)) = 0w103 + hashty a0
342        | hash Min = 0w107        | hash (GTE(a0)) = 0w107 + hashty a0
343        | hash (Clamp(a0)) = 0w109 + hashty a0        | hash Not = 0w109
344        | hash (Lerp(a0)) = 0w113 + hashty a0        | hash Max = 0w113
345        | hash (Normalize(a0)) = 0w127 + hashint a0        | hash Min = 0w127
346        | hash (PrincipleEvec(a0)) = 0w131 + hashty a0        | hash (Clamp(a0)) = 0w131 + hashty a0
347        | hash EigenVecs2x2 = 0w137        | hash (Lerp(a0)) = 0w137 + hashty a0
348        | hash EigenVecs3x3 = 0w139        | hash (Normalize(a0)) = 0w139 + hashint a0
349        | hash EigenVals2x2 = 0w149        | hash (PrincipleEvec(a0)) = 0w149 + hashty a0
350        | hash EigenVals3x3 = 0w151        | hash EigenVecs2x2 = 0w151
351        | hash (Zero(a0)) = 0w157 + hashty a0        | hash EigenVecs3x3 = 0w157
352        | hash (Select(a0,a1)) = 0w163 + hashty a0 + hashint a1        | hash EigenVals2x2 = 0w163
353        | hash (Index(a0,a1)) = 0w167 + hashty a0 + hashint a1        | hash EigenVals3x3 = 0w167
354        | hash (Subscript(a0)) = 0w173 + hashty a0        | hash (Zero(a0)) = 0w173 + hashty a0
355        | hash (MkDynamic(a0,a1)) = 0w179 + hashty a0 + hashint a1        | hash (Select(a0,a1)) = 0w179 + hashty a0 + hashint a1
356        | hash (Append(a0)) = 0w181 + hashty a0        | hash (Index(a0,a1)) = 0w181 + hashty a0 + hashint a1
357        | hash (Prepend(a0)) = 0w191 + hashty a0        | hash (Subscript(a0)) = 0w191 + hashty a0
358        | hash (Concat(a0)) = 0w193 + hashty a0        | hash (MkDynamic(a0,a1)) = 0w193 + hashty a0 + hashint a1
359        | hash Sqrt = 0w197        | hash (Append(a0)) = 0w197 + hashty a0
360        | hash (Ceiling(a0)) = 0w199 + hashint a0        | hash (Prepend(a0)) = 0w199 + hashty a0
361        | hash (Floor(a0)) = 0w211 + hashint a0        | hash (Concat(a0)) = 0w211 + hashty a0
362        | hash (Round(a0)) = 0w223 + hashint a0        | hash Sqrt = 0w223
363        | hash (Trunc(a0)) = 0w227 + hashint a0        | hash (Ceiling(a0)) = 0w227 + hashint a0
364        | hash IntToReal = 0w229        | hash (Floor(a0)) = 0w229 + hashint a0
365        | hash (RealToInt(a0)) = 0w233 + hashint a0        | hash (Round(a0)) = 0w233 + hashint a0
366        | hash (Transform(a0)) = 0w239 + ImageInfo.hash a0        | hash (Trunc(a0)) = 0w239 + hashint a0
367        | hash (Translate(a0)) = 0w241 + ImageInfo.hash a0        | hash IntToReal = 0w241
368        | hash (Kernel(a0,a1)) = 0w251 + Kernel.hash a0 + hashint a1        | hash (RealToInt(a0)) = 0w251 + hashint a0
369        | hash (ImageAddress(a0)) = 0w257 + ImageInfo.hash a0        | hash (Transform(a0)) = 0w257 + ImageInfo.hash a0
370        | hash (LoadVoxels(a0,a1)) = 0w263 + ImageInfo.hash a0 + hashint a1        | hash (Translate(a0)) = 0w263 + ImageInfo.hash a0
371        | hash (Inside(a0,a1)) = 0w269 + ImageInfo.hash a0 + hashint a1        | hash (Kernel(a0,a1)) = 0w269 + Kernel.hash a0 + hashint a1
372        | hash (LoadSeq(a0,a1)) = 0w271 + hashty a0 + hashstring a1        | hash (ImageAddress(a0)) = 0w271 + ImageInfo.hash a0
373        | hash (LoadImage(a0)) = 0w277 + ImageInfo.hash a0        | hash (LoadVoxels(a0,a1)) = 0w277 + ImageInfo.hash a0 + hashint a1
374        | hash (imgAddr(a0,a1,a2)) = 0w281 + ImageInfo.hash a0 + hashty a1 + hashint a2        | hash (Inside(a0,a1)) = 0w281 + ImageInfo.hash a0 + hashint a1
375        | hash (imgLoad(a0,a1,a2)) = 0w283 + ImageInfo.hash a0 + hashint a1 + hashint a2        | hash (LoadSeq(a0,a1)) = 0w283 + hashty a0 + hashstring a1
376        | hash (baseAddr(a0)) = 0w293 + ImageInfo.hash a0        | hash (LoadImage(a0)) = 0w293 + ImageInfo.hash a0
377        | hash (Input(a0,a1,a2)) = 0w307 + hashty a0 + hashstring a1 + hashstring a2        | hash (imgAddr(a0,a1,a2)) = 0w307 + ImageInfo.hash a0 + hashty a1 + hashint a2
378        | hash (InputWithDefault(a0,a1,a2)) = 0w311 + hashty a0 + hashstring a1 + hashstring a2        | hash (imgLoad(a0,a1,a2)) = 0w311 + ImageInfo.hash a0 + hashint a1 + hashint a2
379        | hash (Print(a0)) = 0w313 + hashtys a0        | hash (baseAddr(a0)) = 0w313 + ImageInfo.hash a0
380          | hash (Input(a0,a1,a2)) = 0w317 + hashty a0 + hashstring a1 + hashstring a2
381          | hash (InputWithDefault(a0,a1,a2)) = 0w331 + hashty a0 + hashstring a1 + hashstring a2
382          | hash (Print(a0)) = 0w337 + hashtys a0
383    
384      fun toString IAdd = "IAdd"      fun toString IAdd = "IAdd"
385        | toString ISub = "ISub"        | toString ISub = "ISub"
386        | toString IMul = "IMul"        | toString IMul = "IMul"
387        | toString IDiv = "IDiv"        | toString IDiv = "IDiv"
388        | toString INeg = "INeg"        | toString INeg = "INeg"
389          | toString (R(a0)) = concat["R<", tyToString a0, ">"]
390        | toString (IndexTensor(a0,a1,a2)) = concat["IndexTensor<", intToString a0, ",", tyToString a1, ",", tyToString a2, ">"]        | toString (IndexTensor(a0,a1,a2)) = concat["IndexTensor<", intToString a0, ",", tyToString a1, ",", tyToString a2, ">"]
391        | toString (ProjectTensor(a0,a1,a2,a3)) = concat["ProjectTensor<", intToString a0, ",", intToString a1, ",", tyToString a2, ",", tyToString a3, ">"]        | toString (ProjectTensor(a0,a1,a2,a3)) = concat["ProjectTensor<", intToString a0, ",", intToString a1, ",", tyToString a2, ",", tyToString a3, ">"]
392        | toString addSca = "addSca"        | toString addSca = "addSca"
393        | toString subSca = "subSca"        | toString subSca = "subSca"
394        | toString prodSca = "prodSca"        | toString prodSca = "prodSca"
395        | toString divSca = "divSca"        | toString divSca = "divSca"
396          | toString (powRat(a0)) = concat["powRat<", tyToString a0, ">"]
397          | toString powInt = "powInt"
398        | toString (addVec(a0)) = concat["addVec<", intToString a0, ">"]        | toString (addVec(a0)) = concat["addVec<", intToString a0, ">"]
399        | toString (subVec(a0)) = concat["subVec<", intToString a0, ">"]        | toString (subVec(a0)) = concat["subVec<", intToString a0, ">"]
400        | toString (prodVec(a0)) = concat["prodVec<", intToString a0, ">"]        | toString (prodVec(a0)) = concat["prodVec<", intToString a0, ">"]

Legend:
Removed from v.2838  
changed lines
  Added in v.2870

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