Debian Codegraph @

lib/mlrisc-lib/MLRISC/mltree/mltree-size.sml

raw
1 functor MLTreeSize
2 (structure T : MLTREE
3 val intTy : T.ty (* size of integer word *)
4 ) : MLTREE_SIZE =
5 struct
6 structure T = T
7
8 val intTy = intTy
9
10 fun size(T.REG(ty,_)) = ty
11 | size(T.LI _) = intTy
12 | size(T.LABEL _) = intTy
13 | size(T.CONST _) = intTy
14 | size(T.LABEXP e) = size e
15 | size(T.NEG(ty,_)) = ty
16 | size(T.ADD(ty,_,_)) = ty
17 | size(T.SUB(ty,_,_)) = ty
18 | size(T.MULS(ty,_,_)) = ty
19 | size(T.DIVS(_,ty,_,_)) = ty
20 | size(T.REMS(_,ty,_,_)) = ty
21 | size(T.MULU(ty,_,_)) = ty
22 | size(T.DIVU(ty,_,_)) = ty
23 | size(T.REMU(ty,_,_)) = ty
24 | size(T.NEGT(ty,_)) = ty
25 | size(T.ADDT(ty,_,_)) = ty
26 | size(T.SUBT(ty,_,_)) = ty
27 | size(T.MULT(ty,_,_)) = ty
28 | size(T.DIVT(_,ty,_,_)) = ty
29 | size(T.ANDB(ty,_,_)) = ty
30 | size(T.ORB(ty,_,_)) = ty
31 | size(T.XORB(ty,_,_)) = ty
32 | size(T.EQVB(ty,_,_)) = ty
33 | size(T.NOTB(ty,_)) = ty
34 | size(T.SRA(ty,_,_)) = ty
35 | size(T.SRL(ty,_,_)) = ty
36 | size(T.SLL(ty,_,_)) = ty
37 | size(T.SX(ty,_,_)) = ty
38 | size(T.ZX(ty,_,_)) = ty
39 | size(T.CVTF2I(ty,_,_,_)) = ty
40 | size(T.COND(ty,_,_,_)) = ty
41 | size(T.LOAD(ty,_,_)) = ty
42 | size(T.PRED(e,_)) = size e
43 | size(T.LET(_,e)) = size e
44 | size(T.REXT(ty,_)) = ty
45 | size(T.MARK(e,_)) = size e
46 | size(T.OP(ty,_,_)) = ty
47 | size(T.ARG(ty,_,_)) = ty
48 | size(T.$(ty,_,_)) = ty
49 | size(T.PARAM _) = intTy
50 | size(T.BITSLICE(ty,_,_)) = ty
51 | size(T.???) = intTy
52
53 fun fsize(T.FREG(ty,_)) = ty
54 | fsize(T.FLOAD(ty,_,_)) = ty
55 | fsize(T.FADD(ty,_,_)) = ty
56 | fsize(T.FSUB(ty,_,_)) = ty
57 | fsize(T.FMUL(ty,_,_)) = ty
58 | fsize(T.FDIV(ty,_,_)) = ty
59 | fsize(T.FABS(ty,_)) = ty
60 | fsize(T.FNEG(ty,_)) = ty
61 | fsize(T.FSQRT(ty,_)) = ty
62 | fsize(T.FCOND(ty,_,_,_)) = ty
63 | fsize(T.CVTI2F(ty,_,_)) = ty
64 | fsize(T.CVTF2F(ty,_,_)) = ty
65 | fsize(T.FCOPYSIGN(ty,_,_)) = ty
66 | fsize(T.FPRED(e,_)) = fsize e
67 | fsize(T.FEXT(ty,_)) = ty
68 | fsize(T.FMARK(e,_)) = fsize e
69
70 end