annotate agent/src/share/classes/sun/jvm/hotspot/asm/x86/FloatDecoder.java @ 0:a61af66fc99e jdk7-b24

Initial load
author duke
date Sat, 01 Dec 2007 00:00:00 +0000
parents
children c18cbe5936b8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
2 * Copyright 2002-2003 Sun Microsystems, Inc. All Rights Reserved.
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
a61af66fc99e Initial load
duke
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 * have any questions.
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 package sun.jvm.hotspot.asm.x86;
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 import sun.jvm.hotspot.asm.*;
a61af66fc99e Initial load
duke
parents:
diff changeset
28
a61af66fc99e Initial load
duke
parents:
diff changeset
29 public class FloatDecoder extends FPInstructionDecoder {
a61af66fc99e Initial load
duke
parents:
diff changeset
30
a61af66fc99e Initial load
duke
parents:
diff changeset
31 public FloatDecoder() {
a61af66fc99e Initial load
duke
parents:
diff changeset
32 super(null);
a61af66fc99e Initial load
duke
parents:
diff changeset
33 }
a61af66fc99e Initial load
duke
parents:
diff changeset
34
a61af66fc99e Initial load
duke
parents:
diff changeset
35 //Please refer to IA-32 Intel Architecture Software Developer's Manual Volume 2
a61af66fc99e Initial load
duke
parents:
diff changeset
36 //APPENDIX A - Escape opcodes
a61af66fc99e Initial load
duke
parents:
diff changeset
37
a61af66fc99e Initial load
duke
parents:
diff changeset
38 /*When ModR/M byte is within 00h to BFh*/
a61af66fc99e Initial load
duke
parents:
diff changeset
39 private static final FPInstructionDecoder floatMapOne[][] = {
a61af66fc99e Initial load
duke
parents:
diff changeset
40 /* d8 */
a61af66fc99e Initial load
duke
parents:
diff changeset
41 {
a61af66fc99e Initial load
duke
parents:
diff changeset
42 new FPArithmeticDecoder("fadds", ADDR_E, v_mode, RTLOP_ADD),
a61af66fc99e Initial load
duke
parents:
diff changeset
43 new FPArithmeticDecoder("fmuls", ADDR_E, v_mode, RTLOP_SMUL),
a61af66fc99e Initial load
duke
parents:
diff changeset
44 new FPInstructionDecoder("fcoms", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
45 new FPInstructionDecoder("fcomps", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
46 new FPArithmeticDecoder("fsubs", ADDR_E, v_mode, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
47 new FPArithmeticDecoder("fsubrs", ADDR_E, v_mode, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
48 new FPArithmeticDecoder("fdivs", ADDR_E, v_mode, RTLOP_SDIV),
a61af66fc99e Initial load
duke
parents:
diff changeset
49 new FPArithmeticDecoder("fdivrs", ADDR_E, v_mode, RTLOP_SDIV)
a61af66fc99e Initial load
duke
parents:
diff changeset
50 },
a61af66fc99e Initial load
duke
parents:
diff changeset
51 /* d9 */
a61af66fc99e Initial load
duke
parents:
diff changeset
52 {
a61af66fc99e Initial load
duke
parents:
diff changeset
53 new FPLoadDecoder("flds", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
54 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
55 new FPStoreDecoder("fsts", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
56 new FPStoreDecoder("fstps", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
57 new FPStoreDecoder("fldenv", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
58 new FPStoreDecoder("fldcw", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
59 new FPStoreDecoder("fNstenv", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
60 new FPStoreDecoder("fNstcw", ADDR_E, v_mode)
a61af66fc99e Initial load
duke
parents:
diff changeset
61 },
a61af66fc99e Initial load
duke
parents:
diff changeset
62 /* da */
a61af66fc99e Initial load
duke
parents:
diff changeset
63 {
a61af66fc99e Initial load
duke
parents:
diff changeset
64 new FPArithmeticDecoder("fiaddl", ADDR_E, v_mode, RTLOP_ADD),
a61af66fc99e Initial load
duke
parents:
diff changeset
65 new FPArithmeticDecoder("fimull", ADDR_E, v_mode, RTLOP_SMUL),
a61af66fc99e Initial load
duke
parents:
diff changeset
66 new FPInstructionDecoder("ficoml", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
67 new FPInstructionDecoder("ficompl", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
68 new FPArithmeticDecoder("fisubl", ADDR_E, v_mode, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
69 new FPArithmeticDecoder("fisubrl", ADDR_E, v_mode, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
70 new FPArithmeticDecoder("fidivl", ADDR_E, v_mode, RTLOP_SDIV),
a61af66fc99e Initial load
duke
parents:
diff changeset
71 new FPArithmeticDecoder("fidivrl", ADDR_E, v_mode, RTLOP_SDIV)
a61af66fc99e Initial load
duke
parents:
diff changeset
72 },
a61af66fc99e Initial load
duke
parents:
diff changeset
73 /* db */
a61af66fc99e Initial load
duke
parents:
diff changeset
74 {
a61af66fc99e Initial load
duke
parents:
diff changeset
75 new FPLoadDecoder("fildl", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
76 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
77 new FPStoreDecoder("fistl", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
78 new FPStoreDecoder("fistpl", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
79 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
80 new FPLoadDecoder("fldt", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
81 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
82 new FPStoreDecoder("fstpt", ADDR_E, v_mode)
a61af66fc99e Initial load
duke
parents:
diff changeset
83 },
a61af66fc99e Initial load
duke
parents:
diff changeset
84 /* dc */
a61af66fc99e Initial load
duke
parents:
diff changeset
85 {
a61af66fc99e Initial load
duke
parents:
diff changeset
86 new FPArithmeticDecoder("faddl", ADDR_E, v_mode, RTLOP_ADD),
a61af66fc99e Initial load
duke
parents:
diff changeset
87 new FPArithmeticDecoder("fmull", ADDR_E, v_mode, RTLOP_SMUL),
a61af66fc99e Initial load
duke
parents:
diff changeset
88 new FPInstructionDecoder("fcoml", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
89 new FPInstructionDecoder("fcompl", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
90 new FPArithmeticDecoder("fsubl", ADDR_E, v_mode, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
91 new FPArithmeticDecoder("fsubrl", ADDR_E, v_mode, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
92 new FPArithmeticDecoder("fdivl", ADDR_E, v_mode, RTLOP_SDIV),
a61af66fc99e Initial load
duke
parents:
diff changeset
93 new FPArithmeticDecoder("fdivrl", ADDR_E, v_mode, RTLOP_SDIV)
a61af66fc99e Initial load
duke
parents:
diff changeset
94 },
a61af66fc99e Initial load
duke
parents:
diff changeset
95 /* dd */
a61af66fc99e Initial load
duke
parents:
diff changeset
96 {
a61af66fc99e Initial load
duke
parents:
diff changeset
97 new FPLoadDecoder("fldl", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
98 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
99 new FPStoreDecoder("fstl", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
100 new FPStoreDecoder("fstpl", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
101 new FPStoreDecoder("frstor", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
102 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
103 new FPStoreDecoder("fNsave", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
104 new FPStoreDecoder("fNstsw", ADDR_E, v_mode)
a61af66fc99e Initial load
duke
parents:
diff changeset
105 },
a61af66fc99e Initial load
duke
parents:
diff changeset
106 /* de */
a61af66fc99e Initial load
duke
parents:
diff changeset
107 {
a61af66fc99e Initial load
duke
parents:
diff changeset
108 new FPArithmeticDecoder("fiadd", ADDR_E, v_mode, RTLOP_ADD),
a61af66fc99e Initial load
duke
parents:
diff changeset
109 new FPArithmeticDecoder("fimul", ADDR_E, v_mode, RTLOP_SMUL),
a61af66fc99e Initial load
duke
parents:
diff changeset
110 new FPInstructionDecoder("ficom", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
111 new FPInstructionDecoder("ficomp", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
112 new FPArithmeticDecoder("fisub", ADDR_E, v_mode, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
113 new FPArithmeticDecoder("fisubr", ADDR_E, v_mode, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
114 new FPArithmeticDecoder("fidiv", ADDR_E, v_mode, RTLOP_SDIV),
a61af66fc99e Initial load
duke
parents:
diff changeset
115 new FPArithmeticDecoder("fidivr", ADDR_E, v_mode, RTLOP_SDIV)
a61af66fc99e Initial load
duke
parents:
diff changeset
116 },
a61af66fc99e Initial load
duke
parents:
diff changeset
117 /* df */
a61af66fc99e Initial load
duke
parents:
diff changeset
118 {
a61af66fc99e Initial load
duke
parents:
diff changeset
119 new FPLoadDecoder("fild", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
120 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
121 new FPStoreDecoder("fist", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
122 new FPStoreDecoder("fistp", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
123 new FPLoadDecoder("fbld", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
124 new FPLoadDecoder("fildll", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
125 new FPStoreDecoder("fbstp", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
126 new FPStoreDecoder("fistpll", ADDR_E, v_mode)
a61af66fc99e Initial load
duke
parents:
diff changeset
127 }
a61af66fc99e Initial load
duke
parents:
diff changeset
128 };
a61af66fc99e Initial load
duke
parents:
diff changeset
129
a61af66fc99e Initial load
duke
parents:
diff changeset
130 /*When ModR/M byte is outside 00h to BFh*/
a61af66fc99e Initial load
duke
parents:
diff changeset
131 private static final FPInstructionDecoder floatMapTwo[][] = {
a61af66fc99e Initial load
duke
parents:
diff changeset
132
a61af66fc99e Initial load
duke
parents:
diff changeset
133 /* d8 */
a61af66fc99e Initial load
duke
parents:
diff changeset
134 /*parameter for ADDR_FPREG, 0 means ST(0), 1 means ST at rm value. */
a61af66fc99e Initial load
duke
parents:
diff changeset
135 {
a61af66fc99e Initial load
duke
parents:
diff changeset
136 new FPArithmeticDecoder("fadd", ADDR_FPREG, 0, ADDR_FPREG, 1, RTLOP_ADD),
a61af66fc99e Initial load
duke
parents:
diff changeset
137 new FPArithmeticDecoder("fmul", ADDR_FPREG, 0, ADDR_FPREG, 1, RTLOP_SMUL),
a61af66fc99e Initial load
duke
parents:
diff changeset
138 new FPInstructionDecoder("fcom", ADDR_FPREG, 1),
a61af66fc99e Initial load
duke
parents:
diff changeset
139 new FPInstructionDecoder("fcomp", ADDR_FPREG, 1),
a61af66fc99e Initial load
duke
parents:
diff changeset
140 new FPArithmeticDecoder("fsub", ADDR_FPREG, 0, ADDR_FPREG, 1, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
141 new FPArithmeticDecoder("fsubr", ADDR_FPREG, 0, ADDR_FPREG, 1, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
142 new FPArithmeticDecoder("fdiv", ADDR_FPREG, 0, ADDR_FPREG, 1, RTLOP_SDIV),
a61af66fc99e Initial load
duke
parents:
diff changeset
143 new FPArithmeticDecoder("fdivr", ADDR_FPREG, 0, ADDR_FPREG, 1, RTLOP_SDIV)
a61af66fc99e Initial load
duke
parents:
diff changeset
144 },
a61af66fc99e Initial load
duke
parents:
diff changeset
145 /* d9 */
a61af66fc99e Initial load
duke
parents:
diff changeset
146 {
a61af66fc99e Initial load
duke
parents:
diff changeset
147 new FPLoadDecoder("fld", ADDR_FPREG, 1),
a61af66fc99e Initial load
duke
parents:
diff changeset
148 new FPInstructionDecoder("fxch", ADDR_FPREG, 1),
a61af66fc99e Initial load
duke
parents:
diff changeset
149 new FloatGRPDecoder(null, 0),
a61af66fc99e Initial load
duke
parents:
diff changeset
150 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
151 new FloatGRPDecoder(null, 1),
a61af66fc99e Initial load
duke
parents:
diff changeset
152 new FloatGRPDecoder(null, 2),
a61af66fc99e Initial load
duke
parents:
diff changeset
153 new FloatGRPDecoder(null, 3),
a61af66fc99e Initial load
duke
parents:
diff changeset
154 new FloatGRPDecoder(null, 4)
a61af66fc99e Initial load
duke
parents:
diff changeset
155 },
a61af66fc99e Initial load
duke
parents:
diff changeset
156 /* da */
a61af66fc99e Initial load
duke
parents:
diff changeset
157 {
a61af66fc99e Initial load
duke
parents:
diff changeset
158 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
159 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
160 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
161 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
162 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
163 new FloatGRPDecoder(null, 5),
a61af66fc99e Initial load
duke
parents:
diff changeset
164 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
165 null
a61af66fc99e Initial load
duke
parents:
diff changeset
166 },
a61af66fc99e Initial load
duke
parents:
diff changeset
167 /* db */
a61af66fc99e Initial load
duke
parents:
diff changeset
168 {
a61af66fc99e Initial load
duke
parents:
diff changeset
169 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
170 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
171 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
172 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
173 new FloatGRPDecoder(null, 6),
a61af66fc99e Initial load
duke
parents:
diff changeset
174 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
175 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
176 null
a61af66fc99e Initial load
duke
parents:
diff changeset
177 },
a61af66fc99e Initial load
duke
parents:
diff changeset
178 /* dc */
a61af66fc99e Initial load
duke
parents:
diff changeset
179 {
a61af66fc99e Initial load
duke
parents:
diff changeset
180 new FPArithmeticDecoder("fadd", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_ADD),
a61af66fc99e Initial load
duke
parents:
diff changeset
181 new FPArithmeticDecoder("fmul", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SMUL),
a61af66fc99e Initial load
duke
parents:
diff changeset
182 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
183 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
184 new FPArithmeticDecoder("fsub", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
185 new FPArithmeticDecoder("fsubr",ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
186 new FPArithmeticDecoder("fdiv", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SDIV),
a61af66fc99e Initial load
duke
parents:
diff changeset
187 new FPArithmeticDecoder("fdivr", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SDIV)
a61af66fc99e Initial load
duke
parents:
diff changeset
188 },
a61af66fc99e Initial load
duke
parents:
diff changeset
189 /* dd */
a61af66fc99e Initial load
duke
parents:
diff changeset
190 {
a61af66fc99e Initial load
duke
parents:
diff changeset
191 new FPInstructionDecoder("ffree", ADDR_FPREG, 1),
a61af66fc99e Initial load
duke
parents:
diff changeset
192 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
193 new FPStoreDecoder("fst", ADDR_FPREG, 1),
a61af66fc99e Initial load
duke
parents:
diff changeset
194 new FPStoreDecoder("fstp", ADDR_FPREG, 1),
a61af66fc99e Initial load
duke
parents:
diff changeset
195 new FPInstructionDecoder("fucom", ADDR_FPREG, 1),
a61af66fc99e Initial load
duke
parents:
diff changeset
196 new FPInstructionDecoder("fucomp", ADDR_FPREG, 1),
a61af66fc99e Initial load
duke
parents:
diff changeset
197 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
198 null
a61af66fc99e Initial load
duke
parents:
diff changeset
199 },
a61af66fc99e Initial load
duke
parents:
diff changeset
200 /* de */
a61af66fc99e Initial load
duke
parents:
diff changeset
201 {
a61af66fc99e Initial load
duke
parents:
diff changeset
202 new FPArithmeticDecoder("faddp", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_ADD),
a61af66fc99e Initial load
duke
parents:
diff changeset
203 new FPArithmeticDecoder("fmulp", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SMUL),
a61af66fc99e Initial load
duke
parents:
diff changeset
204 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
205 new FloatGRPDecoder(null, 7),
a61af66fc99e Initial load
duke
parents:
diff changeset
206 new FPArithmeticDecoder("fsubrp", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
207 new FPArithmeticDecoder("fsubp", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
208 new FPArithmeticDecoder("fdivrp", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SDIV),
a61af66fc99e Initial load
duke
parents:
diff changeset
209 new FPArithmeticDecoder("fdivp", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SDIV)
a61af66fc99e Initial load
duke
parents:
diff changeset
210 },
a61af66fc99e Initial load
duke
parents:
diff changeset
211 /* df */
a61af66fc99e Initial load
duke
parents:
diff changeset
212 {
a61af66fc99e Initial load
duke
parents:
diff changeset
213 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
214 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
215 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
216 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
217 new FloatGRPDecoder(null, 7),
a61af66fc99e Initial load
duke
parents:
diff changeset
218 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
219 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
220 null
a61af66fc99e Initial load
duke
parents:
diff changeset
221 }
a61af66fc99e Initial load
duke
parents:
diff changeset
222 };
a61af66fc99e Initial load
duke
parents:
diff changeset
223
a61af66fc99e Initial load
duke
parents:
diff changeset
224 public Instruction decode(byte[] bytesArray, int index, int instrStartIndex, int segmentOverride, int prefixes, X86InstructionFactory factory) {
a61af66fc99e Initial load
duke
parents:
diff changeset
225 this.byteIndex = index;
a61af66fc99e Initial load
duke
parents:
diff changeset
226 this.instrStartIndex = instrStartIndex;
a61af66fc99e Initial load
duke
parents:
diff changeset
227 this.prefixes = prefixes;
a61af66fc99e Initial load
duke
parents:
diff changeset
228
a61af66fc99e Initial load
duke
parents:
diff changeset
229 int ModRM = readByte(bytesArray, byteIndex);
a61af66fc99e Initial load
duke
parents:
diff changeset
230 int reg = (ModRM >> 3) & 7;
a61af66fc99e Initial load
duke
parents:
diff changeset
231 int regOrOpcode = (ModRM >> 3) & 7;
a61af66fc99e Initial load
duke
parents:
diff changeset
232 int rm = ModRM & 7;
a61af66fc99e Initial load
duke
parents:
diff changeset
233
a61af66fc99e Initial load
duke
parents:
diff changeset
234 int floatOpcode = InstructionDecoder.readByte(bytesArray, instrStartIndex);
a61af66fc99e Initial load
duke
parents:
diff changeset
235 FPInstructionDecoder instrDecoder = null;
a61af66fc99e Initial load
duke
parents:
diff changeset
236
a61af66fc99e Initial load
duke
parents:
diff changeset
237 if(ModRM < 0xbf) {
a61af66fc99e Initial load
duke
parents:
diff changeset
238 instrDecoder = floatMapOne[floatOpcode - 0xd8][reg];
a61af66fc99e Initial load
duke
parents:
diff changeset
239 }
a61af66fc99e Initial load
duke
parents:
diff changeset
240 else {
a61af66fc99e Initial load
duke
parents:
diff changeset
241 instrDecoder = floatMapTwo[floatOpcode - 0xd8][reg];
a61af66fc99e Initial load
duke
parents:
diff changeset
242 }
a61af66fc99e Initial load
duke
parents:
diff changeset
243
a61af66fc99e Initial load
duke
parents:
diff changeset
244 Instruction instr = null;
a61af66fc99e Initial load
duke
parents:
diff changeset
245 if(instrDecoder != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
246 instr = instrDecoder.decode(bytesArray, byteIndex, instrStartIndex, segmentOverride, prefixes, factory);
a61af66fc99e Initial load
duke
parents:
diff changeset
247 byteIndex = instrDecoder.getCurrentIndex();
a61af66fc99e Initial load
duke
parents:
diff changeset
248 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
249 instr = factory.newIllegalInstruction();
a61af66fc99e Initial load
duke
parents:
diff changeset
250 }
a61af66fc99e Initial load
duke
parents:
diff changeset
251 return instr;
a61af66fc99e Initial load
duke
parents:
diff changeset
252 }
a61af66fc99e Initial load
duke
parents:
diff changeset
253 }