two_byte_opcodes.isa revision 4711
1// Copyright (c) 2007 The Hewlett-Packard Development Company
2// All rights reserved.
3//
4// Redistribution and use of this software in source and binary forms,
5// with or without modification, are permitted provided that the
6// following conditions are met:
7//
8// The software must be used only for Non-Commercial Use which means any
9// use which is NOT directed to receiving any direct monetary
10// compensation for, or commercial advantage from such use.  Illustrative
11// examples of non-commercial use are academic research, personal study,
12// teaching, education and corporate research & development.
13// Illustrative examples of commercial use are distributing products for
14// commercial advantage and providing services using the software for
15// commercial advantage.
16//
17// If you wish to use this software or functionality therein that may be
18// covered by patents for commercial use, please contact:
19//     Director of Intellectual Property Licensing
20//     Office of Strategy and Technology
21//     Hewlett-Packard Company
22//     1501 Page Mill Road
23//     Palo Alto, California  94304
24//
25// Redistributions of source code must retain the above copyright notice,
26// this list of conditions and the following disclaimer.  Redistributions
27// in binary form must reproduce the above copyright notice, this list of
28// conditions and the following disclaimer in the documentation and/or
29// other materials provided with the distribution.  Neither the name of
30// the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
31// contributors may be used to endorse or promote products derived from
32// this software without specific prior written permission.  No right of
33// sublicense is granted herewith.  Derivatives of the software and
34// output created using the software may be prepared, but only for
35// Non-Commercial Uses.  Derivatives of the software may be shared with
36// others provided: (i) the others agree to abide by the list of
37// conditions herein which includes the Non-Commercial Use restrictions;
38// and (ii) such Derivatives of the software include the above copyright
39// notice to acknowledge the contribution from this software where
40// applicable, this list of conditions and the disclaimer below.
41//
42// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
43// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
44// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
45// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
46// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
47// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
48// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
49// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
50// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
51// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
52// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
53//
54// Authors: Gabe Black
55
56////////////////////////////////////////////////////////////////////
57//
58// Decode the two byte opcodes
59//
600x2: decode OPCODE_PREFIXA {
61    0x0F: decode OPCODE_OP_TOP5 {
62        format WarnUnimpl {
63            0x00: decode OPCODE_OP_BOTTOM3 {
64                0x00: group6();
65                0x01: group7();
66                0x02: lar_Gv_Ew();
67                0x03: lsl_Gv_Ew();
68                //sandpile.org doesn't seem to know what this is... ?
69                0x04: loadall_or_reset_or_hang();
70                0x05: syscall();
71                0x06: clts();
72                //sandpile.org says (AMD) after sysret, so I might want to check
73                //if that means amd64 or AMD machines
74                0x07: loadall_or_sysret();
75            }
76            0x01: decode OPCODE_OP_BOTTOM3 {
77                0x0: holderholder();
78                0x1: holder();
79                0x2: holder();
80                0x3: holder();
81                0x4: holder();
82                0x5: holder();
83                0x6: holder();
84                0x7: holder();
85            }
86            0x02: decode OPCODE_OP_BOTTOM3 {
87                0x0: holder();
88                0x1: holder();
89                0x2: holder();
90                0x3: holder();
91                0x4: holder();
92                0x5: holder();
93                0x6: holder();
94                0x7: holder();
95            }
96            0x03: decode OPCODE_OP_BOTTOM3 {
97                0x0: holder();
98                0x1: holder();
99                0x2: holder();
100                0x3: holder();
101                0x4: holder();
102                0x5: holder();
103                0x6: holder();
104                0x7: holder();
105            }
106            0x04: decode OPCODE_OP_BOTTOM3 {
107                0x0: holder();
108                0x1: holder();
109                0x2: holder();
110                0x3: holder();
111                0x4: holder();
112                0x5: holder();
113                0x6: holder();
114                0x7: holder();
115            }
116            0x05: decode OPCODE_OP_BOTTOM3 {
117                0x0: holder();
118                0x1: holder();
119                0x2: holder();
120                0x3: holder();
121                0x4: holder();
122                0x5: holder();
123                0x6: holder();
124                0x7: holder();
125            }
126            0x06: decode OPCODE_OP_BOTTOM3 {
127                0x0: holder();
128                0x1: holder();
129                0x2: holder();
130                0x3: holder();
131                0x4: holder();
132                0x5: holder();
133                0x6: holder();
134                0x7: holder();
135            }
136            0x07: decode OPCODE_OP_BOTTOM3 {
137                0x0: holder();
138                0x1: holder();
139                0x2: holder();
140                0x3: holder();
141                0x4: holder();
142                0x5: holder();
143                0x6: holder();
144                0x7: holder();
145            }
146            0x08: decode OPCODE_OP_BOTTOM3 {
147                0x0: holder();
148                0x1: holder();
149                0x2: holder();
150                0x3: holder();
151                0x4: holder();
152                0x5: holder();
153                0x6: holder();
154                0x7: holder();
155            }
156            0x09: decode OPCODE_OP_BOTTOM3 {
157                0x0: holder();
158                0x1: holder();
159                0x2: holder();
160                0x3: holder();
161                0x4: holder();
162                0x5: holder();
163                0x6: holder();
164                0x7: holder();
165            }
166            0x0A: decode OPCODE_OP_BOTTOM3 {
167                0x0: holder();
168                0x1: holder();
169                0x2: holder();
170                0x3: holder();
171                0x4: holder();
172                0x5: holder();
173                0x6: holder();
174                0x7: holder();
175            }
176            0x0B: decode OPCODE_OP_BOTTOM3 {
177                0x0: holder();
178                0x1: holder();
179                0x2: holder();
180                0x3: holder();
181                0x4: holder();
182                0x5: holder();
183                0x6: holder();
184                0x7: holder();
185            }
186            0x0C: decode OPCODE_OP_BOTTOM3 {
187                0x0: holder();
188                0x1: holder();
189                0x2: holder();
190                0x3: holder();
191                0x4: holder();
192                0x5: holder();
193                0x6: holder();
194                0x7: holder();
195            }
196            0x0D: decode OPCODE_OP_BOTTOM3 {
197                0x0: holder();
198                0x1: holder();
199                0x2: holder();
200                0x3: holder();
201                0x4: holder();
202                0x5: holder();
203                0x6: holder();
204                0x7: holder();
205            }
206            0x0E: decode OPCODE_OP_BOTTOM3 {
207                0x0: holder();
208                0x1: holder();
209                0x2: holder();
210                0x3: holder();
211                0x4: holder();
212                0x5: holder();
213                0x6: holder();
214                0x7: holder();
215            }
216            0x0F: decode OPCODE_OP_BOTTOM3 {
217                0x0: holder();
218                0x1: holder();
219                0x2: holder();
220                0x3: holder();
221                0x4: holder();
222                0x5: holder();
223                0x6: holder();
224                0x7: holder();
225            }
226            0x10: decode OPCODE_OP_BOTTOM3 {
227                0x0: jo_Jz();
228                0x1: jno_Jz();
229                0x2: jb_Jz();
230                0x3: jnb_Jz();
231                0x4: jz_Jz();
232                0x5: Inst::JNZ(Jz);
233                0x6: jbe_Jz();
234                0x7: jnbe_Jz();
235            }
236            0x11: decode OPCODE_OP_BOTTOM3 {
237                0x0: holder();
238                0x1: holder();
239                0x2: holder();
240                0x3: holder();
241                0x4: holder();
242                0x5: holder();
243                0x6: holder();
244                0x7: holder();
245            }
246            0x12: decode OPCODE_OP_BOTTOM3 {
247                0x0: holder();
248                0x1: holder();
249                0x2: holder();
250                0x3: holder();
251                0x4: holder();
252                0x5: holder();
253                0x6: holder();
254                0x7: holder();
255            }
256            0x13: decode OPCODE_OP_BOTTOM3 {
257                0x0: holder();
258                0x1: holder();
259                0x2: holder();
260                0x3: holder();
261                0x4: holder();
262                0x5: holder();
263                0x6: holder();
264                0x7: holder();
265            }
266            0x14: decode OPCODE_OP_BOTTOM3 {
267                0x0: holder();
268                0x1: holder();
269                0x2: holder();
270                0x3: holder();
271                0x4: holder();
272                0x5: holder();
273                0x6: holder();
274                0x7: holder();
275            }
276            0x15: decode OPCODE_OP_BOTTOM3 {
277                0x0: holder();
278                0x1: holder();
279                0x2: holder();
280                0x3: holder();
281                0x4: holder();
282                0x5: holder();
283                0x6: holder();
284                0x7: holder();
285            }
286            0x16: decode OPCODE_OP_BOTTOM3 {
287                0x0: holder();
288                0x1: holder();
289                0x2: holder();
290                0x3: holder();
291                0x4: holder();
292                0x5: holder();
293                0x6: holder();
294                0x7: holder();
295            }
296            0x17: decode OPCODE_OP_BOTTOM3 {
297                0x0: holder();
298                0x1: holder();
299                0x2: holder();
300                0x3: holder();
301                0x4: holder();
302                0x5: holder();
303                0x6: holder();
304                0x7: holder();
305            }
306            0x18: decode OPCODE_OP_BOTTOM3 {
307                0x0: holder();
308                0x1: holder();
309                0x2: holder();
310                0x3: holder();
311                0x4: holder();
312                0x5: holder();
313                0x6: holder();
314                0x7: holder();
315            }
316            0x19: decode OPCODE_OP_BOTTOM3 {
317                0x0: holder();
318                0x1: holder();
319                0x2: holder();
320                0x3: holder();
321                0x4: holder();
322                0x5: holder();
323                0x6: holder();
324                0x7: holder();
325            }
326            0x1A: decode OPCODE_OP_BOTTOM3 {
327                0x0: holder();
328                0x1: holder();
329                0x2: holder();
330                0x3: holder();
331                0x4: holder();
332                0x5: holder();
333                0x6: holder();
334                0x7: holder();
335            }
336            0x1B: decode OPCODE_OP_BOTTOM3 {
337                0x0: holder();
338                0x1: holder();
339                0x2: holder();
340                0x3: holder();
341                0x4: holder();
342                0x5: holder();
343                0x6: holder();
344                0x7: holder();
345            }
346            0x1C: decode OPCODE_OP_BOTTOM3 {
347                0x0: holder();
348                0x1: holder();
349                0x2: holder();
350                0x3: holder();
351                0x4: holder();
352                0x5: holder();
353                0x6: holder();
354                0x7: holder();
355            }
356            0x1D: decode OPCODE_OP_BOTTOM3 {
357                0x0: holder();
358                0x1: holder();
359                0x2: holder();
360                0x3: holder();
361                0x4: holder();
362                0x5: holder();
363                0x6: holder();
364                0x7: holder();
365            }
366            0x1E: decode OPCODE_OP_BOTTOM3 {
367                0x0: holder();
368                0x1: holder();
369                0x2: holder();
370                0x3: holder();
371                0x4: holder();
372                0x5: holder();
373                0x6: holder();
374                0x7: holder();
375            }
376            0x1F: decode OPCODE_OP_BOTTOM3 {
377                0x0: holder();
378                0x1: holder();
379                0x2: holder();
380                0x3: holder();
381                0x4: holder();
382                0x5: holder();
383                0x6: holder();
384                0x7: holder();
385            }
386            default: FailUnimpl::twoByteOps();
387        }
388    }
389    default: M5InternalError::error(
390        {{"Unexpected first opcode byte in two byte opcode!"}});
391}
392