annotate agent/src/share/classes/sun/jvm/hotspot/asm/x86/GRPDecoder.java @ 2376:c7f3d0b4570f

7017732: move static fields into Class to prepare for perm gen removal Reviewed-by: kvn, coleenp, twisti, stefank
author never
date Fri, 18 Mar 2011 16:00:34 -0700
parents c18cbe5936b8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
2 * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
0
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 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
21 * questions.
0
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 GRPDecoder extends InstructionDecoder {
a61af66fc99e Initial load
duke
parents:
diff changeset
30
a61af66fc99e Initial load
duke
parents:
diff changeset
31 final private int number;
a61af66fc99e Initial load
duke
parents:
diff changeset
32 //Please refer to IA-32 Intel Architecture Software Developer's Manual Volume 2
a61af66fc99e Initial load
duke
parents:
diff changeset
33 //APPENDIX A - Table A-4. Opcode Extensions for One and Two-byte Opcodes by Group Number.
a61af66fc99e Initial load
duke
parents:
diff changeset
34 private static final InstructionDecoder grpTable[][] = {
a61af66fc99e Initial load
duke
parents:
diff changeset
35 {
a61af66fc99e Initial load
duke
parents:
diff changeset
36 new ArithmeticDecoder("addb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_ADD),
a61af66fc99e Initial load
duke
parents:
diff changeset
37 new LogicalDecoder("orb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_OR),
a61af66fc99e Initial load
duke
parents:
diff changeset
38 new ArithmeticDecoder("adcb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_ADDC),
a61af66fc99e Initial load
duke
parents:
diff changeset
39 new ArithmeticDecoder("sbbb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_SUBC),
a61af66fc99e Initial load
duke
parents:
diff changeset
40 new LogicalDecoder("andb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_AND),
a61af66fc99e Initial load
duke
parents:
diff changeset
41 new ArithmeticDecoder("subb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
42 new LogicalDecoder("xorb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_XOR),
a61af66fc99e Initial load
duke
parents:
diff changeset
43 new InstructionDecoder("cmpb", ADDR_E, b_mode, ADDR_I, b_mode)
a61af66fc99e Initial load
duke
parents:
diff changeset
44 },
a61af66fc99e Initial load
duke
parents:
diff changeset
45 {
a61af66fc99e Initial load
duke
parents:
diff changeset
46 new ArithmeticDecoder("addS", ADDR_E, v_mode, ADDR_I, v_mode, RTLOP_ADD),
a61af66fc99e Initial load
duke
parents:
diff changeset
47 new LogicalDecoder("orS", ADDR_E, v_mode, ADDR_I, v_mode, RTLOP_OR),
a61af66fc99e Initial load
duke
parents:
diff changeset
48 new ArithmeticDecoder("adcS", ADDR_E, v_mode, ADDR_I, v_mode, RTLOP_ADDC),
a61af66fc99e Initial load
duke
parents:
diff changeset
49 new ArithmeticDecoder("sbbS", ADDR_E, v_mode, ADDR_I, v_mode, RTLOP_SUBC),
a61af66fc99e Initial load
duke
parents:
diff changeset
50 new LogicalDecoder("andS", ADDR_E, v_mode, ADDR_I, v_mode, RTLOP_AND),
a61af66fc99e Initial load
duke
parents:
diff changeset
51 new ArithmeticDecoder("subS", ADDR_E, v_mode, ADDR_I, v_mode, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
52 new LogicalDecoder("xorS", ADDR_E, v_mode, ADDR_I, v_mode, RTLOP_XOR),
a61af66fc99e Initial load
duke
parents:
diff changeset
53 new InstructionDecoder("cmpS", ADDR_E, v_mode, ADDR_I, v_mode)
a61af66fc99e Initial load
duke
parents:
diff changeset
54 },
a61af66fc99e Initial load
duke
parents:
diff changeset
55 {
a61af66fc99e Initial load
duke
parents:
diff changeset
56 new ArithmeticDecoder("addS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_ADD), /*note: sIb here*/
a61af66fc99e Initial load
duke
parents:
diff changeset
57 new LogicalDecoder("orS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_OR),
a61af66fc99e Initial load
duke
parents:
diff changeset
58 new ArithmeticDecoder("adcS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_ADDC),
a61af66fc99e Initial load
duke
parents:
diff changeset
59 new ArithmeticDecoder("sbbS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_SUBC),
a61af66fc99e Initial load
duke
parents:
diff changeset
60 new LogicalDecoder("andS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_AND),
a61af66fc99e Initial load
duke
parents:
diff changeset
61 new ArithmeticDecoder("subS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
62 new LogicalDecoder("xorS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_XOR),
a61af66fc99e Initial load
duke
parents:
diff changeset
63 new InstructionDecoder("cmpS", ADDR_E, v_mode, ADDR_I, b_mode)
a61af66fc99e Initial load
duke
parents:
diff changeset
64 },
a61af66fc99e Initial load
duke
parents:
diff changeset
65 {
a61af66fc99e Initial load
duke
parents:
diff changeset
66 new RotateDecoder("rolb", ADDR_E, b_mode, ADDR_I, b_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
67 new RotateDecoder("rorb", ADDR_E, b_mode, ADDR_I, b_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
68 new RotateDecoder("rclb", ADDR_E, b_mode, ADDR_I, b_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
69 new RotateDecoder("rcrb", ADDR_E, b_mode, ADDR_I, b_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
70 new ShiftDecoder("shlb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_SLL),
a61af66fc99e Initial load
duke
parents:
diff changeset
71 new ShiftDecoder("shrb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_SRL),
a61af66fc99e Initial load
duke
parents:
diff changeset
72 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
73 new ShiftDecoder("sarb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_SRA),
a61af66fc99e Initial load
duke
parents:
diff changeset
74 },
a61af66fc99e Initial load
duke
parents:
diff changeset
75 {
a61af66fc99e Initial load
duke
parents:
diff changeset
76 new RotateDecoder("rolS", ADDR_E, v_mode, ADDR_I, b_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
77 new RotateDecoder("rorS", ADDR_E, v_mode, ADDR_I, b_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
78 new RotateDecoder("rclS", ADDR_E, v_mode, ADDR_I, b_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
79 new RotateDecoder("rcrS", ADDR_E, v_mode, ADDR_I, b_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
80 new ShiftDecoder("shlS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_SLL),
a61af66fc99e Initial load
duke
parents:
diff changeset
81 new ShiftDecoder("shrS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_SRL),
a61af66fc99e Initial load
duke
parents:
diff changeset
82 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
83 new ShiftDecoder("sarS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_SRA)
a61af66fc99e Initial load
duke
parents:
diff changeset
84 },
a61af66fc99e Initial load
duke
parents:
diff changeset
85 {
a61af66fc99e Initial load
duke
parents:
diff changeset
86 new RotateDecoder("rolb", ADDR_E, b_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
87 new RotateDecoder("rorb", ADDR_E, b_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
88 new RotateDecoder("rclb", ADDR_E, b_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
89 new RotateDecoder("rcrb", ADDR_E, b_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
90 new ShiftDecoder("shlb", ADDR_E, b_mode, RTLOP_SLL),
a61af66fc99e Initial load
duke
parents:
diff changeset
91 new ShiftDecoder("shrb", ADDR_E, b_mode, RTLOP_SRL),
a61af66fc99e Initial load
duke
parents:
diff changeset
92 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
93 new ShiftDecoder("sarb", ADDR_E, b_mode, RTLOP_SRA)
a61af66fc99e Initial load
duke
parents:
diff changeset
94 },
a61af66fc99e Initial load
duke
parents:
diff changeset
95 {
a61af66fc99e Initial load
duke
parents:
diff changeset
96 new RotateDecoder("rolS", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
97 new RotateDecoder("rorS", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
98 new RotateDecoder("rclS", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
99 new RotateDecoder("rcrS", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
100 new ShiftDecoder("shlS", ADDR_E, v_mode, RTLOP_SLL),
a61af66fc99e Initial load
duke
parents:
diff changeset
101 new ShiftDecoder("shrS", ADDR_E, v_mode, RTLOP_SRL),
a61af66fc99e Initial load
duke
parents:
diff changeset
102 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
103 new ShiftDecoder("sarS", ADDR_E, v_mode, RTLOP_SRA)
a61af66fc99e Initial load
duke
parents:
diff changeset
104 },
a61af66fc99e Initial load
duke
parents:
diff changeset
105 {
a61af66fc99e Initial load
duke
parents:
diff changeset
106 new RotateDecoder("rolb", ADDR_E, b_mode, ADDR_REG, CL),
a61af66fc99e Initial load
duke
parents:
diff changeset
107 new RotateDecoder("rorb", ADDR_E, b_mode, ADDR_REG, CL),
a61af66fc99e Initial load
duke
parents:
diff changeset
108 new RotateDecoder("rclb", ADDR_E, b_mode, ADDR_REG, CL),
a61af66fc99e Initial load
duke
parents:
diff changeset
109 new RotateDecoder("rcrb", ADDR_E, b_mode, ADDR_REG, CL),
a61af66fc99e Initial load
duke
parents:
diff changeset
110 new ShiftDecoder( "shlb", ADDR_E, b_mode, ADDR_REG, CL, RTLOP_SLL),
a61af66fc99e Initial load
duke
parents:
diff changeset
111 new ShiftDecoder("shrb", ADDR_E, b_mode, ADDR_REG, CL, RTLOP_SRL),
a61af66fc99e Initial load
duke
parents:
diff changeset
112 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
113 new ShiftDecoder("sarb", ADDR_E, b_mode, ADDR_REG, CL, RTLOP_SRA)
a61af66fc99e Initial load
duke
parents:
diff changeset
114 },
a61af66fc99e Initial load
duke
parents:
diff changeset
115 {
a61af66fc99e Initial load
duke
parents:
diff changeset
116 new RotateDecoder("rolS", ADDR_E, v_mode, ADDR_REG, CL),
a61af66fc99e Initial load
duke
parents:
diff changeset
117 new RotateDecoder("rorS", ADDR_E, v_mode, ADDR_REG, CL),
a61af66fc99e Initial load
duke
parents:
diff changeset
118 new RotateDecoder("rclS", ADDR_E, v_mode, ADDR_REG, CL),
a61af66fc99e Initial load
duke
parents:
diff changeset
119 new RotateDecoder("rcrS", ADDR_E, v_mode, ADDR_REG, CL),
a61af66fc99e Initial load
duke
parents:
diff changeset
120 new ShiftDecoder("shlS", ADDR_E, v_mode, ADDR_REG, CL, RTLOP_SLL),
a61af66fc99e Initial load
duke
parents:
diff changeset
121 new ShiftDecoder("shrS", ADDR_E, v_mode, ADDR_REG, CL, RTLOP_SRL),
a61af66fc99e Initial load
duke
parents:
diff changeset
122 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
123 new ShiftDecoder("sarS", ADDR_E, v_mode, ADDR_REG, CL, RTLOP_SRA)
a61af66fc99e Initial load
duke
parents:
diff changeset
124 },
a61af66fc99e Initial load
duke
parents:
diff changeset
125 {
a61af66fc99e Initial load
duke
parents:
diff changeset
126 new InstructionDecoder("testb", ADDR_E, b_mode, ADDR_I, b_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
127 null, /*new InstructionDecoder("(bad)", ADDR_E, b_mode)*/
a61af66fc99e Initial load
duke
parents:
diff changeset
128 new LogicalDecoder("notb", ADDR_E, b_mode, RTLOP_NOT),
a61af66fc99e Initial load
duke
parents:
diff changeset
129 new InstructionDecoder("negb", ADDR_E, b_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
130 new ArithmeticDecoder("mulb", ADDR_REG, AL, ADDR_E, b_mode, RTLOP_UMUL),
a61af66fc99e Initial load
duke
parents:
diff changeset
131 new ArithmeticDecoder("imulb", ADDR_REG, AL, ADDR_E, b_mode, RTLOP_SMUL),
a61af66fc99e Initial load
duke
parents:
diff changeset
132 new ArithmeticDecoder("divb", ADDR_REG, AL, ADDR_E, b_mode, RTLOP_UDIV),
a61af66fc99e Initial load
duke
parents:
diff changeset
133 new ArithmeticDecoder("idivb", ADDR_REG, AL, ADDR_E, b_mode, RTLOP_SDIV)
a61af66fc99e Initial load
duke
parents:
diff changeset
134 },
a61af66fc99e Initial load
duke
parents:
diff changeset
135 {
a61af66fc99e Initial load
duke
parents:
diff changeset
136 new InstructionDecoder("testS", ADDR_E, v_mode, ADDR_I, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
137 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
138 new LogicalDecoder("notS", ADDR_E, v_mode, RTLOP_NOT),
a61af66fc99e Initial load
duke
parents:
diff changeset
139 new InstructionDecoder("negS", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
140 new ArithmeticDecoder("mulS", ADDR_REG, EAX, ADDR_E, v_mode, RTLOP_UMUL),
a61af66fc99e Initial load
duke
parents:
diff changeset
141 new ArithmeticDecoder("imulS", ADDR_REG, EAX, ADDR_E, v_mode, RTLOP_SMUL),
a61af66fc99e Initial load
duke
parents:
diff changeset
142 new ArithmeticDecoder("divS", ADDR_REG, EAX, ADDR_E, v_mode, RTLOP_SDIV),
a61af66fc99e Initial load
duke
parents:
diff changeset
143 new ArithmeticDecoder("idivS", ADDR_REG, EAX, ADDR_E, v_mode, RTLOP_SDIV)
a61af66fc99e Initial load
duke
parents:
diff changeset
144 },
a61af66fc99e Initial load
duke
parents:
diff changeset
145 {
a61af66fc99e Initial load
duke
parents:
diff changeset
146 new ArithmeticDecoder("incb", ADDR_E, b_mode, RTLOP_ADD),
a61af66fc99e Initial load
duke
parents:
diff changeset
147 new ArithmeticDecoder("decb", ADDR_E, b_mode, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
148 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
149 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
150 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
151 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
152 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
153 null
a61af66fc99e Initial load
duke
parents:
diff changeset
154 },
a61af66fc99e Initial load
duke
parents:
diff changeset
155 {
a61af66fc99e Initial load
duke
parents:
diff changeset
156 new ArithmeticDecoder("incS", ADDR_E, v_mode, RTLOP_ADD),
a61af66fc99e Initial load
duke
parents:
diff changeset
157 new ArithmeticDecoder("decS", ADDR_E, v_mode, RTLOP_SUB),
a61af66fc99e Initial load
duke
parents:
diff changeset
158 new CallDecoder("call", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
159 new CallDecoder("lcall", ADDR_E, p_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
160 new JmpDecoder("jmp", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
161 new JmpDecoder("ljmp", ADDR_E, p_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
162 new InstructionDecoder("pushS", ADDR_E, v_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
163 null
a61af66fc99e Initial load
duke
parents:
diff changeset
164 },
a61af66fc99e Initial load
duke
parents:
diff changeset
165 {
a61af66fc99e Initial load
duke
parents:
diff changeset
166 new InstructionDecoder("sldt", ADDR_E, w_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
167 new InstructionDecoder("str", ADDR_E, w_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
168 new InstructionDecoder("lldt", ADDR_E, w_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
169 new InstructionDecoder("ltr", ADDR_E, w_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
170 new InstructionDecoder("verr", ADDR_E, w_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
171 new InstructionDecoder("verw", ADDR_E, w_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
172 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
173 null
a61af66fc99e Initial load
duke
parents:
diff changeset
174 },
a61af66fc99e Initial load
duke
parents:
diff changeset
175 {
a61af66fc99e Initial load
duke
parents:
diff changeset
176 new InstructionDecoder("sgdt", ADDR_E, w_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
177 new InstructionDecoder("sidt", ADDR_E, w_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
178 new InstructionDecoder("lgdt", ADDR_E, w_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
179 new InstructionDecoder("lidt", ADDR_E, w_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
180 new InstructionDecoder("smsw", ADDR_E, w_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
181 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
182 new InstructionDecoder("lmsw", ADDR_E, w_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
183 new InstructionDecoder("invlpg", ADDR_E, w_mode)
a61af66fc99e Initial load
duke
parents:
diff changeset
184 },
a61af66fc99e Initial load
duke
parents:
diff changeset
185 {
a61af66fc99e Initial load
duke
parents:
diff changeset
186 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
187 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
188 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
189 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
190 new InstructionDecoder("btS", ADDR_E, v_mode, ADDR_I, b_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
191 new InstructionDecoder("btsS", ADDR_E, v_mode, ADDR_I, b_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
192 new InstructionDecoder("btrS", ADDR_E, v_mode, ADDR_I, b_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
193 new InstructionDecoder("btcS", ADDR_E, v_mode, ADDR_I, b_mode)
a61af66fc99e Initial load
duke
parents:
diff changeset
194 },
a61af66fc99e Initial load
duke
parents:
diff changeset
195 /*16*/
a61af66fc99e Initial load
duke
parents:
diff changeset
196 {
a61af66fc99e Initial load
duke
parents:
diff changeset
197 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
198 new SSEInstructionDecoder("cmpxch8b", ADDR_W, q_mode),
a61af66fc99e Initial load
duke
parents:
diff changeset
199 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
200 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
201 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
202 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
203 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
204 null
a61af66fc99e Initial load
duke
parents:
diff changeset
205 },
a61af66fc99e Initial load
duke
parents:
diff changeset
206 /*17*/
a61af66fc99e Initial load
duke
parents:
diff changeset
207 {
a61af66fc99e Initial load
duke
parents:
diff changeset
208 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
209 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
210 new SSEShiftDecoder("psrlw", ADDR_P, q_mode, ADDR_I, b_mode, RTLOP_SRL),
a61af66fc99e Initial load
duke
parents:
diff changeset
211 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
212 new SSEShiftDecoder("psraw", ADDR_P, q_mode, ADDR_I, b_mode, RTLOP_SRA),
a61af66fc99e Initial load
duke
parents:
diff changeset
213 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
214 new SSEShiftDecoder("psllw", ADDR_P, q_mode, ADDR_I, b_mode, RTLOP_SLL),
a61af66fc99e Initial load
duke
parents:
diff changeset
215 null
a61af66fc99e Initial load
duke
parents:
diff changeset
216 },
a61af66fc99e Initial load
duke
parents:
diff changeset
217 /*18*/
a61af66fc99e Initial load
duke
parents:
diff changeset
218 {
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 new SSEShiftDecoder("psrld", ADDR_P, q_mode, ADDR_I, b_mode, RTLOP_SRL),
a61af66fc99e Initial load
duke
parents:
diff changeset
222 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
223 new SSEShiftDecoder("psrad", ADDR_P, q_mode, ADDR_I, b_mode, RTLOP_SRA),
a61af66fc99e Initial load
duke
parents:
diff changeset
224 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
225 new SSEShiftDecoder("pslld", ADDR_P, q_mode, ADDR_I, b_mode, RTLOP_SLL),
a61af66fc99e Initial load
duke
parents:
diff changeset
226 null
a61af66fc99e Initial load
duke
parents:
diff changeset
227 },
a61af66fc99e Initial load
duke
parents:
diff changeset
228 /*19*/
a61af66fc99e Initial load
duke
parents:
diff changeset
229 {
a61af66fc99e Initial load
duke
parents:
diff changeset
230 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
231 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
232 new SSEShiftDecoder("psrlq", ADDR_P, q_mode, ADDR_I, b_mode, RTLOP_SRL),
a61af66fc99e Initial load
duke
parents:
diff changeset
233 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
234 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
235 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
236 new SSEShiftDecoder("psllq", ADDR_P, q_mode, ADDR_I, b_mode, RTLOP_SLL),
a61af66fc99e Initial load
duke
parents:
diff changeset
237 null
a61af66fc99e Initial load
duke
parents:
diff changeset
238 },
a61af66fc99e Initial load
duke
parents:
diff changeset
239 /*20 - Grp15*/
a61af66fc99e Initial load
duke
parents:
diff changeset
240 {
a61af66fc99e Initial load
duke
parents:
diff changeset
241 new SSEInstructionDecoder("fxsave"),
a61af66fc99e Initial load
duke
parents:
diff changeset
242 new SSEInstructionDecoder("fxrstor"),
a61af66fc99e Initial load
duke
parents:
diff changeset
243 new SSEInstructionDecoder("ldmxcsr"),
a61af66fc99e Initial load
duke
parents:
diff changeset
244 new SSEInstructionDecoder("stmxcsr"),
a61af66fc99e Initial load
duke
parents:
diff changeset
245 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
246 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
247 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
248 new SSEInstructionDecoder("clflush")
a61af66fc99e Initial load
duke
parents:
diff changeset
249 },
a61af66fc99e Initial load
duke
parents:
diff changeset
250 /*21 - Grp16*/
a61af66fc99e Initial load
duke
parents:
diff changeset
251 {
a61af66fc99e Initial load
duke
parents:
diff changeset
252 new SSEInstructionDecoder("prefetchnta"),
a61af66fc99e Initial load
duke
parents:
diff changeset
253 new SSEInstructionDecoder("prefetcht0"),
a61af66fc99e Initial load
duke
parents:
diff changeset
254 new SSEInstructionDecoder("prefetcht1"),
a61af66fc99e Initial load
duke
parents:
diff changeset
255 new SSEInstructionDecoder("prefetcht2"),
a61af66fc99e Initial load
duke
parents:
diff changeset
256 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
257 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
258 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
259 null
a61af66fc99e Initial load
duke
parents:
diff changeset
260 },
a61af66fc99e Initial load
duke
parents:
diff changeset
261 /*22 - Grp12:66*/
a61af66fc99e Initial load
duke
parents:
diff changeset
262 {
a61af66fc99e Initial load
duke
parents:
diff changeset
263 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
264 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
265 new SSEShiftDecoder("psrlw", ADDR_P, dq_mode, ADDR_I, b_mode, RTLOP_SRL),
a61af66fc99e Initial load
duke
parents:
diff changeset
266 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
267 new SSEShiftDecoder("psraw", ADDR_P, dq_mode, ADDR_I, b_mode, RTLOP_SRA),
a61af66fc99e Initial load
duke
parents:
diff changeset
268 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
269 new SSEShiftDecoder("psllw", ADDR_P, dq_mode, ADDR_I, b_mode, RTLOP_SLL),
a61af66fc99e Initial load
duke
parents:
diff changeset
270 null
a61af66fc99e Initial load
duke
parents:
diff changeset
271 },
a61af66fc99e Initial load
duke
parents:
diff changeset
272 /*23 - Grp13:66*/
a61af66fc99e Initial load
duke
parents:
diff changeset
273 {
a61af66fc99e Initial load
duke
parents:
diff changeset
274 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
275 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
276 new SSEShiftDecoder("psrld", ADDR_W, dq_mode, ADDR_I, b_mode, RTLOP_SRL),
a61af66fc99e Initial load
duke
parents:
diff changeset
277 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
278 new SSEShiftDecoder("psrad", ADDR_W, dq_mode, ADDR_I, b_mode, RTLOP_SRA),
a61af66fc99e Initial load
duke
parents:
diff changeset
279 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
280 new SSEShiftDecoder("pslld", ADDR_W, dq_mode, ADDR_I, b_mode, RTLOP_SLL),
a61af66fc99e Initial load
duke
parents:
diff changeset
281 null
a61af66fc99e Initial load
duke
parents:
diff changeset
282 },
a61af66fc99e Initial load
duke
parents:
diff changeset
283 /*24 - - Grp14:66*/
a61af66fc99e Initial load
duke
parents:
diff changeset
284 {
a61af66fc99e Initial load
duke
parents:
diff changeset
285 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
286 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
287 new SSEShiftDecoder("psrlq", ADDR_W, dq_mode, ADDR_I, b_mode, RTLOP_SRL),
a61af66fc99e Initial load
duke
parents:
diff changeset
288 new SSEShiftDecoder("psrldq", ADDR_W, dq_mode, ADDR_I, b_mode, RTLOP_SRL),
a61af66fc99e Initial load
duke
parents:
diff changeset
289 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
290 null,
a61af66fc99e Initial load
duke
parents:
diff changeset
291 new SSEShiftDecoder("psllq", ADDR_W, dq_mode, ADDR_I, b_mode, RTLOP_SLL),
a61af66fc99e Initial load
duke
parents:
diff changeset
292 new SSEShiftDecoder("psllq", ADDR_W, dq_mode, ADDR_I, b_mode, RTLOP_SLL)
a61af66fc99e Initial load
duke
parents:
diff changeset
293 }
a61af66fc99e Initial load
duke
parents:
diff changeset
294 };
a61af66fc99e Initial load
duke
parents:
diff changeset
295
a61af66fc99e Initial load
duke
parents:
diff changeset
296 public GRPDecoder(String name, int number) {
a61af66fc99e Initial load
duke
parents:
diff changeset
297 super(name);
a61af66fc99e Initial load
duke
parents:
diff changeset
298 this.number = number;
a61af66fc99e Initial load
duke
parents:
diff changeset
299 }
a61af66fc99e Initial load
duke
parents:
diff changeset
300
a61af66fc99e Initial load
duke
parents:
diff changeset
301 public Instruction decode(byte[] bytesArray, int index, int instrStartIndex, int segmentOverride, int prefixes, X86InstructionFactory factory) {
a61af66fc99e Initial load
duke
parents:
diff changeset
302 this.byteIndex = index;
a61af66fc99e Initial load
duke
parents:
diff changeset
303 this.instrStartIndex = instrStartIndex;
a61af66fc99e Initial load
duke
parents:
diff changeset
304 this.prefixes = prefixes;
a61af66fc99e Initial load
duke
parents:
diff changeset
305
a61af66fc99e Initial load
duke
parents:
diff changeset
306 int ModRM = readByte(bytesArray, byteIndex);
a61af66fc99e Initial load
duke
parents:
diff changeset
307 int reg = (ModRM >> 3) & 7;
a61af66fc99e Initial load
duke
parents:
diff changeset
308
a61af66fc99e Initial load
duke
parents:
diff changeset
309 InstructionDecoder instrDecoder = grpTable[number][reg];
a61af66fc99e Initial load
duke
parents:
diff changeset
310 Instruction instr = null;
a61af66fc99e Initial load
duke
parents:
diff changeset
311 if(instrDecoder != null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
312 instr = instrDecoder.decode(bytesArray, byteIndex, instrStartIndex, segmentOverride, prefixes, factory);
a61af66fc99e Initial load
duke
parents:
diff changeset
313 byteIndex = instrDecoder.getCurrentIndex();
a61af66fc99e Initial load
duke
parents:
diff changeset
314 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
315 instr = factory.newIllegalInstruction();
a61af66fc99e Initial load
duke
parents:
diff changeset
316 }
a61af66fc99e Initial load
duke
parents:
diff changeset
317
a61af66fc99e Initial load
duke
parents:
diff changeset
318 return instr;
a61af66fc99e Initial load
duke
parents:
diff changeset
319 }
a61af66fc99e Initial load
duke
parents:
diff changeset
320 }