some updates.
[hs-java.git] / JVM / Generator / Instructions.hs
1
2 module JVM.Generator.Instructions where
3
4 import JVM.ClassFile
5 import JVM.Assembler
6 import JVM.Generator
7
8 nop = i0 NOP
9 aconst_null = i0 ACONST_NULL
10 iconst_m1 = i0 ICONST_M1
11 iconst_0 = i0 ICONST_0
12 iconst_1 = i0 ICONST_1
13 iconst_2 = i0 ICONST_2
14 iconst_3 = i0 ICONST_3
15 iconst_4 = i0 ICONST_4
16 iconst_5 = i0 ICONST_5
17 lconst_0 = i0 LCONST_0
18 lconst_1 = i0 LCONST_1
19 fconst_0 = i0 FCONST_0
20 fconst_1 = i0 FCONST_1
21 fconst_2 = i0 FCONST_2
22 dconst_0 = i0 DCONST_0
23 dconst_1 = i0 DCONST_1
24
25 bipush x = i0 (BIPUSH x)
26 sipush x = i0 (SIPUSH x)
27 ldc1 x = i8 LDC1 x
28 ldc2 x = i1 LDC2 x
29 ldc2w x = i1 LDC2W x
30 iload x = i8 ILOAD x
31 lload x = i8 LLOAD x
32 fload x = i8 FLOAD x
33 dload x = i8 DLOAD x
34 aload x = i8 ALOAD x
35
36 iload_ x = i0 (ILOAD_ x)
37 lload_ x = i0 (LLOAD_ x)
38 fload_ x = i0 (FLOAD_ x)
39 dload_ x = i0 (DLOAD_ x)
40 aload_ x = i0 (ALOAD_ x)
41
42 iaload = i0 IALOAD
43 laload = i0 LALOAD
44 faload = i0 FALOAD
45 daload = i0 DALOAD
46 aaload = i0 AALOAD
47 caload = i0 CALOAD
48 saload = i0 SALOAD
49
50 istore x = i8 ISTORE x
51 lstore x = i8 LSTORE x
52 fstore x = i8 FSTORE x
53 dstore x = i8 DSTORE x
54 astore x = i8 ASTORE x
55
56 istore_ x = i0 (ISTORE x)
57 lstore_ x = i0 (LSTORE x)
58 fstore_ x = i0 (FSTORE x)
59 dstore_ x = i0 (DSTORE x)
60 astore_ x = i0 (ASTORE x)
61
62 iastore = i0 IASTORE
63 lastore = i0 LASTORE
64 fastore = i0 FASTORE
65 dastore = i0 DASTORE
66 aastore = i0 AASTORE
67 bastore = i0 BASTORE
68 castore = i0 CASTORE
69 sastore = i0 SASTORE
70
71 pop     = i0 POP    
72 pop2    = i0 POP2   
73 dup     = i0 DUP    
74 dup_x1  = i0 DUP_X1 
75 dup_x2  = i0 DUP_X2 
76 dup2    = i0 DUP2   
77 dup2_x1 = i0 DUP2_X1
78 dup2_x2 = i0 DUP2_X2
79 swap    = i0 SWAP   
80 iadd    = i0 IADD   
81 ladd    = i0 LADD   
82 fadd    = i0 FADD   
83 dadd    = i0 DADD   
84 isub    = i0 ISUB   
85 lsub    = i0 LSUB   
86 fsub    = i0 FSUB   
87 dsub    = i0 DSUB   
88 imul    = i0 IMUL   
89 lmul    = i0 LMUL   
90 fmul    = i0 FMUL   
91 dmul    = i0 DMUL   
92 idiv    = i0 IDIV   
93 ldiv    = i0 LDIV   
94 fdiv    = i0 FDIV   
95 ddiv    = i0 DDIV   
96 irem    = i0 IREM   
97 lrem    = i0 LREM   
98 frem    = i0 FREM   
99 drem    = i0 DREM   
100 ineg    = i0 INEG   
101 lneg    = i0 LNEG   
102 fneg    = i0 FNEG   
103 dneg    = i0 DNEG   
104 ishl    = i0 ISHL   
105 lshl    = i0 LSHL   
106 ishr    = i0 ISHR   
107 lshr    = i0 LSHR   
108 iushr   = i0 IUSHR  
109 lushr   = i0 LUSHR  
110 iand    = i0 IAND   
111 land    = i0 LAND   
112 ior     = i0 IOR    
113 lor     = i0 LOR    
114 ixor    = i0 IXOR   
115 lxor    = i0 LXOR   
116
117 iinc x y = i0 (IINC x y)
118
119 i2l  = i0 I2L 
120 i2f  = i0 I2F 
121 i2d  = i0 I2D 
122 l2i  = i0 L2I 
123 l2f  = i0 L2F 
124 l2d  = i0 L2D 
125 f2i  = i0 F2I 
126 f2l  = i0 F2L 
127 f2d  = i0 F2D 
128 d2i  = i0 D2I 
129 d2l  = i0 D2L 
130 d2f  = i0 D2F 
131 i2b  = i0 I2B 
132 i2c  = i0 I2C 
133 i2s  = i0 I2S 
134 lcmp = i0 LCMP
135
136 new cls =
137   i1 NEW (CClass cls)
138
139 newArray t =
140   i0 (NEWARRAY $ atype2byte t)
141
142 allocNewArray cls =
143   i1 ANEWARRAY (CClass cls)
144
145 invokeVirtual cls sig =
146   i1 INVOKEVIRTUAL (CMethod cls sig)
147
148 invokeStatic cls sig =
149   i1 INVOKESTATIC (CMethod cls sig)
150
151 invokeSpecial cls sig =
152   i1 INVOKESPECIAL (CMethod cls sig)
153
154 getStaticField cls sig =
155   i1 GETSTATIC (CField cls sig)
156
157 loadString str =
158   i8 LDC1 (CString str)
159
160 allocArray cls =
161   i1 ANEWARRAY (CClass cls)
162