two_byte_opcodes.isa revision 5359
15331Sgblack@eecs.umich.edu// Copyright (c) 2008 The Regents of The University of Michigan
25331Sgblack@eecs.umich.edu// All rights reserved.
35331Sgblack@eecs.umich.edu//
45331Sgblack@eecs.umich.edu// Redistribution and use in source and binary forms, with or without
55331Sgblack@eecs.umich.edu// modification, are permitted provided that the following conditions are
65331Sgblack@eecs.umich.edu// met: redistributions of source code must retain the above copyright
75331Sgblack@eecs.umich.edu// notice, this list of conditions and the following disclaimer;
85331Sgblack@eecs.umich.edu// redistributions in binary form must reproduce the above copyright
95331Sgblack@eecs.umich.edu// notice, this list of conditions and the following disclaimer in the
105331Sgblack@eecs.umich.edu// documentation and/or other materials provided with the distribution;
115331Sgblack@eecs.umich.edu// neither the name of the copyright holders nor the names of its
125331Sgblack@eecs.umich.edu// contributors may be used to endorse or promote products derived from
135331Sgblack@eecs.umich.edu// this software without specific prior written permission.
145331Sgblack@eecs.umich.edu//
155331Sgblack@eecs.umich.edu// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
165331Sgblack@eecs.umich.edu// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
175331Sgblack@eecs.umich.edu// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
185331Sgblack@eecs.umich.edu// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
195331Sgblack@eecs.umich.edu// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
205331Sgblack@eecs.umich.edu// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
215331Sgblack@eecs.umich.edu// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
225331Sgblack@eecs.umich.edu// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
235331Sgblack@eecs.umich.edu// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
245331Sgblack@eecs.umich.edu// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
255331Sgblack@eecs.umich.edu// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
265331Sgblack@eecs.umich.edu//
275331Sgblack@eecs.umich.edu// Authors: Gabe Black
285331Sgblack@eecs.umich.edu
295331Sgblack@eecs.umich.edu// Copyright (c) 2007-2008 The Hewlett-Packard Development Company
304276Sgblack@eecs.umich.edu// All rights reserved.
314276Sgblack@eecs.umich.edu//
324276Sgblack@eecs.umich.edu// Redistribution and use of this software in source and binary forms,
334276Sgblack@eecs.umich.edu// with or without modification, are permitted provided that the
344276Sgblack@eecs.umich.edu// following conditions are met:
354276Sgblack@eecs.umich.edu//
364276Sgblack@eecs.umich.edu// The software must be used only for Non-Commercial Use which means any
374276Sgblack@eecs.umich.edu// use which is NOT directed to receiving any direct monetary
384276Sgblack@eecs.umich.edu// compensation for, or commercial advantage from such use.  Illustrative
394276Sgblack@eecs.umich.edu// examples of non-commercial use are academic research, personal study,
404276Sgblack@eecs.umich.edu// teaching, education and corporate research & development.
414276Sgblack@eecs.umich.edu// Illustrative examples of commercial use are distributing products for
424276Sgblack@eecs.umich.edu// commercial advantage and providing services using the software for
434276Sgblack@eecs.umich.edu// commercial advantage.
444276Sgblack@eecs.umich.edu//
454276Sgblack@eecs.umich.edu// If you wish to use this software or functionality therein that may be
464276Sgblack@eecs.umich.edu// covered by patents for commercial use, please contact:
474276Sgblack@eecs.umich.edu//     Director of Intellectual Property Licensing
484276Sgblack@eecs.umich.edu//     Office of Strategy and Technology
494276Sgblack@eecs.umich.edu//     Hewlett-Packard Company
504276Sgblack@eecs.umich.edu//     1501 Page Mill Road
514276Sgblack@eecs.umich.edu//     Palo Alto, California  94304
524276Sgblack@eecs.umich.edu//
534276Sgblack@eecs.umich.edu// Redistributions of source code must retain the above copyright notice,
544276Sgblack@eecs.umich.edu// this list of conditions and the following disclaimer.  Redistributions
554276Sgblack@eecs.umich.edu// in binary form must reproduce the above copyright notice, this list of
564276Sgblack@eecs.umich.edu// conditions and the following disclaimer in the documentation and/or
574276Sgblack@eecs.umich.edu// other materials provided with the distribution.  Neither the name of
584276Sgblack@eecs.umich.edu// the COPYRIGHT HOLDER(s), HEWLETT-PACKARD COMPANY, nor the names of its
594276Sgblack@eecs.umich.edu// contributors may be used to endorse or promote products derived from
604276Sgblack@eecs.umich.edu// this software without specific prior written permission.  No right of
614276Sgblack@eecs.umich.edu// sublicense is granted herewith.  Derivatives of the software and
624276Sgblack@eecs.umich.edu// output created using the software may be prepared, but only for
634276Sgblack@eecs.umich.edu// Non-Commercial Uses.  Derivatives of the software may be shared with
644276Sgblack@eecs.umich.edu// others provided: (i) the others agree to abide by the list of
654276Sgblack@eecs.umich.edu// conditions herein which includes the Non-Commercial Use restrictions;
664276Sgblack@eecs.umich.edu// and (ii) such Derivatives of the software include the above copyright
674276Sgblack@eecs.umich.edu// notice to acknowledge the contribution from this software where
684276Sgblack@eecs.umich.edu// applicable, this list of conditions and the disclaimer below.
694276Sgblack@eecs.umich.edu//
704276Sgblack@eecs.umich.edu// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
714276Sgblack@eecs.umich.edu// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
724276Sgblack@eecs.umich.edu// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
734276Sgblack@eecs.umich.edu// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
744276Sgblack@eecs.umich.edu// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
754276Sgblack@eecs.umich.edu// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
764276Sgblack@eecs.umich.edu// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
774276Sgblack@eecs.umich.edu// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
784276Sgblack@eecs.umich.edu// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
794276Sgblack@eecs.umich.edu// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
804276Sgblack@eecs.umich.edu// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
814276Sgblack@eecs.umich.edu//
824276Sgblack@eecs.umich.edu// Authors: Gabe Black
834276Sgblack@eecs.umich.edu
844276Sgblack@eecs.umich.edu////////////////////////////////////////////////////////////////////
854276Sgblack@eecs.umich.edu//
864276Sgblack@eecs.umich.edu// Decode the two byte opcodes
874276Sgblack@eecs.umich.edu//
884276Sgblack@eecs.umich.edu0x2: decode OPCODE_PREFIXA {
894711Sgblack@eecs.umich.edu    0x0F: decode OPCODE_OP_TOP5 {
904276Sgblack@eecs.umich.edu        format WarnUnimpl {
914276Sgblack@eecs.umich.edu            0x00: decode OPCODE_OP_BOTTOM3 {
925238Sgblack@eecs.umich.edu                //0x00: group6();
935238Sgblack@eecs.umich.edu                0x00: decode MODRM_REG {
945238Sgblack@eecs.umich.edu                    0x0: sldt_Mw_or_Rv();
955238Sgblack@eecs.umich.edu                    0x1: str_Mw_or_Rv();
965238Sgblack@eecs.umich.edu                    0x2: lldt_Mw_or_Rv();
975238Sgblack@eecs.umich.edu                    0x3: ltr_Mw_or_Rv();
985238Sgblack@eecs.umich.edu                    0x4: verr_Mw_or_Rv();
995238Sgblack@eecs.umich.edu                    0x5: verw_Mw_or_Rv();
1005238Sgblack@eecs.umich.edu                    //0x6: jmpe_Ev(); // IA-64
1015238Sgblack@eecs.umich.edu                    default: Inst::UD2();
1025238Sgblack@eecs.umich.edu                }
1035238Sgblack@eecs.umich.edu                //0x01: group7(); // Ugly, ugly, ugly...
1045238Sgblack@eecs.umich.edu                0x01: decode MODRM_MOD {
1055238Sgblack@eecs.umich.edu                    0x3: decode MODRM_REG {
1065238Sgblack@eecs.umich.edu                        0x0: decode MODRM_RM {
1075238Sgblack@eecs.umich.edu                            0x1: vmcall();
1085238Sgblack@eecs.umich.edu                            0x2: vmlaunch();
1095238Sgblack@eecs.umich.edu                            0x3: vmresume();
1105238Sgblack@eecs.umich.edu                            0x4: vmxoff();
1115238Sgblack@eecs.umich.edu                            default: Inst::UD2();
1125238Sgblack@eecs.umich.edu                        }
1135238Sgblack@eecs.umich.edu                        0x1: decode MODRM_RM {
1145238Sgblack@eecs.umich.edu                            0x0: monitor();
1155238Sgblack@eecs.umich.edu                            0x1: mwait();
1165238Sgblack@eecs.umich.edu                            default: Inst::UD2();
1175238Sgblack@eecs.umich.edu                        }
1185238Sgblack@eecs.umich.edu                        0x3: decode MODRM_RM {
1195238Sgblack@eecs.umich.edu                            0x0: vmrun();
1205238Sgblack@eecs.umich.edu                            0x1: vmmcall();
1215238Sgblack@eecs.umich.edu                            0x2: vmload();
1225238Sgblack@eecs.umich.edu                            0x3: vmsave();
1235238Sgblack@eecs.umich.edu                            0x4: stgi();
1245238Sgblack@eecs.umich.edu                            0x5: clgi();
1255238Sgblack@eecs.umich.edu                            0x6: skinit();
1265238Sgblack@eecs.umich.edu                            0x7: invlpga();
1275238Sgblack@eecs.umich.edu                        }
1285238Sgblack@eecs.umich.edu                        0x4: smsw_Rv();
1295238Sgblack@eecs.umich.edu                        0x6: lmsw_Rv();
1305238Sgblack@eecs.umich.edu                        0x7: decode MODRM_RM {
1315238Sgblack@eecs.umich.edu                            0x0: swapgs();
1325238Sgblack@eecs.umich.edu                            0x1: rdtscp();
1335238Sgblack@eecs.umich.edu                            default: Inst::UD2();
1345238Sgblack@eecs.umich.edu                        }
1355238Sgblack@eecs.umich.edu                        default: Inst::UD2();
1365238Sgblack@eecs.umich.edu                    }
1375238Sgblack@eecs.umich.edu                    default: decode MODRM_REG {
1385238Sgblack@eecs.umich.edu                        0x0: sgdt_Ms();
1395238Sgblack@eecs.umich.edu                        0x1: sidt_Ms();
1405291Sgblack@eecs.umich.edu                        0x2: decode MODE_SUBMODE {
1415291Sgblack@eecs.umich.edu                            0x0: Inst::LGDT(M);
1425291Sgblack@eecs.umich.edu                            default: decode OPSIZE {
1435291Sgblack@eecs.umich.edu                                // 16 bit operand sizes are special, but only
1445291Sgblack@eecs.umich.edu                                // in legacy and compatability modes.
1455291Sgblack@eecs.umich.edu                                0x2: Inst::LGDT_16(M);
1465291Sgblack@eecs.umich.edu                                default: Inst::LGDT(M);
1475291Sgblack@eecs.umich.edu                            }
1485291Sgblack@eecs.umich.edu                        }
1495292Sgblack@eecs.umich.edu                        0x3: decode MODE_SUBMODE {
1505292Sgblack@eecs.umich.edu                            0x0: Inst::LIDT(M);
1515292Sgblack@eecs.umich.edu                            default: decode OPSIZE {
1525292Sgblack@eecs.umich.edu                                // 16 bit operand sizes are special, but only
1535292Sgblack@eecs.umich.edu                                // in legacy and compatability modes.
1545292Sgblack@eecs.umich.edu                                0x2: Inst::LIDT_16(M);
1555292Sgblack@eecs.umich.edu                                default: Inst::LIDT(M);
1565292Sgblack@eecs.umich.edu                            }
1575292Sgblack@eecs.umich.edu                        }
1585238Sgblack@eecs.umich.edu                        0x4: smsw_Mw();
1595238Sgblack@eecs.umich.edu                        0x6: lmsw_Mw();
1605359Sgblack@eecs.umich.edu                        0x7: Inst::INVLPG(M);
1615238Sgblack@eecs.umich.edu                        default: Inst::UD2();
1625238Sgblack@eecs.umich.edu                    }
1635238Sgblack@eecs.umich.edu                }
1644276Sgblack@eecs.umich.edu                0x02: lar_Gv_Ew();
1654276Sgblack@eecs.umich.edu                0x03: lsl_Gv_Ew();
1664276Sgblack@eecs.umich.edu                //sandpile.org doesn't seem to know what this is... ?
1674276Sgblack@eecs.umich.edu                0x04: loadall_or_reset_or_hang();
1684712Sgblack@eecs.umich.edu#if FULL_SYSTEM
1694711Sgblack@eecs.umich.edu                0x05: syscall();
1704712Sgblack@eecs.umich.edu#else
1714828Sgblack@eecs.umich.edu                0x05: SyscallInst::syscall('xc->syscall(rax)', IsSyscall);
1724712Sgblack@eecs.umich.edu#endif
1734276Sgblack@eecs.umich.edu                0x06: clts();
1744276Sgblack@eecs.umich.edu                //sandpile.org says (AMD) after sysret, so I might want to check
1754276Sgblack@eecs.umich.edu                //if that means amd64 or AMD machines
1764276Sgblack@eecs.umich.edu                0x07: loadall_or_sysret();
1774276Sgblack@eecs.umich.edu            }
1784276Sgblack@eecs.umich.edu            0x01: decode OPCODE_OP_BOTTOM3 {
1794712Sgblack@eecs.umich.edu                0x0: invd();
1804712Sgblack@eecs.umich.edu                0x1: wbinvd();
1814730Sgblack@eecs.umich.edu                0x2: Inst::UD2();
1824760Sgblack@eecs.umich.edu                0x3: Inst::UD2();
1834730Sgblack@eecs.umich.edu                0x4: Inst::UD2();
1844712Sgblack@eecs.umich.edu                0x5: threednow();
1854712Sgblack@eecs.umich.edu                0x6: threednow();
1864712Sgblack@eecs.umich.edu                0x7: threednow();
1874276Sgblack@eecs.umich.edu            }
1884760Sgblack@eecs.umich.edu            0x02: decode LEGACY_DECODEVAL {
1894760Sgblack@eecs.umich.edu                // no prefix
1904760Sgblack@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
1915020Sgblack@eecs.umich.edu                    0x0: movups_Vo_Wo();
1925020Sgblack@eecs.umich.edu                    0x1: movups_Wo_Vo();
1935020Sgblack@eecs.umich.edu                    0x2: decode MODRM_MOD {
1945020Sgblack@eecs.umich.edu                        0x3: movhlps_Vq_VRq();
1955020Sgblack@eecs.umich.edu                        default: movlps_Vq_Mq();
1965020Sgblack@eecs.umich.edu                    }
1975020Sgblack@eecs.umich.edu                    0x3: movlps_Mq_Vq();
1985020Sgblack@eecs.umich.edu                    0x4: unpcklps();
1995020Sgblack@eecs.umich.edu                    0x5: unpckhps();
2005020Sgblack@eecs.umich.edu                    0x6: decode MODRM_MOD {
2015020Sgblack@eecs.umich.edu                        0x3: movlhps_Vq_VRq();
2025020Sgblack@eecs.umich.edu                        default: movhps_Vq_Mq();
2035020Sgblack@eecs.umich.edu                    }
2045020Sgblack@eecs.umich.edu                    0x7: movhps_Mq_Vq();
2054760Sgblack@eecs.umich.edu                }
2064760Sgblack@eecs.umich.edu                // repe (0xF3)
2074760Sgblack@eecs.umich.edu                0x4: decode OPCODE_OP_BOTTOM3 {
2085020Sgblack@eecs.umich.edu                    0x0: movss_Vd_Wd();
2095020Sgblack@eecs.umich.edu                    0x1: movss_Wd_Vd();
2105020Sgblack@eecs.umich.edu                    0x2: movsldup_Vo_Wo();
2115020Sgblack@eecs.umich.edu                    0x6: movshdup_Vo_Wo();
2125020Sgblack@eecs.umich.edu                    default: Inst::UD2();
2134760Sgblack@eecs.umich.edu                }
2144760Sgblack@eecs.umich.edu                // operand size (0x66)
2154760Sgblack@eecs.umich.edu                0x1: decode OPCODE_OP_BOTTOM3 {
2165020Sgblack@eecs.umich.edu                    0x0: movupd_Vo_Wo();
2175020Sgblack@eecs.umich.edu                    0x1: movupd_Wo_Vo();
2185029Sgblack@eecs.umich.edu                    0x2: Inst::MOVLPD(Vq,Mq);
2195029Sgblack@eecs.umich.edu                    0x3: Inst::MOVLPD(Mq,Vq);
2205020Sgblack@eecs.umich.edu                    0x4: unpcklpd_Vo_Wq();
2215020Sgblack@eecs.umich.edu                    0x5: unpckhpd_Vo_Wo();
2225020Sgblack@eecs.umich.edu                    0x6: movhpd_Vq_Mq();
2235020Sgblack@eecs.umich.edu                    0x7: movhpd_Mq_Vq();
2244760Sgblack@eecs.umich.edu                }
2254760Sgblack@eecs.umich.edu                // repne (0xF2)
2264760Sgblack@eecs.umich.edu                0x8: decode OPCODE_OP_BOTTOM3 {
2275030Sgblack@eecs.umich.edu                    0x0: Inst::MOVSD(Vq,Wq);
2285030Sgblack@eecs.umich.edu                    0x1: Inst::MOVSD(Wq,Vq);
2295020Sgblack@eecs.umich.edu                    0x2: movddup_Vo_Wq();
2305020Sgblack@eecs.umich.edu                    default: Inst::UD2();
2314760Sgblack@eecs.umich.edu                }
2324760Sgblack@eecs.umich.edu                default: Inst::UD2();
2334276Sgblack@eecs.umich.edu            }
2344276Sgblack@eecs.umich.edu            0x03: decode OPCODE_OP_BOTTOM3 {
2355331Sgblack@eecs.umich.edu                //group17();
2365331Sgblack@eecs.umich.edu                0x0: decode MODRM_REG {
2375331Sgblack@eecs.umich.edu                    0x0: prefetch_nta();
2385331Sgblack@eecs.umich.edu                    0x1: prefetch_t0();
2395331Sgblack@eecs.umich.edu                    0x2: prefetch_t1();
2405331Sgblack@eecs.umich.edu                    0x3: prefetch_t2();
2415331Sgblack@eecs.umich.edu                    default: Inst::HINT_NOP();
2425331Sgblack@eecs.umich.edu                }
2435331Sgblack@eecs.umich.edu                0x1: Inst::HINT_NOP();
2445331Sgblack@eecs.umich.edu                0x2: Inst::HINT_NOP();
2455331Sgblack@eecs.umich.edu                0x3: Inst::HINT_NOP();
2465331Sgblack@eecs.umich.edu                0x4: Inst::HINT_NOP();
2475331Sgblack@eecs.umich.edu                0x5: Inst::HINT_NOP();
2485331Sgblack@eecs.umich.edu                0x6: Inst::HINT_NOP();
2495331Sgblack@eecs.umich.edu                0x7: Inst::HINT_NOP();
2504276Sgblack@eecs.umich.edu            }
2515020Sgblack@eecs.umich.edu            0x04: decode LEGACY_DECODEVAL {
2525020Sgblack@eecs.umich.edu                // no prefix
2535020Sgblack@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
2545296Sgblack@eecs.umich.edu                    0x0: Inst::MOV(Rd,Cd);
2555020Sgblack@eecs.umich.edu                    0x1: mov_Rd_Dd();
2565241Sgblack@eecs.umich.edu                    0x2: Inst::MOV(Cd,Rd);
2575020Sgblack@eecs.umich.edu                    0x3: mov_Dd_Rd();
2585020Sgblack@eecs.umich.edu                    0x4: mov_Rd_Td();
2595020Sgblack@eecs.umich.edu                    0x6: mov_Td_Rd();
2605020Sgblack@eecs.umich.edu                    default: Inst::UD2();
2615020Sgblack@eecs.umich.edu                }
2625020Sgblack@eecs.umich.edu                // lock prefix (0xF0)
2635020Sgblack@eecs.umich.edu                0x2: decode OPCODE_OP_BOTTOM3 {
2645020Sgblack@eecs.umich.edu                    0x0: mov_Rd_CR8D();
2655020Sgblack@eecs.umich.edu                    0x2: mov_CR8D_Rd();
2665020Sgblack@eecs.umich.edu                }
2675020Sgblack@eecs.umich.edu                default: Inst::UD2();
2684276Sgblack@eecs.umich.edu            }
2695020Sgblack@eecs.umich.edu            0x05: decode LEGACY_DECODEVAL {
2705020Sgblack@eecs.umich.edu                // no prefix
2715020Sgblack@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
2725031Sgblack@eecs.umich.edu                    //These moves should really use size o (octword), but
2735031Sgblack@eecs.umich.edu                    //because they are split in two, they use q (quadword).
2745031Sgblack@eecs.umich.edu                    0x0: Inst::MOVAPS(Vq,Wq);
2755031Sgblack@eecs.umich.edu                    0x1: Inst::MOVAPS(Wq,Vq);
2765020Sgblack@eecs.umich.edu                    0x2: decode MODRM_MOD {
2775020Sgblack@eecs.umich.edu                        0x3: cvtpi2pS_Vq_Pq();
2785020Sgblack@eecs.umich.edu                        default: cvtpi2ps_Vq_Mq();
2795020Sgblack@eecs.umich.edu                    }
2805020Sgblack@eecs.umich.edu                    0x3: movntps_Mo_Vo();
2815020Sgblack@eecs.umich.edu                    0x4: cvttps2pi_Pq_Wq();
2825020Sgblack@eecs.umich.edu                    0x5: cvtpS2pi_Pq_Wq();
2835020Sgblack@eecs.umich.edu                    0x6: ucomiss_Vd_Wd();
2845020Sgblack@eecs.umich.edu                    0x7: comiss_Vd_Wd();
2855020Sgblack@eecs.umich.edu                }
2865020Sgblack@eecs.umich.edu                // repe (0xF3)
2875020Sgblack@eecs.umich.edu                0x4: decode OPCODE_OP_BOTTOM3 {
2885020Sgblack@eecs.umich.edu                    0x2: cvtsi2ss_Vd_Ed();
2895020Sgblack@eecs.umich.edu                    0x4: cvttss2si_Gd_Wd();
2905020Sgblack@eecs.umich.edu                    0x5: cvtss2si_Gd_Wd();
2915020Sgblack@eecs.umich.edu                    default: Inst::UD2();
2925020Sgblack@eecs.umich.edu                }
2935020Sgblack@eecs.umich.edu                // operand size (0x66)
2945020Sgblack@eecs.umich.edu                0x1: decode OPCODE_OP_BOTTOM3 {
2955020Sgblack@eecs.umich.edu                    0x0: movapd_Vo_Wo();
2965020Sgblack@eecs.umich.edu                    0x1: movapd_Wo_Vo();
2975020Sgblack@eecs.umich.edu                    0x2: decode MODRM_MOD {
2985020Sgblack@eecs.umich.edu                        0x3: cvtpi2pd_Vo_Pq();
2995020Sgblack@eecs.umich.edu                        default: cvtpi2pd_Vo_Mq();
3005020Sgblack@eecs.umich.edu                    }
3015020Sgblack@eecs.umich.edu                    0x3: movntpd_Mo_Vo();
3025020Sgblack@eecs.umich.edu                    0x4: cvttpd2pi_Pq_Wo();
3035020Sgblack@eecs.umich.edu                    0x5: cvtpd2pi_Pq_Wo();
3045058Sgblack@eecs.umich.edu                    0x6: Inst::UCOMISD(Vq,Wq);
3055020Sgblack@eecs.umich.edu                    0x7: comisd_Vq_Wq();
3065020Sgblack@eecs.umich.edu                }
3075020Sgblack@eecs.umich.edu                // repne (0xF2)
3085020Sgblack@eecs.umich.edu                0x8: decode OPCODE_OP_BOTTOM3 {
3095046Sgblack@eecs.umich.edu                    // The size of the V operand should be q, not dp
3105046Sgblack@eecs.umich.edu                    0x2: Inst::CVTSI2SD(Vdp,Edp);
3115046Sgblack@eecs.umich.edu                    // The size of the W operand should be q, not dp
3125046Sgblack@eecs.umich.edu                    0x4: Inst::CVTTSD2SI(Gdp,Wdp);
3135020Sgblack@eecs.umich.edu                    0x5: cvtsd2si_Gd_Wq();
3145020Sgblack@eecs.umich.edu                    default: Inst::UD2();
3155020Sgblack@eecs.umich.edu                }
3165020Sgblack@eecs.umich.edu                default: Inst::UD2();
3174276Sgblack@eecs.umich.edu            }
3184276Sgblack@eecs.umich.edu            0x06: decode OPCODE_OP_BOTTOM3 {
3195149Sgblack@eecs.umich.edu                0x0: Inst::WRMSR();
3204712Sgblack@eecs.umich.edu                0x1: rdtsc();
3215149Sgblack@eecs.umich.edu                0x2: Inst::RDMSR();
3224712Sgblack@eecs.umich.edu                0x3: rdpmc();
3234712Sgblack@eecs.umich.edu                0x4: sysenter();
3244712Sgblack@eecs.umich.edu                0x5: sysexit();
3254730Sgblack@eecs.umich.edu                0x6: Inst::UD2();
3264712Sgblack@eecs.umich.edu                0x7: getsec();
3274276Sgblack@eecs.umich.edu            }
3284276Sgblack@eecs.umich.edu            0x07: decode OPCODE_OP_BOTTOM3 {
3294712Sgblack@eecs.umich.edu                0x0: three_byte_opcode();
3304712Sgblack@eecs.umich.edu                0x1: three_byte_opcode();
3314712Sgblack@eecs.umich.edu                0x2: three_byte_opcode();
3324712Sgblack@eecs.umich.edu                0x3: three_byte_opcode();
3334712Sgblack@eecs.umich.edu                0x4: three_byte_opcode();
3344712Sgblack@eecs.umich.edu                0x5: three_byte_opcode();
3354712Sgblack@eecs.umich.edu                0x6: three_byte_opcode();
3364712Sgblack@eecs.umich.edu                0x7: three_byte_opcode();
3374276Sgblack@eecs.umich.edu            }
3384760Sgblack@eecs.umich.edu            format Inst {
3394760Sgblack@eecs.umich.edu                0x08: decode OPCODE_OP_BOTTOM3 {
3404760Sgblack@eecs.umich.edu                    0x0: CMOVO(Gv,Ev);
3414760Sgblack@eecs.umich.edu                    0x1: CMOVNO(Gv,Ev);
3424760Sgblack@eecs.umich.edu                    0x2: CMOVB(Gv,Ev);
3434760Sgblack@eecs.umich.edu                    0x3: CMOVNB(Gv,Ev);
3444760Sgblack@eecs.umich.edu                    0x4: CMOVZ(Gv,Ev);
3454760Sgblack@eecs.umich.edu                    0x5: CMOVNZ(Gv,Ev);
3464760Sgblack@eecs.umich.edu                    0x6: CMOVBE(Gv,Ev);
3474760Sgblack@eecs.umich.edu                    0x7: CMOVNBE(Gv,Ev);
3484760Sgblack@eecs.umich.edu                }
3494760Sgblack@eecs.umich.edu                0x09: decode OPCODE_OP_BOTTOM3 {
3504760Sgblack@eecs.umich.edu                    0x0: CMOVS(Gv,Ev);
3514760Sgblack@eecs.umich.edu                    0x1: CMOVNS(Gv,Ev);
3524760Sgblack@eecs.umich.edu                    0x2: CMOVP(Gv,Ev);
3534760Sgblack@eecs.umich.edu                    0x3: CMOVNP(Gv,Ev);
3544760Sgblack@eecs.umich.edu                    0x4: CMOVL(Gv,Ev);
3554760Sgblack@eecs.umich.edu                    0x5: CMOVNL(Gv,Ev);
3564760Sgblack@eecs.umich.edu                    0x6: CMOVLE(Gv,Ev);
3574760Sgblack@eecs.umich.edu                    0x7: CMOVNLE(Gv,Ev);
3584760Sgblack@eecs.umich.edu                }
3594276Sgblack@eecs.umich.edu            }
3605020Sgblack@eecs.umich.edu            0x0A: decode LEGACY_DECODEVAL {
3615020Sgblack@eecs.umich.edu                // no prefix
3625020Sgblack@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
3635020Sgblack@eecs.umich.edu                    0x0: movmskps_Gd_VRo();
3645020Sgblack@eecs.umich.edu                    0x1: sqrtps_Vo_Wo();
3655020Sgblack@eecs.umich.edu                    0x2: rqsrtps_Vo_Wo();
3665020Sgblack@eecs.umich.edu                    0x3: rcpps_Vo_Wo();
3675020Sgblack@eecs.umich.edu                    0x4: andps_Vo_Wo();
3685020Sgblack@eecs.umich.edu                    0x5: andnps_Vo_Wo();
3695020Sgblack@eecs.umich.edu                    0x6: orps_Vo_Wo();
3705020Sgblack@eecs.umich.edu                    0x7: xorps_Vo_Wo();
3715020Sgblack@eecs.umich.edu                }
3725020Sgblack@eecs.umich.edu                // repe (0xF3)
3735020Sgblack@eecs.umich.edu                0x4: decode OPCODE_OP_BOTTOM3 {
3745020Sgblack@eecs.umich.edu                    0x1: sqrtss_Vd_Wd();
3755020Sgblack@eecs.umich.edu                    0x2: rsqrtss_Vd_Wd();
3765020Sgblack@eecs.umich.edu                    0x3: rcpss_Vd_Wd();
3775020Sgblack@eecs.umich.edu                    default: Inst::UD2();
3785020Sgblack@eecs.umich.edu                }
3795020Sgblack@eecs.umich.edu                // operand size (0x66)
3805020Sgblack@eecs.umich.edu                0x1: decode OPCODE_OP_BOTTOM3 {
3815020Sgblack@eecs.umich.edu                    0x0: movmskpd_Gd_VRo();
3825020Sgblack@eecs.umich.edu                    0x1: sqrtpd_Vo_Wo();
3835020Sgblack@eecs.umich.edu                    0x4: andpd_Vo_Wo();
3845020Sgblack@eecs.umich.edu                    0x5: andnpd_Vo_Wo();
3855020Sgblack@eecs.umich.edu                    0x6: orpd_Vo_Wo();
3865052Sgblack@eecs.umich.edu                    //This really should be type o, but it works on q sized
3875052Sgblack@eecs.umich.edu                    //chunks at a time.
3885052Sgblack@eecs.umich.edu                    0x7: Inst::XORPD(Vq,Wq);
3895020Sgblack@eecs.umich.edu                    default: Inst::UD2();
3905020Sgblack@eecs.umich.edu                }
3915059Sgblack@eecs.umich.edu                format Inst {
3925059Sgblack@eecs.umich.edu                    // repne (0xF2)
3935059Sgblack@eecs.umich.edu                    0x8: decode OPCODE_OP_BOTTOM3 {
3945059Sgblack@eecs.umich.edu                        0x1: SQRTSD(Vq,Wq);
3955059Sgblack@eecs.umich.edu                        default: UD2();
3965059Sgblack@eecs.umich.edu                    }
3975059Sgblack@eecs.umich.edu                    default: UD2();
3985020Sgblack@eecs.umich.edu                }
3994276Sgblack@eecs.umich.edu            }
4005020Sgblack@eecs.umich.edu            0x0B: decode LEGACY_DECODEVAL {
4015020Sgblack@eecs.umich.edu                // no prefix
4025020Sgblack@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
4035020Sgblack@eecs.umich.edu                    0x0: addps_Vo_Wo();
4045020Sgblack@eecs.umich.edu                    0x1: mulps_Vo_Wo();
4055020Sgblack@eecs.umich.edu                    0x2: cvtps2pd_Vo_Wq();
4065020Sgblack@eecs.umich.edu                    0x3: cvtdq2ps_Vo_Wo();
4075020Sgblack@eecs.umich.edu                    0x4: subps_Vo_Wo();
4085020Sgblack@eecs.umich.edu                    0x5: minps_Vo_Wo();
4095020Sgblack@eecs.umich.edu                    0x6: divps_Vo_Wo();
4105020Sgblack@eecs.umich.edu                    0x7: maxps_Vo_Wo();
4115020Sgblack@eecs.umich.edu                }
4125020Sgblack@eecs.umich.edu                // repe (0xF3)
4135020Sgblack@eecs.umich.edu                0x4: decode OPCODE_OP_BOTTOM3 {
4145020Sgblack@eecs.umich.edu                    0x0: addss_Vd_Wd();
4155020Sgblack@eecs.umich.edu                    0x1: mulss_Vd_Wd();
4165020Sgblack@eecs.umich.edu                    0x2: cvtss2sd_Vq_Wd();
4175020Sgblack@eecs.umich.edu                    0x3: cvttps2dq_Vo_Wo();
4185020Sgblack@eecs.umich.edu                    0x4: subss_Vd_Wd();
4195020Sgblack@eecs.umich.edu                    0x5: minss_Vd_Wd();
4205020Sgblack@eecs.umich.edu                    0x6: divss_Vd_Wd();
4215020Sgblack@eecs.umich.edu                    0x7: maxss_Vd_Wd();
4225020Sgblack@eecs.umich.edu                }
4235020Sgblack@eecs.umich.edu                // operand size (0x66)
4245020Sgblack@eecs.umich.edu                0x1: decode OPCODE_OP_BOTTOM3 {
4255020Sgblack@eecs.umich.edu                    0x0: addpd_Vo_Wo();
4265020Sgblack@eecs.umich.edu                    0x1: mulpd_Vo_Wo();
4275020Sgblack@eecs.umich.edu                    0x2: cvtpd2ps_Vo_Wo();
4285020Sgblack@eecs.umich.edu                    0x3: cvtps2dq_Vo_Wo();
4295020Sgblack@eecs.umich.edu                    0x4: subpd_Vo_Wo();
4305020Sgblack@eecs.umich.edu                    0x5: minpd_Vo_Wo();
4315020Sgblack@eecs.umich.edu                    0x6: divpd_Vo_Wo();
4325020Sgblack@eecs.umich.edu                    0x7: maxpd_Vo_Wo();
4335020Sgblack@eecs.umich.edu                }
4345020Sgblack@eecs.umich.edu                // repne (0xF2)
4355020Sgblack@eecs.umich.edu                0x8: decode OPCODE_OP_BOTTOM3 {
4365047Sgblack@eecs.umich.edu                    0x0: Inst::ADDSD(Vq,Wq);
4375047Sgblack@eecs.umich.edu                    0x1: Inst::MULSD(Vq,Wq);
4385020Sgblack@eecs.umich.edu                    0x2: cvtsd2ss_Vd_Wq();
4395047Sgblack@eecs.umich.edu                    0x4: Inst::SUBSD(Vq,Wq);
4405020Sgblack@eecs.umich.edu                    0x5: minsd_Vq_Wq();
4415047Sgblack@eecs.umich.edu                    0x6: Inst::DIVSD(Vq,Wq);
4425020Sgblack@eecs.umich.edu                    0x7: maxsd_Vq_Wq();
4435020Sgblack@eecs.umich.edu                    default: Inst::UD2();
4445020Sgblack@eecs.umich.edu                }
4455020Sgblack@eecs.umich.edu                default: Inst::UD2();
4464276Sgblack@eecs.umich.edu            }
4475020Sgblack@eecs.umich.edu            0x0C: decode LEGACY_DECODEVAL {
4485020Sgblack@eecs.umich.edu                // no prefix
4495020Sgblack@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
4505020Sgblack@eecs.umich.edu                    0x0: punpcklbw_Pq_Qd();
4515020Sgblack@eecs.umich.edu                    0x1: punpcklwd_Pq_Qd();
4525020Sgblack@eecs.umich.edu                    0x2: punpckldq_Pq_Qd();
4535020Sgblack@eecs.umich.edu                    0x3: packsswb_Pq_Qq();
4545020Sgblack@eecs.umich.edu                    0x4: pcmpgtb_Pq_Qq();
4555020Sgblack@eecs.umich.edu                    0x5: pcmpgtw_Pq_Qq();
4565020Sgblack@eecs.umich.edu                    0x6: pcmpgtd_Pq_Qq();
4575020Sgblack@eecs.umich.edu                    0x7: packuswb_Pq_Qq();
4585020Sgblack@eecs.umich.edu                }
4595020Sgblack@eecs.umich.edu                // operand size (0x66)
4605020Sgblack@eecs.umich.edu                0x1: decode OPCODE_OP_BOTTOM3 {
4615020Sgblack@eecs.umich.edu                    0x0: punpcklbw_Vo_Wq();
4625020Sgblack@eecs.umich.edu                    0x1: punpcklwd_Vo_Wq();
4635020Sgblack@eecs.umich.edu                    0x2: punpckldq_Vo_Wq();
4645020Sgblack@eecs.umich.edu                    0x3: packsswb_Vo_Wo();
4655020Sgblack@eecs.umich.edu                    0x4: pcmpgtb_Vo_Wo();
4665020Sgblack@eecs.umich.edu                    0x5: pcmpgtw_Vo_Wo();
4675020Sgblack@eecs.umich.edu                    0x6: pcmpgtd_Vo_Wo();
4685020Sgblack@eecs.umich.edu                    0x7: packuswb_Vo_Wo();
4695020Sgblack@eecs.umich.edu                }
4705020Sgblack@eecs.umich.edu                default: Inst::UD2();
4714276Sgblack@eecs.umich.edu            }
4725020Sgblack@eecs.umich.edu            0x0D: decode LEGACY_DECODEVAL {
4735020Sgblack@eecs.umich.edu                // no prefix
4745020Sgblack@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
4755020Sgblack@eecs.umich.edu                    0x0: punpckhbw_Pq_Qq();
4765020Sgblack@eecs.umich.edu                    0x1: punpckhwd_Pq_Qq();
4775020Sgblack@eecs.umich.edu                    0x2: punpckhdq_Pq_Qq();
4785020Sgblack@eecs.umich.edu                    0x3: packssdw_Pq_Qq();
4795020Sgblack@eecs.umich.edu                    0x6: movd_Pq_Ed();
4805020Sgblack@eecs.umich.edu                    0x7: movq_Pq_Qq();
4815020Sgblack@eecs.umich.edu                    default: Inst::UD2();
4825020Sgblack@eecs.umich.edu                }
4835020Sgblack@eecs.umich.edu                // repe (0xF3)
4845020Sgblack@eecs.umich.edu                0x4: decode OPCODE_OP_BOTTOM3 {
4855020Sgblack@eecs.umich.edu                    0x7: movdqu_Vo_Wo();
4865020Sgblack@eecs.umich.edu                    default: Inst::UD2();
4875020Sgblack@eecs.umich.edu                }
4885020Sgblack@eecs.umich.edu                // operand size (0x66)
4895020Sgblack@eecs.umich.edu                0x1: decode OPCODE_OP_BOTTOM3 {
4905020Sgblack@eecs.umich.edu                    0x0: punpckhbw_Vo_Wo();
4915020Sgblack@eecs.umich.edu                    0x1: punpckhwd_Vo_Wo();
4925020Sgblack@eecs.umich.edu                    0x2: punpckhdq_Vo_Wo();
4935020Sgblack@eecs.umich.edu                    0x3: packssdw_Vo_Wo();
4945020Sgblack@eecs.umich.edu                    0x4: punpcklqdq_Vo_Wq();
4955020Sgblack@eecs.umich.edu                    0x5: punpcklqdq_Vo_Wq();
4965020Sgblack@eecs.umich.edu                    0x6: movd_Vo_Ed();
4975020Sgblack@eecs.umich.edu                    0x7: movdqa_Vo_Wo();
4985020Sgblack@eecs.umich.edu                }
4995020Sgblack@eecs.umich.edu                default: Inst::UD2();
5004276Sgblack@eecs.umich.edu            }
5015020Sgblack@eecs.umich.edu            0x0E: decode LEGACY_DECODEVAL {
5025020Sgblack@eecs.umich.edu                // no prefix
5035020Sgblack@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
5045020Sgblack@eecs.umich.edu                    0x0: pshufw_Pq_Qq_Ib();
5055238Sgblack@eecs.umich.edu                    //0x1: group13_pshimw();
5065238Sgblack@eecs.umich.edu                    0x1: decode MODRM_REG {
5075238Sgblack@eecs.umich.edu                        0x2: decode LEGACY_OP {
5085238Sgblack@eecs.umich.edu                            0x0: psrlw_PRq_Ib();
5095238Sgblack@eecs.umich.edu                            0x1: psrlw_VRo_Ib();
5105238Sgblack@eecs.umich.edu                        }
5115238Sgblack@eecs.umich.edu                        0x4: decode LEGACY_OP {
5125238Sgblack@eecs.umich.edu                            0x0: psraw_PRq_Ib();
5135238Sgblack@eecs.umich.edu                            0x1: psraw_VRo_Ib();
5145238Sgblack@eecs.umich.edu                        }
5155238Sgblack@eecs.umich.edu                        0x6: decode LEGACY_OP {
5165238Sgblack@eecs.umich.edu                            0x0: psllw_PRq_Ib();
5175238Sgblack@eecs.umich.edu                            0x1: psllw_VRo_Ib();
5185238Sgblack@eecs.umich.edu                        }
5195238Sgblack@eecs.umich.edu                        default: Inst::UD2();
5205238Sgblack@eecs.umich.edu                    }
5215238Sgblack@eecs.umich.edu                    //0x2: group14_pshimd();
5225238Sgblack@eecs.umich.edu                    0x2: decode MODRM_REG {
5235238Sgblack@eecs.umich.edu                        0x2: decode LEGACY_OP {
5245238Sgblack@eecs.umich.edu                            0x0: psrld_PRq_Ib();
5255238Sgblack@eecs.umich.edu                            0x1: psrld_VRo_Ib();
5265238Sgblack@eecs.umich.edu                        }
5275238Sgblack@eecs.umich.edu                        0x4: decode LEGACY_OP {
5285238Sgblack@eecs.umich.edu                            0x0: psrad_PRq_Ib();
5295238Sgblack@eecs.umich.edu                            0x1: psrad_VRo_Ib();
5305238Sgblack@eecs.umich.edu                        }
5315238Sgblack@eecs.umich.edu                        0x6: decode LEGACY_OP {
5325238Sgblack@eecs.umich.edu                            0x0: pslld_PRq_Ib();
5335238Sgblack@eecs.umich.edu                            0x1: pslld_VRo_Ib();
5345238Sgblack@eecs.umich.edu                        }
5355238Sgblack@eecs.umich.edu                        default: Inst::UD2();
5365238Sgblack@eecs.umich.edu                    }
5375238Sgblack@eecs.umich.edu                    //0x3: group15_pshimq();
5385238Sgblack@eecs.umich.edu                    0x3: decode MODRM_REG {
5395238Sgblack@eecs.umich.edu                        0x2: decode LEGACY_OP {
5405238Sgblack@eecs.umich.edu                            0x0: psrlq_PRq_Ib();
5415238Sgblack@eecs.umich.edu                            0x1: psrlq_VRo_Ib();
5425238Sgblack@eecs.umich.edu                        }
5435238Sgblack@eecs.umich.edu                        0x3: decode LEGACY_OP {
5445238Sgblack@eecs.umich.edu                            0x0: Inst::UD2();
5455238Sgblack@eecs.umich.edu                            0x1: psrldq_VRo_Ib();
5465238Sgblack@eecs.umich.edu                        }
5475238Sgblack@eecs.umich.edu                        0x6: decode LEGACY_OP {
5485238Sgblack@eecs.umich.edu                            0x0: psllq_PRq_Ib();
5495238Sgblack@eecs.umich.edu                            0x1: psllq_VRo_Ib();
5505238Sgblack@eecs.umich.edu                        }
5515238Sgblack@eecs.umich.edu                        0x7: decode LEGACY_OP {
5525238Sgblack@eecs.umich.edu                            0x0: Inst::UD2();
5535238Sgblack@eecs.umich.edu                            0x1: pslldq_VRo_Ib();
5545238Sgblack@eecs.umich.edu                        }
5555238Sgblack@eecs.umich.edu                        default: Inst::UD2();
5565238Sgblack@eecs.umich.edu                    }
5575020Sgblack@eecs.umich.edu                    0x4: pcmpeqb_Pq_Qq();
5585020Sgblack@eecs.umich.edu                    0x5: pcmpeqw_Pq_Qq();
5595020Sgblack@eecs.umich.edu                    0x6: pcmpeqd_Pq_Qq();
5605020Sgblack@eecs.umich.edu                    0x7: emms();
5615020Sgblack@eecs.umich.edu                }
5625020Sgblack@eecs.umich.edu                // repe (0xF3)
5635020Sgblack@eecs.umich.edu                0x4: decode OPCODE_OP_BOTTOM3 {
5645020Sgblack@eecs.umich.edu                    0x0: pshufhw_Vo_Wo_Ib();
5655020Sgblack@eecs.umich.edu                    default: Inst::UD2();
5665020Sgblack@eecs.umich.edu                }
5675020Sgblack@eecs.umich.edu                // operand size (0x66)
5685020Sgblack@eecs.umich.edu                0x1: decode OPCODE_OP_BOTTOM3 {
5695020Sgblack@eecs.umich.edu                    0x0: pshufd_Vo_Wo_Ib();
5705238Sgblack@eecs.umich.edu                    //0x1: group13_pshimw();
5715238Sgblack@eecs.umich.edu                    0x1: decode MODRM_REG {
5725238Sgblack@eecs.umich.edu                        0x2: decode LEGACY_OP {
5735238Sgblack@eecs.umich.edu                            0x0: psrlw_PRq_Ib();
5745238Sgblack@eecs.umich.edu                            0x1: psrlw_VRo_Ib();
5755238Sgblack@eecs.umich.edu                        }
5765238Sgblack@eecs.umich.edu                        0x4: decode LEGACY_OP {
5775238Sgblack@eecs.umich.edu                            0x0: psraw_PRq_Ib();
5785238Sgblack@eecs.umich.edu                            0x1: psraw_VRo_Ib();
5795238Sgblack@eecs.umich.edu                        }
5805238Sgblack@eecs.umich.edu                        0x6: decode LEGACY_OP {
5815238Sgblack@eecs.umich.edu                            0x0: psllw_PRq_Ib();
5825238Sgblack@eecs.umich.edu                            0x1: psllw_VRo_Ib();
5835238Sgblack@eecs.umich.edu                        }
5845238Sgblack@eecs.umich.edu                        default: Inst::UD2();
5855238Sgblack@eecs.umich.edu                    }
5865238Sgblack@eecs.umich.edu                    //0x2: group14_pshimd();
5875238Sgblack@eecs.umich.edu                    0x2: decode MODRM_REG {
5885238Sgblack@eecs.umich.edu                        0x2: decode LEGACY_OP {
5895238Sgblack@eecs.umich.edu                            0x0: psrld_PRq_Ib();
5905238Sgblack@eecs.umich.edu                            0x1: psrld_VRo_Ib();
5915238Sgblack@eecs.umich.edu                        }
5925238Sgblack@eecs.umich.edu                        0x4: decode LEGACY_OP {
5935238Sgblack@eecs.umich.edu                            0x0: psrad_PRq_Ib();
5945238Sgblack@eecs.umich.edu                            0x1: psrad_VRo_Ib();
5955238Sgblack@eecs.umich.edu                        }
5965238Sgblack@eecs.umich.edu                        0x6: decode LEGACY_OP {
5975238Sgblack@eecs.umich.edu                            0x0: pslld_PRq_Ib();
5985238Sgblack@eecs.umich.edu                            0x1: pslld_VRo_Ib();
5995238Sgblack@eecs.umich.edu                        }
6005238Sgblack@eecs.umich.edu                        default: Inst::UD2();
6015238Sgblack@eecs.umich.edu                    }
6025238Sgblack@eecs.umich.edu                    //0x3: group15_pshimq();
6035238Sgblack@eecs.umich.edu                    0x3: decode MODRM_REG {
6045238Sgblack@eecs.umich.edu                        0x2: decode LEGACY_OP {
6055238Sgblack@eecs.umich.edu                            0x0: psrlq_PRq_Ib();
6065238Sgblack@eecs.umich.edu                            0x1: psrlq_VRo_Ib();
6075238Sgblack@eecs.umich.edu                        }
6085238Sgblack@eecs.umich.edu                        0x3: decode LEGACY_OP {
6095238Sgblack@eecs.umich.edu                            0x0: Inst::UD2();
6105238Sgblack@eecs.umich.edu                            0x1: psrldq_VRo_Ib();
6115238Sgblack@eecs.umich.edu                        }
6125238Sgblack@eecs.umich.edu                        0x6: decode LEGACY_OP {
6135238Sgblack@eecs.umich.edu                            0x0: psllq_PRq_Ib();
6145238Sgblack@eecs.umich.edu                            0x1: psllq_VRo_Ib();
6155238Sgblack@eecs.umich.edu                        }
6165238Sgblack@eecs.umich.edu                        0x7: decode LEGACY_OP {
6175238Sgblack@eecs.umich.edu                            0x0: Inst::UD2();
6185238Sgblack@eecs.umich.edu                            0x1: pslldq_VRo_Ib();
6195238Sgblack@eecs.umich.edu                        }
6205238Sgblack@eecs.umich.edu                        default: Inst::UD2();
6215238Sgblack@eecs.umich.edu                    }
6225020Sgblack@eecs.umich.edu                    0x4: pcmpeqb_Vo_Wo();
6235020Sgblack@eecs.umich.edu                    0x5: pcmpeqw_Vo_Wo();
6245020Sgblack@eecs.umich.edu                    0x6: pcmpeqd_Vo_Wo();
6255020Sgblack@eecs.umich.edu                    default: Inst::UD2();
6265020Sgblack@eecs.umich.edu                }
6275020Sgblack@eecs.umich.edu                // repne (0xF2)
6285020Sgblack@eecs.umich.edu                0x8: decode OPCODE_OP_BOTTOM3 {
6295020Sgblack@eecs.umich.edu                    0x0: pshuflw_Vo_Wo_Ib();
6305020Sgblack@eecs.umich.edu                    default: Inst::UD2();
6315020Sgblack@eecs.umich.edu                }
6325020Sgblack@eecs.umich.edu                default: Inst::UD2();
6334276Sgblack@eecs.umich.edu            }
6345020Sgblack@eecs.umich.edu            0x0F: decode LEGACY_DECODEVAL {
6355020Sgblack@eecs.umich.edu                // no prefix
6365020Sgblack@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
6375020Sgblack@eecs.umich.edu                    0x0: vmread_Ed_or_Eq_Gd_or_Gq();
6385020Sgblack@eecs.umich.edu                    0x1: vmwrite_Gd_or_Gq_Ed_or_Eq();
6395020Sgblack@eecs.umich.edu                    0x6: mov_Ed_Pd();
6405020Sgblack@eecs.umich.edu                    0x7: mov_Qq_Pq();
6415020Sgblack@eecs.umich.edu                    default: Inst::UD2();
6425020Sgblack@eecs.umich.edu                }
6435020Sgblack@eecs.umich.edu                // repe (0xF3)
6445020Sgblack@eecs.umich.edu                0x4: decode OPCODE_OP_BOTTOM3 {
6455020Sgblack@eecs.umich.edu                    0x6: movq_Vo_Mq_or_Vq_Vq();
6465020Sgblack@eecs.umich.edu                    0x7: movdqu_Wo_Vo();
6475020Sgblack@eecs.umich.edu                    default: Inst::UD2();
6485020Sgblack@eecs.umich.edu                }
6495020Sgblack@eecs.umich.edu                // operand size (0x66)
6505020Sgblack@eecs.umich.edu                0x1: decode OPCODE_OP_BOTTOM3 {
6515020Sgblack@eecs.umich.edu                    0x4: haddpd_Vo_Wo();
6525020Sgblack@eecs.umich.edu                    0x5: hsubpd_Vo_Wo();
6535020Sgblack@eecs.umich.edu                    0x6: movd_Ed_Vd();
6545020Sgblack@eecs.umich.edu                    0x7: movdqa_Wo_Vo();
6555020Sgblack@eecs.umich.edu                    default: Inst::UD2();
6565020Sgblack@eecs.umich.edu                }
6575020Sgblack@eecs.umich.edu                // repne (0xF2)
6585020Sgblack@eecs.umich.edu                0x8: decode OPCODE_OP_BOTTOM3 {
6595020Sgblack@eecs.umich.edu                    0x4: haddps_Vo_Wo();
6605020Sgblack@eecs.umich.edu                    0x5: hsubps_Vo_Wo();
6615020Sgblack@eecs.umich.edu                    default: Inst::UD2();
6625020Sgblack@eecs.umich.edu                }
6635020Sgblack@eecs.umich.edu                default: Inst::UD2();
6644276Sgblack@eecs.umich.edu            }
6654727Sgblack@eecs.umich.edu            format Inst {
6664727Sgblack@eecs.umich.edu                0x10: decode OPCODE_OP_BOTTOM3 {
6674727Sgblack@eecs.umich.edu                    0x0: JO(Jz);
6684727Sgblack@eecs.umich.edu                    0x1: JNO(Jz);
6694727Sgblack@eecs.umich.edu                    0x2: JB(Jz);
6704727Sgblack@eecs.umich.edu                    0x3: JNB(Jz);
6714727Sgblack@eecs.umich.edu                    0x4: JZ(Jz);
6724727Sgblack@eecs.umich.edu                    0x5: JNZ(Jz);
6734727Sgblack@eecs.umich.edu                    0x6: JBE(Jz);
6744727Sgblack@eecs.umich.edu                    0x7: JNBE(Jz);
6754727Sgblack@eecs.umich.edu                }
6764727Sgblack@eecs.umich.edu                0x11: decode OPCODE_OP_BOTTOM3 {
6774727Sgblack@eecs.umich.edu                    0x0: JS(Jz);
6784727Sgblack@eecs.umich.edu                    0x1: JNS(Jz);
6794727Sgblack@eecs.umich.edu                    0x2: JP(Jz);
6804727Sgblack@eecs.umich.edu                    0x3: JNP(Jz);
6814727Sgblack@eecs.umich.edu                    0x4: JL(Jz);
6824727Sgblack@eecs.umich.edu                    0x5: JNL(Jz);
6834727Sgblack@eecs.umich.edu                    0x6: JLE(Jz);
6844727Sgblack@eecs.umich.edu                    0x7: JNLE(Jz);
6854727Sgblack@eecs.umich.edu                }
6864760Sgblack@eecs.umich.edu                0x12: decode OPCODE_OP_BOTTOM3 {
6874760Sgblack@eecs.umich.edu                    0x0: SETO(Eb);
6884760Sgblack@eecs.umich.edu                    0x1: SETNO(Eb);
6894760Sgblack@eecs.umich.edu                    0x2: SETB(Eb);
6904760Sgblack@eecs.umich.edu                    0x3: SETNB(Eb);
6914760Sgblack@eecs.umich.edu                    0x4: SETZ(Eb);
6924760Sgblack@eecs.umich.edu                    0x5: SETNZ(Eb);
6934760Sgblack@eecs.umich.edu                    0x6: SETBE(Eb);
6944760Sgblack@eecs.umich.edu                    0x7: SETNBE(Eb);
6954760Sgblack@eecs.umich.edu                }
6964760Sgblack@eecs.umich.edu                0x13: decode OPCODE_OP_BOTTOM3 {
6974760Sgblack@eecs.umich.edu                    0x0: SETS(Eb);
6984760Sgblack@eecs.umich.edu                    0x1: SETNS(Eb);
6994760Sgblack@eecs.umich.edu                    0x2: SETP(Eb);
7004760Sgblack@eecs.umich.edu                    0x3: SETNP(Eb);
7014760Sgblack@eecs.umich.edu                    0x4: SETL(Eb);
7024760Sgblack@eecs.umich.edu                    0x5: SETNL(Eb);
7034760Sgblack@eecs.umich.edu                    0x6: SETLE(Eb);
7044760Sgblack@eecs.umich.edu                    0x7: SETNLE(Eb);
7054760Sgblack@eecs.umich.edu                }
7064276Sgblack@eecs.umich.edu            }
7074276Sgblack@eecs.umich.edu            0x14: decode OPCODE_OP_BOTTOM3 {
7084712Sgblack@eecs.umich.edu                0x0: push_fs();
7094712Sgblack@eecs.umich.edu                0x1: pop_fs();
7104814Sgblack@eecs.umich.edu                0x2: Inst::CPUID(rAd);
7115240Sgblack@eecs.umich.edu                0x3: Inst::BT(Ev,Gv);
7124712Sgblack@eecs.umich.edu                0x4: shld_Ev_Gv_Ib();
7134712Sgblack@eecs.umich.edu                0x5: shld_Ev_Gv_rCl();
7144712Sgblack@eecs.umich.edu                0x6: xbts_and_cmpxchg();
7154712Sgblack@eecs.umich.edu                0x7: ibts_and_cmpxchg();
7164276Sgblack@eecs.umich.edu            }
7174276Sgblack@eecs.umich.edu            0x15: decode OPCODE_OP_BOTTOM3 {
7184712Sgblack@eecs.umich.edu                0x0: push_gs();
7194712Sgblack@eecs.umich.edu                0x1: pop_gs();
7204712Sgblack@eecs.umich.edu                0x2: rsm_smm();
7215240Sgblack@eecs.umich.edu                0x3: Inst::BTS(Ev,Gv);
7224712Sgblack@eecs.umich.edu                0x4: shrd_Ev_Gv_Ib();
7234712Sgblack@eecs.umich.edu                0x5: shrd_Ev_Gv_rCl();
7245238Sgblack@eecs.umich.edu                //0x6: group16();
7255238Sgblack@eecs.umich.edu                0x6: decode MODRM_MOD {
7265238Sgblack@eecs.umich.edu                    0x3: decode MODRM_REG {
7275238Sgblack@eecs.umich.edu                        0x5: lfence();
7285238Sgblack@eecs.umich.edu                        0x6: mfence();
7295238Sgblack@eecs.umich.edu                        0x7: sfence();
7305238Sgblack@eecs.umich.edu                        default: Inst::UD2();
7315238Sgblack@eecs.umich.edu                    }
7325238Sgblack@eecs.umich.edu                    default: decode MODRM_REG {
7335238Sgblack@eecs.umich.edu                        0x0: fxsave();
7345238Sgblack@eecs.umich.edu                        0x1: fxrstor();
7355238Sgblack@eecs.umich.edu                        0x7: clflush();
7365238Sgblack@eecs.umich.edu                        default: Inst::UD2();
7375238Sgblack@eecs.umich.edu                    }
7385238Sgblack@eecs.umich.edu                }
7394724Sgblack@eecs.umich.edu                0x7: Inst::IMUL(Gv,Ev);
7404276Sgblack@eecs.umich.edu            }
7414276Sgblack@eecs.umich.edu            0x16: decode OPCODE_OP_BOTTOM3 {
7424864Sgblack@eecs.umich.edu                0x0: Inst::CMPXCHG(Eb,Gb);
7434864Sgblack@eecs.umich.edu                0x1: Inst::CMPXCHG(Ev,Gv);
7444712Sgblack@eecs.umich.edu                0x2: lss_Gz_Mp();
7455240Sgblack@eecs.umich.edu                0x3: Inst::BTR(Ev,Gv);
7464712Sgblack@eecs.umich.edu                0x4: lfs_Gz_Mp();
7474712Sgblack@eecs.umich.edu                0x5: lgs_Gz_Mp();
7484746Sgblack@eecs.umich.edu                //The size of the second operand in these instructions should
7494746Sgblack@eecs.umich.edu                //really be "b" or "w", but it's set to v in order to have a
7504746Sgblack@eecs.umich.edu                //consistent register size. This shouldn't affect behavior.
7514746Sgblack@eecs.umich.edu                0x6: Inst::MOVZX_B(Gv,Ev);
7524746Sgblack@eecs.umich.edu                0x7: Inst::MOVZX_W(Gv,Ev);
7534276Sgblack@eecs.umich.edu            }
7544276Sgblack@eecs.umich.edu            0x17: decode OPCODE_OP_BOTTOM3 {
7554712Sgblack@eecs.umich.edu                0x0: jmpe_Jz(); // IA-64?
7565240Sgblack@eecs.umich.edu                format Inst {
7575240Sgblack@eecs.umich.edu                    //0x1: group11_UD2();
7585240Sgblack@eecs.umich.edu                    0x1: UD2();
7595240Sgblack@eecs.umich.edu                    //0x2: group8_Ev_Ib();
7605240Sgblack@eecs.umich.edu                    0x2: decode MODRM_REG {
7615240Sgblack@eecs.umich.edu                        0x4: BT(Ev,Ib);
7625240Sgblack@eecs.umich.edu                        0x5: BTS(Ev,Ib);
7635240Sgblack@eecs.umich.edu                        0x6: BTR(Ev,Ib);
7645240Sgblack@eecs.umich.edu                        0x7: BTC(Ev,Ib);
7655240Sgblack@eecs.umich.edu                        default: UD2();
7665240Sgblack@eecs.umich.edu                    }
7675240Sgblack@eecs.umich.edu                    0x3: BTC(Ev,Gv);
7685238Sgblack@eecs.umich.edu                }
7695332Sgblack@eecs.umich.edu                0x4: Inst::BSF(Gv,Ev);
7705332Sgblack@eecs.umich.edu                0x5: Inst::BSR(Gv,Ev);
7714746Sgblack@eecs.umich.edu                //The size of the second operand in these instructions should
7724746Sgblack@eecs.umich.edu                //really be "b" or "w", but it's set to v in order to have a
7734746Sgblack@eecs.umich.edu                //consistent register size. This shouldn't affect behavior.
7744746Sgblack@eecs.umich.edu                0x6: Inst::MOVSX_B(Gv,Ev);
7754746Sgblack@eecs.umich.edu                0x7: Inst::MOVSX_W(Gv,Ev);
7764276Sgblack@eecs.umich.edu            }
7774276Sgblack@eecs.umich.edu            0x18: decode OPCODE_OP_BOTTOM3 {
7785020Sgblack@eecs.umich.edu                0x0: xadd_Eb_Gb();
7795020Sgblack@eecs.umich.edu                0x1: xadd_Ev_Gv();
7805238Sgblack@eecs.umich.edu                //0x7: group9();
7815238Sgblack@eecs.umich.edu                0x7: decode MODRM_REG {
7825238Sgblack@eecs.umich.edu                    0x1: cmpxchg_Mq();
7835238Sgblack@eecs.umich.edu                    0x6: decode LEGACY_OP {
7845238Sgblack@eecs.umich.edu                        0x1: vmclear_Mq();
7855238Sgblack@eecs.umich.edu                        default: decode LEGACY_REP {
7865238Sgblack@eecs.umich.edu                            0x1: vmxon_Mq();
7875238Sgblack@eecs.umich.edu                            0x0: vmptrld_Mq();
7885238Sgblack@eecs.umich.edu                        }
7895238Sgblack@eecs.umich.edu                    }
7905238Sgblack@eecs.umich.edu                    0x7: vmptrst_Mq();
7915238Sgblack@eecs.umich.edu                    default: Inst::UD2();
7925238Sgblack@eecs.umich.edu                }
7935020Sgblack@eecs.umich.edu                default: decode LEGACY_DECODEVAL {
7945020Sgblack@eecs.umich.edu                    // no prefix
7955020Sgblack@eecs.umich.edu                    0x0: decode OPCODE_OP_BOTTOM3 {
7965020Sgblack@eecs.umich.edu                        0x2: cmpccps_Vo_Wo_Ib();
7975020Sgblack@eecs.umich.edu                        0x3: cvtdq2ps_Vo_Wo();
7985020Sgblack@eecs.umich.edu                        0x4: subps_Vo_Wo();
7995020Sgblack@eecs.umich.edu                        0x5: minps_Vo_Wo();
8005020Sgblack@eecs.umich.edu                        0x6: divps_Vo_Wo();
8015020Sgblack@eecs.umich.edu                    }
8025020Sgblack@eecs.umich.edu                    // repe (0xF3)
8035020Sgblack@eecs.umich.edu                    0x4: decode OPCODE_OP_BOTTOM3 {
8045020Sgblack@eecs.umich.edu                        0x2: cmpccss_Vd_Wd_Ib();
8055020Sgblack@eecs.umich.edu                        default: Inst::UD2();
8065020Sgblack@eecs.umich.edu                    }
8075020Sgblack@eecs.umich.edu                    // operand size (0x66)
8085020Sgblack@eecs.umich.edu                    0x1: decode OPCODE_OP_BOTTOM3 {
8095020Sgblack@eecs.umich.edu                        0x2: cmpccpd_Vo_Wo_Ib();
8105020Sgblack@eecs.umich.edu                        0x4: subpd_Vo_Wo();
8115020Sgblack@eecs.umich.edu                        0x5: minpd_Vo_Wo();
8125020Sgblack@eecs.umich.edu                        0x6: divpd_Vo_Wo();
8135020Sgblack@eecs.umich.edu                        default: Inst::UD2();
8145020Sgblack@eecs.umich.edu                    }
8155020Sgblack@eecs.umich.edu                    // repne (0xF2)
8165020Sgblack@eecs.umich.edu                    0x8: decode OPCODE_OP_BOTTOM3 {
8175020Sgblack@eecs.umich.edu                        0x2: cmpccsd_Vq_Wq_Ib();
8185020Sgblack@eecs.umich.edu                        default: Inst::UD2();
8195020Sgblack@eecs.umich.edu                    }
8205020Sgblack@eecs.umich.edu                    default: Inst::UD2();
8215020Sgblack@eecs.umich.edu                }
8224276Sgblack@eecs.umich.edu            }
8234726Sgblack@eecs.umich.edu            0x19: bswap_B();
8245020Sgblack@eecs.umich.edu            0x1A: decode LEGACY_DECODEVAL {
8255020Sgblack@eecs.umich.edu                // no prefix
8265020Sgblack@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
8275020Sgblack@eecs.umich.edu                    0x1: psrlw_Pq_Qq();
8285020Sgblack@eecs.umich.edu                    0x2: psrld_Pq_Qq();
8295020Sgblack@eecs.umich.edu                    0x3: psrlq_Pq_Qq();
8305020Sgblack@eecs.umich.edu                    0x4: paddq_Pq_Qq();
8315020Sgblack@eecs.umich.edu                    0x5: pmullw_Pq_Qq();
8325020Sgblack@eecs.umich.edu                    0x7: pmovmskb_Gd_PRq();
8335020Sgblack@eecs.umich.edu                    default: Inst::UD2();
8345020Sgblack@eecs.umich.edu                }
8355020Sgblack@eecs.umich.edu                // repe (0xF3)
8365020Sgblack@eecs.umich.edu                0x4: decode OPCODE_OP_BOTTOM3 {
8375020Sgblack@eecs.umich.edu                    0x6: movq2dq_Vo_PRq();
8385020Sgblack@eecs.umich.edu                    default: Inst::UD2();
8395020Sgblack@eecs.umich.edu                }
8405020Sgblack@eecs.umich.edu                // operand size (0x66)
8415020Sgblack@eecs.umich.edu                0x1: decode OPCODE_OP_BOTTOM3 {
8425020Sgblack@eecs.umich.edu                    0x0: addsubpd_Vo_Wo();
8435020Sgblack@eecs.umich.edu                    0x1: psrlw_Vo_Wo();
8445020Sgblack@eecs.umich.edu                    0x2: psrld_Vo_Wo();
8455020Sgblack@eecs.umich.edu                    0x3: psrlq_Vo_Wo();
8465020Sgblack@eecs.umich.edu                    0x4: paddq_Vo_Wo();
8475020Sgblack@eecs.umich.edu                    0x5: pmullw_Vo_Wo();
8485020Sgblack@eecs.umich.edu                    0x6: decode MODRM_MOD {
8495020Sgblack@eecs.umich.edu                        0x3: movq_Vq_Vq();
8505020Sgblack@eecs.umich.edu                        default: movq_Mq_Vq();
8515020Sgblack@eecs.umich.edu                    }
8525020Sgblack@eecs.umich.edu                    0x7: pmovmskb_Gd_VRo();
8535020Sgblack@eecs.umich.edu                }
8545020Sgblack@eecs.umich.edu                // repne (0xF2)
8555020Sgblack@eecs.umich.edu                0x8: decode OPCODE_OP_BOTTOM3 {
8565020Sgblack@eecs.umich.edu                    0x0: addsubps_Vo_Wo();
8575020Sgblack@eecs.umich.edu                    0x6: movdq2q_Pq_VRq();
8585020Sgblack@eecs.umich.edu                    default: Inst::UD2();
8595020Sgblack@eecs.umich.edu                }
8605020Sgblack@eecs.umich.edu                default: Inst::UD2();
8614276Sgblack@eecs.umich.edu            }
8625020Sgblack@eecs.umich.edu            0x1B: decode LEGACY_DECODEVAL {
8635020Sgblack@eecs.umich.edu                // no prefix
8645020Sgblack@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
8655020Sgblack@eecs.umich.edu                    0x0: psubusb_Pq_Qq();
8665020Sgblack@eecs.umich.edu                    0x1: psubusw_Pq_Qq();
8675020Sgblack@eecs.umich.edu                    0x2: pminub_Pq_Qq();
8685020Sgblack@eecs.umich.edu                    0x3: pand_Pq_Qq();
8695020Sgblack@eecs.umich.edu                    0x4: paddusb_Pq_Qq();
8705020Sgblack@eecs.umich.edu                    0x5: paddusw_Pq_Qq();
8715020Sgblack@eecs.umich.edu                    0x6: pmaxub_Pq_Qq();
8725020Sgblack@eecs.umich.edu                    0x7: pandn_Pq_Qq();
8735020Sgblack@eecs.umich.edu                }
8745020Sgblack@eecs.umich.edu                // operand size (0x66)
8755020Sgblack@eecs.umich.edu                0x1: decode OPCODE_OP_BOTTOM3 {
8765020Sgblack@eecs.umich.edu                    0x0: psubusb_Vo_Wo();
8775020Sgblack@eecs.umich.edu                    0x1: psubusw_Vo_Wo();
8785020Sgblack@eecs.umich.edu                    0x2: pminub_Vo_Wo();
8795020Sgblack@eecs.umich.edu                    0x3: pand_Vo_Wo();
8805020Sgblack@eecs.umich.edu                    0x4: paddusb_Vo_Wo();
8815020Sgblack@eecs.umich.edu                    0x5: paddusw_Vo_Wo();
8825020Sgblack@eecs.umich.edu                    0x6: pmaxub_Vo_Wo();
8835020Sgblack@eecs.umich.edu                    0x7: pandn_Vo_Wo();
8845020Sgblack@eecs.umich.edu                }
8855020Sgblack@eecs.umich.edu                default: Inst::UD2();
8864276Sgblack@eecs.umich.edu            }
8875022Sgblack@eecs.umich.edu            0x1C: decode LEGACY_DECODEVAL {
8885022Sgblack@eecs.umich.edu                // no prefix
8895022Sgblack@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
8905022Sgblack@eecs.umich.edu                    0x0: pavgb_Pq_Qq();
8915022Sgblack@eecs.umich.edu                    0x1: psraw_Pq_Qq();
8925022Sgblack@eecs.umich.edu                    0x2: psrad_Pq_Qq();
8935022Sgblack@eecs.umich.edu                    0x3: pavgw_Pq_Qq();
8945022Sgblack@eecs.umich.edu                    0x4: pmulhuw_Pq_Qq();
8955022Sgblack@eecs.umich.edu                    0x5: pmulhw_Pq_Qq();
8965022Sgblack@eecs.umich.edu                    0x7: movntq_Mq_Pq();
8975022Sgblack@eecs.umich.edu                    default: Inst::UD2();
8985022Sgblack@eecs.umich.edu                }
8995022Sgblack@eecs.umich.edu                // repe (0xF3)
9005022Sgblack@eecs.umich.edu                0x4: decode OPCODE_OP_BOTTOM3 {
9015022Sgblack@eecs.umich.edu                    0x6: cvtdq2pd_Vo_Wq();
9025022Sgblack@eecs.umich.edu                    default: Inst::UD2();
9035022Sgblack@eecs.umich.edu                }
9045022Sgblack@eecs.umich.edu                // operand size (0x66)
9055022Sgblack@eecs.umich.edu                0x1: decode OPCODE_OP_BOTTOM3 {
9065022Sgblack@eecs.umich.edu                    0x0: pavgb_Vo_Wo();
9075022Sgblack@eecs.umich.edu                    0x1: psraw_Vo_Wo();
9085022Sgblack@eecs.umich.edu                    0x2: psrad_Vo_Wo();
9095022Sgblack@eecs.umich.edu                    0x3: pavgw_Vo_Wo();
9105022Sgblack@eecs.umich.edu                    0x4: pmulhuw_Vo_Wo();
9115022Sgblack@eecs.umich.edu                    0x5: pmulhw_Vo_Wo();
9125022Sgblack@eecs.umich.edu                    0x6: cvttpd2dq_Vo_Wo();
9135022Sgblack@eecs.umich.edu                    0x7: movntdq_Mo_Vo();
9145022Sgblack@eecs.umich.edu                }
9155022Sgblack@eecs.umich.edu                // repne (0xF2)
9165022Sgblack@eecs.umich.edu                0x8: decode OPCODE_OP_BOTTOM3 {
9175022Sgblack@eecs.umich.edu                    0x6: cvtpd2dq_Vo_Wo();
9185022Sgblack@eecs.umich.edu                    default: Inst::UD2();
9195022Sgblack@eecs.umich.edu                }
9205022Sgblack@eecs.umich.edu                default: Inst::UD2();
9214276Sgblack@eecs.umich.edu            }
9225020Sgblack@eecs.umich.edu            0x1D: decode LEGACY_DECODEVAL {
9235020Sgblack@eecs.umich.edu                // no prefix
9245020Sgblack@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
9255020Sgblack@eecs.umich.edu                    0x0: psubsb_Pq_Qq();
9265020Sgblack@eecs.umich.edu                    0x1: psubsw_Pq_Qq();
9275020Sgblack@eecs.umich.edu                    0x2: pminsw_Pq_Qq();
9285020Sgblack@eecs.umich.edu                    0x3: por_Pq_Qq();
9295020Sgblack@eecs.umich.edu                    0x4: paddsb_Pq_Qq();
9305020Sgblack@eecs.umich.edu                    0x5: paddsw_Pq_Qq();
9315020Sgblack@eecs.umich.edu                    0x6: pmaxsw_Pq_Qq();
9325020Sgblack@eecs.umich.edu                    0x7: pxor_Pq_Qq();
9335020Sgblack@eecs.umich.edu                }
9345020Sgblack@eecs.umich.edu                // operand size (0x66)
9355020Sgblack@eecs.umich.edu                0x1: decode OPCODE_OP_BOTTOM3 {
9365020Sgblack@eecs.umich.edu                    0x0: psubsb_Vo_Wo();
9375020Sgblack@eecs.umich.edu                    0x1: psubsw_Vo_Wo();
9385020Sgblack@eecs.umich.edu                    0x2: pminsw_Vo_Wo();
9395020Sgblack@eecs.umich.edu                    0x3: por_Vo_Wo();
9405020Sgblack@eecs.umich.edu                    0x4: paddsb_Vo_Wo();
9415020Sgblack@eecs.umich.edu                    0x5: paddsw_Vo_Wo();
9425020Sgblack@eecs.umich.edu                    0x6: pmaxsw_Vo_Wo();
9435020Sgblack@eecs.umich.edu                    0x7: pxor_Vo_Wo();
9445020Sgblack@eecs.umich.edu                }
9455020Sgblack@eecs.umich.edu                default: Inst::UD2();
9464276Sgblack@eecs.umich.edu            }
9474276Sgblack@eecs.umich.edu            0x1E: decode OPCODE_OP_BOTTOM3 {
9485022Sgblack@eecs.umich.edu                // no prefix
9495022Sgblack@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
9505022Sgblack@eecs.umich.edu                    0x1: psllw_Pq_Qq();
9515022Sgblack@eecs.umich.edu                    0x2: pslld_Pq_Qq();
9525022Sgblack@eecs.umich.edu                    0x3: psllq_Pq_Qq();
9535022Sgblack@eecs.umich.edu                    0x4: pmuludq_Pq_Qq();
9545022Sgblack@eecs.umich.edu                    0x5: pmaddwd_Pq_Qq();
9555022Sgblack@eecs.umich.edu                    0x6: psadbw_Pq_Qq();
9565022Sgblack@eecs.umich.edu                    0x7: maskmovq_Pq_PRq();
9575022Sgblack@eecs.umich.edu                    default: Inst::UD2();
9585022Sgblack@eecs.umich.edu                }
9595022Sgblack@eecs.umich.edu                // operand size (0x66)
9605022Sgblack@eecs.umich.edu                0x1: decode OPCODE_OP_BOTTOM3 {
9615022Sgblack@eecs.umich.edu                    0x1: psllw_Vo_Wo();
9625022Sgblack@eecs.umich.edu                    0x2: pslld_Vo_Wo();
9635022Sgblack@eecs.umich.edu                    0x3: psllq_Vo_Wo();
9645022Sgblack@eecs.umich.edu                    0x4: pmuludq_Vo_Wo();
9655022Sgblack@eecs.umich.edu                    0x5: pmaddwd_Vo_Wo();
9665022Sgblack@eecs.umich.edu                    0x6: psadbw_Vo_Wo();
9675022Sgblack@eecs.umich.edu                    0x7: maskmovdqu_Vo_VRo();
9685022Sgblack@eecs.umich.edu                    default: Inst::UD2();
9695022Sgblack@eecs.umich.edu                }
9705022Sgblack@eecs.umich.edu                // repne (0xF2)
9715022Sgblack@eecs.umich.edu                0x8: decode OPCODE_OP_BOTTOM3 {
9725022Sgblack@eecs.umich.edu                    0x0: lddqu_Vo_Mo();
9735022Sgblack@eecs.umich.edu                    default: Inst::UD2();
9745022Sgblack@eecs.umich.edu                }
9755022Sgblack@eecs.umich.edu                default: Inst::UD2();
9764276Sgblack@eecs.umich.edu            }
9775020Sgblack@eecs.umich.edu            0x1F: decode LEGACY_DECODEVAL {
9785020Sgblack@eecs.umich.edu                // no prefix
9795020Sgblack@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
9805020Sgblack@eecs.umich.edu                    0x0: psubb_Pq_Qq();
9815020Sgblack@eecs.umich.edu                    0x1: psubw_Pq_Qq();
9825020Sgblack@eecs.umich.edu                    0x2: psubd_Pq_Qq();
9835020Sgblack@eecs.umich.edu                    0x3: psubq_Pq_Qq();
9845020Sgblack@eecs.umich.edu                    0x4: paddb_Pq_Qq();
9855020Sgblack@eecs.umich.edu                    0x5: paddw_Pq_Qq();
9865020Sgblack@eecs.umich.edu                    0x6: paddd_Pq_Qq();
9875020Sgblack@eecs.umich.edu                    0x7: Inst::UD2();
9885020Sgblack@eecs.umich.edu                }
9895020Sgblack@eecs.umich.edu                // operand size (0x66)
9905020Sgblack@eecs.umich.edu                0x1: decode OPCODE_OP_BOTTOM3 {
9915020Sgblack@eecs.umich.edu                    0x0: psubb_Vo_Wo();
9925020Sgblack@eecs.umich.edu                    0x1: psubw_Vo_Wo();
9935020Sgblack@eecs.umich.edu                    0x2: psubd_Vo_Wo();
9945020Sgblack@eecs.umich.edu                    0x3: psubq_Vo_Wo();
9955020Sgblack@eecs.umich.edu                    0x4: paddb_Vo_Wo();
9965020Sgblack@eecs.umich.edu                    0x5: paddw_Vo_Wo();
9975020Sgblack@eecs.umich.edu                    0x6: paddd_Vo_Wo();
9985020Sgblack@eecs.umich.edu                    0x7: Inst::UD2();
9995020Sgblack@eecs.umich.edu                }
10005020Sgblack@eecs.umich.edu                default: Inst::UD2();
10014276Sgblack@eecs.umich.edu            }
10024276Sgblack@eecs.umich.edu            default: FailUnimpl::twoByteOps();
10034276Sgblack@eecs.umich.edu        }
10044276Sgblack@eecs.umich.edu    }
10054276Sgblack@eecs.umich.edu    default: M5InternalError::error(
10064276Sgblack@eecs.umich.edu        {{"Unexpected first opcode byte in two byte opcode!"}});
10074276Sgblack@eecs.umich.edu}
1008