two_byte_opcodes.isa revision 6586
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();
965937Sgblack@eecs.umich.edu                    0x2: Inst::LLDT(Ew);
975902Sgblack@eecs.umich.edu                    0x3: Inst::LTR(Ew);
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                        }
1286055Sgblack@eecs.umich.edu                        0x4: Inst::SMSW(Rv);
1296054Sgblack@eecs.umich.edu                        0x6: Inst::LMSW(Rv);
1305238Sgblack@eecs.umich.edu                        0x7: decode MODRM_RM {
1315683Sgblack@eecs.umich.edu                            0x0: Inst::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                        }
1586055Sgblack@eecs.umich.edu                        0x4: Inst::SMSW(Mw);
1596054Sgblack@eecs.umich.edu                        0x6: Inst::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();
1665789Sgblack@eecs.umich.edu                // sandpile.org doesn't seem to know what this is...? We'll
1675789Sgblack@eecs.umich.edu                // use it for pseudo instructions. We've got 16 bits of space
1685789Sgblack@eecs.umich.edu                // to play with so there can be quite a few pseudo
1695789Sgblack@eecs.umich.edu                // instructions.
1705789Sgblack@eecs.umich.edu                //0x04: loadall_or_reset_or_hang();
1715789Sgblack@eecs.umich.edu                0x4: decode IMMEDIATE {
1725789Sgblack@eecs.umich.edu                    format BasicOperate {
1735789Sgblack@eecs.umich.edu#if FULL_SYSTEM
1745789Sgblack@eecs.umich.edu                        0x00: m5arm({{
1755789Sgblack@eecs.umich.edu                            PseudoInst::arm(xc->tcBase());
1765789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
1775789Sgblack@eecs.umich.edu                        0x01: m5quiesce({{
1785789Sgblack@eecs.umich.edu                            PseudoInst::quiesce(xc->tcBase());
1795789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
1805789Sgblack@eecs.umich.edu                        0x02: m5quiesceNs({{
1815789Sgblack@eecs.umich.edu                            PseudoInst::quiesceNs(xc->tcBase(), Rdi);
1825789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
1835789Sgblack@eecs.umich.edu                        0x03: m5quiesceCycle({{
1845789Sgblack@eecs.umich.edu                            PseudoInst::quiesceCycles(xc->tcBase(), Rdi);
1855789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
1865789Sgblack@eecs.umich.edu                        0x04: m5quiesceTime({{
1875789Sgblack@eecs.umich.edu                            Rax = PseudoInst::quiesceTime(xc->tcBase());
1885789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
1895789Sgblack@eecs.umich.edu#endif
1905789Sgblack@eecs.umich.edu                        0x07: m5rpns({{
1915789Sgblack@eecs.umich.edu                            Rax = PseudoInst::rpns(xc->tcBase());
1925789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
1935789Sgblack@eecs.umich.edu                        0x21: m5exit({{
1945789Sgblack@eecs.umich.edu                            PseudoInst::m5exit(xc->tcBase(), Rdi);
1955789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
1965789Sgblack@eecs.umich.edu#if FULL_SYSTEM
1975789Sgblack@eecs.umich.edu                        0x30: m5initparam({{
1985789Sgblack@eecs.umich.edu                            Rax = xc->tcBase()->getCpuPtr()->
1995789Sgblack@eecs.umich.edu                                      system->init_param;
2005789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
2015789Sgblack@eecs.umich.edu                        0x31: m5loadsymbol({{
2025789Sgblack@eecs.umich.edu                            PseudoInst::loadsymbol(xc->tcBase());
2035789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
2045789Sgblack@eecs.umich.edu#endif
2055789Sgblack@eecs.umich.edu                        0x40: m5resetstats({{
2065789Sgblack@eecs.umich.edu                            PseudoInst::resetstats(xc->tcBase(), Rdi, Rsi);
2075789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
2085789Sgblack@eecs.umich.edu                        0x41: m5dumpstats({{
2095789Sgblack@eecs.umich.edu                            PseudoInst::dumpstats(xc->tcBase(), Rdi, Rsi);
2105789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
2115789Sgblack@eecs.umich.edu                        0x42: m5dumpresetstats({{
2125789Sgblack@eecs.umich.edu                            PseudoInst::dumpresetstats(xc->tcBase(), Rdi, Rsi);
2135789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
2145789Sgblack@eecs.umich.edu                        0x43: m5checkpoint({{
2155789Sgblack@eecs.umich.edu                            PseudoInst::m5checkpoint(xc->tcBase(), Rdi, Rsi);
2165789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
2175789Sgblack@eecs.umich.edu#if FULL_SYSTEM
2185789Sgblack@eecs.umich.edu                        0x50: m5readfile({{
2195789Sgblack@eecs.umich.edu                            Rax = PseudoInst::readfile(
2205789Sgblack@eecs.umich.edu                                xc->tcBase(), Rdi, Rsi, Rdx);
2215789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
2225789Sgblack@eecs.umich.edu#endif
2235789Sgblack@eecs.umich.edu                        0x51: m5debugbreak({{
2245789Sgblack@eecs.umich.edu                            PseudoInst::debugbreak(xc->tcBase());
2255789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
2265789Sgblack@eecs.umich.edu                        0x52: m5switchcpu({{
2275789Sgblack@eecs.umich.edu                            PseudoInst::switchcpu(xc->tcBase());
2285789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
2295789Sgblack@eecs.umich.edu#if FULL_SYSTEM
2305789Sgblack@eecs.umich.edu                        0x53: m5addsymbol({{
2315789Sgblack@eecs.umich.edu                            PseudoInst::addsymbol(xc->tcBase(), Rdi, Rsi);
2325789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
2335789Sgblack@eecs.umich.edu#endif
2345789Sgblack@eecs.umich.edu                        0x54: m5panic({{
2355789Sgblack@eecs.umich.edu                            panic("M5 panic instruction called at pc=%#x.\n",
2365789Sgblack@eecs.umich.edu                                xc->readPC());
2375789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
2385789Sgblack@eecs.umich.edu                        0x55: m5reserved1({{
2395789Sgblack@eecs.umich.edu                            warn("M5 reserved opcode 1 ignored.\n");
2405789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
2415789Sgblack@eecs.umich.edu                        0x56: m5reserved2({{
2425789Sgblack@eecs.umich.edu                            warn("M5 reserved opcode 2 ignored.\n");
2435789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
2445789Sgblack@eecs.umich.edu                        0x57: m5reserved3({{
2455789Sgblack@eecs.umich.edu                            warn("M5 reserved opcode 3 ignored.\n");
2465789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
2475789Sgblack@eecs.umich.edu                        0x58: m5reserved4({{
2485789Sgblack@eecs.umich.edu                            warn("M5 reserved opcode 4 ignored.\n");
2495789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
2505789Sgblack@eecs.umich.edu                        0x59: m5reserved5({{
2515789Sgblack@eecs.umich.edu                            warn("M5 reserved opcode 5 ignored.\n");
2525789Sgblack@eecs.umich.edu                        }}, IsNonSpeculative);
2535789Sgblack@eecs.umich.edu                        default: Inst::UD2();
2545789Sgblack@eecs.umich.edu                    }
2555789Sgblack@eecs.umich.edu                }
2564712Sgblack@eecs.umich.edu#if FULL_SYSTEM
2575907Sgblack@eecs.umich.edu                0x05: decode MODE_MODE {
2585907Sgblack@eecs.umich.edu                    0x0: decode MODE_SUBMODE {
2595907Sgblack@eecs.umich.edu                        0x0: Inst::SYSCALL_64();
2605907Sgblack@eecs.umich.edu                        0x1: Inst::SYSCALL_COMPAT();
2615907Sgblack@eecs.umich.edu                    }
2625907Sgblack@eecs.umich.edu                    0x1: Inst::SYSCALL_LEGACY();
2635907Sgblack@eecs.umich.edu                }
2644712Sgblack@eecs.umich.edu#else
2655659Sgblack@eecs.umich.edu                0x05: SyscallInst::syscall('xc->syscall(Rax)', IsSyscall);
2664712Sgblack@eecs.umich.edu#endif
2675933Sgblack@eecs.umich.edu                0x06: Inst::CLTS();
2685908Sgblack@eecs.umich.edu                0x07: decode MODE_SUBMODE {
2695908Sgblack@eecs.umich.edu                    0x0: decode OPSIZE {
2705908Sgblack@eecs.umich.edu                        // Return to 64 bit mode.
2715908Sgblack@eecs.umich.edu                        0x8: Inst::SYSRET_TO_64();
2725908Sgblack@eecs.umich.edu                        // Return to compatibility mode.
2735908Sgblack@eecs.umich.edu                        default: Inst::SYSRET_TO_COMPAT();
2745908Sgblack@eecs.umich.edu                    }
2755908Sgblack@eecs.umich.edu                    default: Inst::SYSRET_NON_64();
2765908Sgblack@eecs.umich.edu                }
2774276Sgblack@eecs.umich.edu            }
2784276Sgblack@eecs.umich.edu            0x01: decode OPCODE_OP_BOTTOM3 {
2794712Sgblack@eecs.umich.edu                0x0: invd();
2804712Sgblack@eecs.umich.edu                0x1: wbinvd();
2814730Sgblack@eecs.umich.edu                0x2: Inst::UD2();
2824760Sgblack@eecs.umich.edu                0x3: Inst::UD2();
2834730Sgblack@eecs.umich.edu                0x4: Inst::UD2();
2845920Sgblack@eecs.umich.edu                0x5: Inst::PREFETCH(Mb);
2855422Sgblack@eecs.umich.edu                0x6: FailUnimpl::femms();
2865422Sgblack@eecs.umich.edu                0x7: FailUnimpl::threednow();
2874276Sgblack@eecs.umich.edu            }
2886576Sgblack@eecs.umich.edu            format Inst{
2896576Sgblack@eecs.umich.edu                0x02: decode LEGACY_DECODEVAL {
2906576Sgblack@eecs.umich.edu                    // no prefix
2916576Sgblack@eecs.umich.edu                    0x0: decode OPCODE_OP_BOTTOM3 {
2926576Sgblack@eecs.umich.edu                        0x0: MOVUPS(Vo,Wo);
2936576Sgblack@eecs.umich.edu                        0x1: MOVUPS(Wo,Vo);
2946576Sgblack@eecs.umich.edu                        0x2: decode MODRM_MOD {
2956576Sgblack@eecs.umich.edu                            0x3: MOVHLPS(Vq,VRq);
2966576Sgblack@eecs.umich.edu                            default: MOVLPS(Vq,Mq);
2976576Sgblack@eecs.umich.edu                        }
2986576Sgblack@eecs.umich.edu                        0x3: MOVLPS(Mq,Vq);
2996576Sgblack@eecs.umich.edu                        0x4: UNPCKLPS(Vps,Wq);
3006576Sgblack@eecs.umich.edu                        0x5: UNPCKHPS(Vpd,Wq);
3016576Sgblack@eecs.umich.edu                        0x6: decode MODRM_MOD {
3026576Sgblack@eecs.umich.edu                            0x3: MOVLHPS(Vq,VRq);
3036576Sgblack@eecs.umich.edu                            default: MOVHPS(Vq,Mq);
3046576Sgblack@eecs.umich.edu                        }
3056576Sgblack@eecs.umich.edu                        0x7: MOVHPS(Mq,Vq);
3065020Sgblack@eecs.umich.edu                    }
3076576Sgblack@eecs.umich.edu                    // repe (0xF3)
3086576Sgblack@eecs.umich.edu                    0x4: decode OPCODE_OP_BOTTOM3 {
3096576Sgblack@eecs.umich.edu                        0x0: WarnUnimpl::movss_Vd_Wd();
3106576Sgblack@eecs.umich.edu                        0x1: WarnUnimpl::movss_Wd_Vd();
3116576Sgblack@eecs.umich.edu                        0x2: WarnUnimpl::movsldup_Vo_Wo();
3126576Sgblack@eecs.umich.edu                        0x6: WarnUnimpl::movshdup_Vo_Wo();
3136576Sgblack@eecs.umich.edu                        default: UD2();
3145020Sgblack@eecs.umich.edu                    }
3156576Sgblack@eecs.umich.edu                    // operand size (0x66)
3166576Sgblack@eecs.umich.edu                    0x1: decode OPCODE_OP_BOTTOM3 {
3176576Sgblack@eecs.umich.edu                        0x0: MOVUPD(Vo,Wo);
3186576Sgblack@eecs.umich.edu                        0x1: MOVUPD(Wo,Vo);
3196576Sgblack@eecs.umich.edu                        0x2: MOVLPD(Vq,Mq);
3206576Sgblack@eecs.umich.edu                        0x3: MOVLPD(Mq,Vq);
3216576Sgblack@eecs.umich.edu                        0x4: UNPCKLPD(Vo,Wq);
3226576Sgblack@eecs.umich.edu                        0x5: UNPCKHPD(Vo,Wo);
3236576Sgblack@eecs.umich.edu                        0x6: MOVHPD(Vq,Mq);
3246576Sgblack@eecs.umich.edu                        0x7: MOVHPD(Mq,Vq);
3256576Sgblack@eecs.umich.edu                    }
3266576Sgblack@eecs.umich.edu                    // repne (0xF2)
3276576Sgblack@eecs.umich.edu                    0x8: decode OPCODE_OP_BOTTOM3 {
3286576Sgblack@eecs.umich.edu                        0x0: MOVSD(Vq,Wq);
3296576Sgblack@eecs.umich.edu                        0x1: MOVSD(Wq,Vq);
3306576Sgblack@eecs.umich.edu                        0x2: MOVDDUP(Vo,Wq);
3316576Sgblack@eecs.umich.edu                        default: UD2();
3326576Sgblack@eecs.umich.edu                    }
3336576Sgblack@eecs.umich.edu                    default: UD2();
3344760Sgblack@eecs.umich.edu                }
3356576Sgblack@eecs.umich.edu                0x03: decode OPCODE_OP_BOTTOM3 {
3366576Sgblack@eecs.umich.edu                    //group17();
3376576Sgblack@eecs.umich.edu                    0x0: decode MODRM_REG {
3386576Sgblack@eecs.umich.edu                        0x0: WarnUnimpl::prefetch_nta();
3396576Sgblack@eecs.umich.edu                        0x1: PREFETCH_T0(Mb);
3406576Sgblack@eecs.umich.edu                        0x2: WarnUnimpl::prefetch_t1();
3416576Sgblack@eecs.umich.edu                        0x3: WarnUnimpl::prefetch_t2();
3426576Sgblack@eecs.umich.edu                        default: HINT_NOP();
3436576Sgblack@eecs.umich.edu                    }
3446576Sgblack@eecs.umich.edu                    0x1: HINT_NOP();
3456576Sgblack@eecs.umich.edu                    0x2: HINT_NOP();
3466576Sgblack@eecs.umich.edu                    0x3: HINT_NOP();
3476576Sgblack@eecs.umich.edu                    0x4: HINT_NOP();
3486576Sgblack@eecs.umich.edu                    0x5: HINT_NOP();
3496576Sgblack@eecs.umich.edu                    0x6: HINT_NOP();
3506576Sgblack@eecs.umich.edu                    0x7: HINT_NOP();
3514760Sgblack@eecs.umich.edu                }
3526576Sgblack@eecs.umich.edu                0x04: decode LEGACY_DECODEVAL {
3536576Sgblack@eecs.umich.edu                    // no prefix
3546576Sgblack@eecs.umich.edu                    0x0: decode OPCODE_OP_BOTTOM3 {
3556576Sgblack@eecs.umich.edu                        0x0: MOV(Rd,Cd);
3566576Sgblack@eecs.umich.edu                        0x1: MOV(Rd,Dd);
3576576Sgblack@eecs.umich.edu                        0x2: MOV(Cd,Rd);
3586576Sgblack@eecs.umich.edu                        0x3: MOV(Dd,Rd);
3596576Sgblack@eecs.umich.edu                        0x4: WarnUnimpl::mov_Rd_Td();
3606576Sgblack@eecs.umich.edu                        0x6: WarnUnimpl::mov_Td_Rd();
3616576Sgblack@eecs.umich.edu                        default: UD2();
3626576Sgblack@eecs.umich.edu                    }
3636576Sgblack@eecs.umich.edu                    // lock prefix (0xF0)
3646576Sgblack@eecs.umich.edu                    0x2: decode OPCODE_OP_BOTTOM3 {
3656576Sgblack@eecs.umich.edu                        0x0: WarnUnimpl::mov_Rd_CR8D();
3666576Sgblack@eecs.umich.edu                        0x2: WarnUnimpl::mov_CR8D_Rd();
3676576Sgblack@eecs.umich.edu                    }
3686576Sgblack@eecs.umich.edu                    default: UD2();
3694760Sgblack@eecs.umich.edu                }
3704276Sgblack@eecs.umich.edu            }
3715020Sgblack@eecs.umich.edu            0x05: decode LEGACY_DECODEVAL {
3725020Sgblack@eecs.umich.edu                // no prefix
3735020Sgblack@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
3745031Sgblack@eecs.umich.edu                    //These moves should really use size o (octword), but
3755031Sgblack@eecs.umich.edu                    //because they are split in two, they use q (quadword).
3765031Sgblack@eecs.umich.edu                    0x0: Inst::MOVAPS(Vq,Wq);
3775031Sgblack@eecs.umich.edu                    0x1: Inst::MOVAPS(Wq,Vq);
3786563Sgblack@eecs.umich.edu                    0x2: Inst::CVTPI2PS(Vq,Qq);
3795020Sgblack@eecs.umich.edu                    0x3: movntps_Mo_Vo();
3805020Sgblack@eecs.umich.edu                    0x4: cvttps2pi_Pq_Wq();
3815020Sgblack@eecs.umich.edu                    0x5: cvtpS2pi_Pq_Wq();
3825020Sgblack@eecs.umich.edu                    0x6: ucomiss_Vd_Wd();
3835020Sgblack@eecs.umich.edu                    0x7: comiss_Vd_Wd();
3845020Sgblack@eecs.umich.edu                }
3855020Sgblack@eecs.umich.edu                // repe (0xF3)
3865020Sgblack@eecs.umich.edu                0x4: decode OPCODE_OP_BOTTOM3 {
3876563Sgblack@eecs.umich.edu                    0x2: Inst::CVTSI2SS(Vd,Ed);
3885020Sgblack@eecs.umich.edu                    0x4: cvttss2si_Gd_Wd();
3895020Sgblack@eecs.umich.edu                    0x5: cvtss2si_Gd_Wd();
3905020Sgblack@eecs.umich.edu                    default: Inst::UD2();
3915020Sgblack@eecs.umich.edu                }
3925020Sgblack@eecs.umich.edu                // operand size (0x66)
3935020Sgblack@eecs.umich.edu                0x1: decode OPCODE_OP_BOTTOM3 {
3946564Sgblack@eecs.umich.edu                    0x0: Inst::MOVAPD(Vo,Wo);
3956564Sgblack@eecs.umich.edu                    0x1: Inst::MOVAPD(Wo,Vo);
3966563Sgblack@eecs.umich.edu                    0x2: Inst::CVTPI2PD(Vo,Qq);
3975020Sgblack@eecs.umich.edu                    0x3: movntpd_Mo_Vo();
3985020Sgblack@eecs.umich.edu                    0x4: cvttpd2pi_Pq_Wo();
3995020Sgblack@eecs.umich.edu                    0x5: cvtpd2pi_Pq_Wo();
4005058Sgblack@eecs.umich.edu                    0x6: Inst::UCOMISD(Vq,Wq);
4015020Sgblack@eecs.umich.edu                    0x7: comisd_Vq_Wq();
4025020Sgblack@eecs.umich.edu                }
4035020Sgblack@eecs.umich.edu                // repne (0xF2)
4045020Sgblack@eecs.umich.edu                0x8: decode OPCODE_OP_BOTTOM3 {
4055046Sgblack@eecs.umich.edu                    // The size of the V operand should be q, not dp
4065046Sgblack@eecs.umich.edu                    0x2: Inst::CVTSI2SD(Vdp,Edp);
4075046Sgblack@eecs.umich.edu                    // The size of the W operand should be q, not dp
4085046Sgblack@eecs.umich.edu                    0x4: Inst::CVTTSD2SI(Gdp,Wdp);
4095020Sgblack@eecs.umich.edu                    0x5: cvtsd2si_Gd_Wq();
4105020Sgblack@eecs.umich.edu                    default: Inst::UD2();
4115020Sgblack@eecs.umich.edu                }
4125020Sgblack@eecs.umich.edu                default: Inst::UD2();
4134276Sgblack@eecs.umich.edu            }
4144276Sgblack@eecs.umich.edu            0x06: decode OPCODE_OP_BOTTOM3 {
4155149Sgblack@eecs.umich.edu                0x0: Inst::WRMSR();
4165409Sgblack@eecs.umich.edu                0x1: Inst::RDTSC();
4175149Sgblack@eecs.umich.edu                0x2: Inst::RDMSR();
4184712Sgblack@eecs.umich.edu                0x3: rdpmc();
4195972Sgblack@eecs.umich.edu#if FULL_SYSTEM
4204712Sgblack@eecs.umich.edu                0x4: sysenter();
4215972Sgblack@eecs.umich.edu#else
4225972Sgblack@eecs.umich.edu                0x4: SyscallInst::sysenter('xc->syscall(Rax)', IsSyscall);
4235972Sgblack@eecs.umich.edu#endif
4244712Sgblack@eecs.umich.edu                0x5: sysexit();
4254730Sgblack@eecs.umich.edu                0x6: Inst::UD2();
4264712Sgblack@eecs.umich.edu                0x7: getsec();
4274276Sgblack@eecs.umich.edu            }
4284276Sgblack@eecs.umich.edu            0x07: decode OPCODE_OP_BOTTOM3 {
4294712Sgblack@eecs.umich.edu                0x0: three_byte_opcode();
4304712Sgblack@eecs.umich.edu                0x1: three_byte_opcode();
4314712Sgblack@eecs.umich.edu                0x2: three_byte_opcode();
4324712Sgblack@eecs.umich.edu                0x3: three_byte_opcode();
4334712Sgblack@eecs.umich.edu                0x4: three_byte_opcode();
4344712Sgblack@eecs.umich.edu                0x5: three_byte_opcode();
4354712Sgblack@eecs.umich.edu                0x6: three_byte_opcode();
4364712Sgblack@eecs.umich.edu                0x7: three_byte_opcode();
4374276Sgblack@eecs.umich.edu            }
4384760Sgblack@eecs.umich.edu            format Inst {
4394760Sgblack@eecs.umich.edu                0x08: decode OPCODE_OP_BOTTOM3 {
4404760Sgblack@eecs.umich.edu                    0x0: CMOVO(Gv,Ev);
4414760Sgblack@eecs.umich.edu                    0x1: CMOVNO(Gv,Ev);
4424760Sgblack@eecs.umich.edu                    0x2: CMOVB(Gv,Ev);
4434760Sgblack@eecs.umich.edu                    0x3: CMOVNB(Gv,Ev);
4444760Sgblack@eecs.umich.edu                    0x4: CMOVZ(Gv,Ev);
4454760Sgblack@eecs.umich.edu                    0x5: CMOVNZ(Gv,Ev);
4464760Sgblack@eecs.umich.edu                    0x6: CMOVBE(Gv,Ev);
4474760Sgblack@eecs.umich.edu                    0x7: CMOVNBE(Gv,Ev);
4484760Sgblack@eecs.umich.edu                }
4494760Sgblack@eecs.umich.edu                0x09: decode OPCODE_OP_BOTTOM3 {
4504760Sgblack@eecs.umich.edu                    0x0: CMOVS(Gv,Ev);
4514760Sgblack@eecs.umich.edu                    0x1: CMOVNS(Gv,Ev);
4524760Sgblack@eecs.umich.edu                    0x2: CMOVP(Gv,Ev);
4534760Sgblack@eecs.umich.edu                    0x3: CMOVNP(Gv,Ev);
4544760Sgblack@eecs.umich.edu                    0x4: CMOVL(Gv,Ev);
4554760Sgblack@eecs.umich.edu                    0x5: CMOVNL(Gv,Ev);
4564760Sgblack@eecs.umich.edu                    0x6: CMOVLE(Gv,Ev);
4574760Sgblack@eecs.umich.edu                    0x7: CMOVNLE(Gv,Ev);
4584760Sgblack@eecs.umich.edu                }
4596576Sgblack@eecs.umich.edu                0x0A: decode LEGACY_DECODEVAL {
4606576Sgblack@eecs.umich.edu                    // no prefix
4616576Sgblack@eecs.umich.edu                    0x0: decode OPCODE_OP_BOTTOM3 {
4626576Sgblack@eecs.umich.edu                        0x0: WarnUnimpl::movmskps_Gd_VRo();
4636576Sgblack@eecs.umich.edu                        0x1: SQRTPS(Vo,Wo);
4646576Sgblack@eecs.umich.edu                        0x2: WarnUnimpl::rqsrtps_Vo_Wo();
4656576Sgblack@eecs.umich.edu                        0x3: WarnUnimpl::rcpps_Vo_Wo();
4666576Sgblack@eecs.umich.edu                        0x4: ANDPS(Vo,Wo);
4676576Sgblack@eecs.umich.edu                        0x5: ANDNPS(Vo,Wo);
4686576Sgblack@eecs.umich.edu                        0x6: ORPS(Vo,Wo);
4696576Sgblack@eecs.umich.edu                        0x7: XORPS(Vo,Wo);
4706576Sgblack@eecs.umich.edu                    }
4716576Sgblack@eecs.umich.edu                    // repe (0xF3)
4726576Sgblack@eecs.umich.edu                    0x4: decode OPCODE_OP_BOTTOM3 {
4736576Sgblack@eecs.umich.edu                        0x1: SQRTSS(Vd,Wd);
4746576Sgblack@eecs.umich.edu                        0x2: WarnUnimpl::rsqrtss_Vd_Wd();
4756576Sgblack@eecs.umich.edu                        0x3: WarnUnimpl::rcpss_Vd_Wd();
4766576Sgblack@eecs.umich.edu                        default: UD2();
4776576Sgblack@eecs.umich.edu                    }
4786576Sgblack@eecs.umich.edu                    // operand size (0x66)
4796576Sgblack@eecs.umich.edu                    0x1: decode OPCODE_OP_BOTTOM3 {
4806576Sgblack@eecs.umich.edu                        0x0: WarnUnimpl::movmskpd_Gd_VRo();
4816576Sgblack@eecs.umich.edu                        0x1: SQRTPD(Vo,Wo);
4826576Sgblack@eecs.umich.edu                        0x4: ANDPD(Vo,Wo);
4836576Sgblack@eecs.umich.edu                        0x5: ANDNPD(Vo,Wo);
4846576Sgblack@eecs.umich.edu                        0x6: ORPD(Vo,Wo);
4856576Sgblack@eecs.umich.edu                        //This really should be type o, but it works on q sized
4866576Sgblack@eecs.umich.edu                        //chunks at a time.
4876576Sgblack@eecs.umich.edu                        0x7: XORPD(Vq,Wq);
4886576Sgblack@eecs.umich.edu                        default: UD2();
4896576Sgblack@eecs.umich.edu                    }
4905059Sgblack@eecs.umich.edu                    // repne (0xF2)
4915059Sgblack@eecs.umich.edu                    0x8: decode OPCODE_OP_BOTTOM3 {
4926576Sgblack@eecs.umich.edu                        0x1: SQRTSD(Vq,Wq);
4935059Sgblack@eecs.umich.edu                        default: UD2();
4945059Sgblack@eecs.umich.edu                    }
4955059Sgblack@eecs.umich.edu                    default: UD2();
4965020Sgblack@eecs.umich.edu                }
4976576Sgblack@eecs.umich.edu                0x0B: decode LEGACY_DECODEVAL {
4986576Sgblack@eecs.umich.edu                    // no prefix
4996576Sgblack@eecs.umich.edu                    0x0: decode OPCODE_OP_BOTTOM3 {
5006576Sgblack@eecs.umich.edu                        0x0: ADDPS(Vo,Wo);
5016576Sgblack@eecs.umich.edu                        0x1: MULPS(Vo,Wo);
5026576Sgblack@eecs.umich.edu                        0x2: CVTPS2PD(Vo,Wq);
5036576Sgblack@eecs.umich.edu                        0x3: CVTDQ2PS(Vo,Wo);
5046576Sgblack@eecs.umich.edu                        0x4: SUBPS(Vo,Wo);
5056576Sgblack@eecs.umich.edu                        0x5: MINPS(Vo,Wo);
5066576Sgblack@eecs.umich.edu                        0x6: DIVPS(Vo,Wo);
5076576Sgblack@eecs.umich.edu                        0x7: MAXPS(Vo,Wo);
5086576Sgblack@eecs.umich.edu                    }
5096576Sgblack@eecs.umich.edu                    // repe (0xF3)
5106576Sgblack@eecs.umich.edu                    0x4: decode OPCODE_OP_BOTTOM3 {
5116576Sgblack@eecs.umich.edu                        0x0: ADDSS(Vd,Wd);
5126576Sgblack@eecs.umich.edu                        0x1: MULSS(Vd,Wd);
5136576Sgblack@eecs.umich.edu                        0x2: CVTSS2SD(Vq,Wd);
5146576Sgblack@eecs.umich.edu                        0x3: WarnUnimpl::cvttps2dq_Vo_Wo();
5156576Sgblack@eecs.umich.edu                        0x4: SUBSS(Vd,Wd);
5166576Sgblack@eecs.umich.edu                        0x5: MINSS(Vd,Wd);
5176576Sgblack@eecs.umich.edu                        0x6: DIVSS(Vd,Wd);
5186576Sgblack@eecs.umich.edu                        0x7: MAXSS(Vd,Wd);
5196576Sgblack@eecs.umich.edu                    }
5206576Sgblack@eecs.umich.edu                    // operand size (0x66)
5216576Sgblack@eecs.umich.edu                    0x1: decode OPCODE_OP_BOTTOM3 {
5226576Sgblack@eecs.umich.edu                        0x0: ADDPD(Vo,Wo);
5236576Sgblack@eecs.umich.edu                        0x1: MULPD(Vo,Wo);
5246576Sgblack@eecs.umich.edu                        0x2: CVTPD2PS(Vo,Wo);
5256576Sgblack@eecs.umich.edu                        0x3: WarnUnimpl::cvtps2dq_Vo_Wo();
5266576Sgblack@eecs.umich.edu                        0x4: SUBPD(Vo,Wo);
5276576Sgblack@eecs.umich.edu                        0x5: MINPD(Vo,Wo);
5286576Sgblack@eecs.umich.edu                        0x6: DIVPD(Vo,Wo);
5296576Sgblack@eecs.umich.edu                        0x7: MAXPD(Vo,Wo);
5306576Sgblack@eecs.umich.edu                    }
5316576Sgblack@eecs.umich.edu                    // repne (0xF2)
5326576Sgblack@eecs.umich.edu                    0x8: decode OPCODE_OP_BOTTOM3 {
5336576Sgblack@eecs.umich.edu                        0x0: ADDSD(Vq,Wq);
5346576Sgblack@eecs.umich.edu                        0x1: MULSD(Vq,Wq);
5356576Sgblack@eecs.umich.edu                        0x2: CVTSD2SS(Vd,Wq);
5366576Sgblack@eecs.umich.edu                        0x4: SUBSD(Vq,Wq);
5376576Sgblack@eecs.umich.edu                        0x5: MINSD(Vq,Wq);
5386576Sgblack@eecs.umich.edu                        0x6: DIVSD(Vq,Wq);
5396576Sgblack@eecs.umich.edu                        0x7: MAXSD(Vq,Wq);
5406576Sgblack@eecs.umich.edu                        default: UD2();
5416576Sgblack@eecs.umich.edu                    }
5426576Sgblack@eecs.umich.edu                    default: UD2();
5435020Sgblack@eecs.umich.edu                }
5446576Sgblack@eecs.umich.edu                0x0C: decode LEGACY_DECODEVAL {
5456576Sgblack@eecs.umich.edu                    // no prefix
5466576Sgblack@eecs.umich.edu                    0x0: decode OPCODE_OP_BOTTOM3 {
5476576Sgblack@eecs.umich.edu                        0x0: PUNPCKLBW(Pq,Qd);
5486576Sgblack@eecs.umich.edu                        0x1: PUNPCKLWD(Pq,Qd);
5496576Sgblack@eecs.umich.edu                        0x2: PUNPCKLDQ(Pq,Qd);
5506576Sgblack@eecs.umich.edu                        0x3: PACKSSWB(Pq,Qq);
5516576Sgblack@eecs.umich.edu                        0x4: PCMPGTB(Pq,Qq);
5526576Sgblack@eecs.umich.edu                        0x5: PCMPGTW(Pq,Qq);
5536576Sgblack@eecs.umich.edu                        0x6: PCMPGTD(Pq,Qq);
5546576Sgblack@eecs.umich.edu                        0x7: PACKUSWB(Pq,Qq);
5556576Sgblack@eecs.umich.edu                    }
5566576Sgblack@eecs.umich.edu                    // operand size (0x66)
5576576Sgblack@eecs.umich.edu                    0x1: decode OPCODE_OP_BOTTOM3 {
5586576Sgblack@eecs.umich.edu                        0x0: PUNPCKLBW(Vo,Wq);
5596576Sgblack@eecs.umich.edu                        0x1: PUNPCKLWD(Vo,Wq);
5606576Sgblack@eecs.umich.edu                        0x2: PUNPCKLDQ(Vo,Wq);
5616576Sgblack@eecs.umich.edu                        0x3: PACKSSWB(Vo,Wo);
5626576Sgblack@eecs.umich.edu                        0x4: PCMPGTB(Vo,Wo);
5636576Sgblack@eecs.umich.edu                        0x5: PCMPGTW(Vo,Wo);
5646576Sgblack@eecs.umich.edu                        0x6: PCMPGTD(Vo,Wo);
5656576Sgblack@eecs.umich.edu                        0x7: PACKUSWB(Vo,Wo);
5666576Sgblack@eecs.umich.edu                    }
5676576Sgblack@eecs.umich.edu                    default: UD2();
5685020Sgblack@eecs.umich.edu                }
5696576Sgblack@eecs.umich.edu                0x0D: decode LEGACY_DECODEVAL {
5706576Sgblack@eecs.umich.edu                    // no prefix
5716576Sgblack@eecs.umich.edu                    0x0: decode OPCODE_OP_BOTTOM3 {
5726576Sgblack@eecs.umich.edu                        0x0: PUNPCKHBW(Pq,Qq);
5736576Sgblack@eecs.umich.edu                        0x1: PUNPCKHWD(Pq,Qq);
5746576Sgblack@eecs.umich.edu                        0x2: PUNPCKHDQ(Pq,Qq);
5756576Sgblack@eecs.umich.edu                        0x3: PACKSSDW(Pq,Qq);
5766576Sgblack@eecs.umich.edu                        0x6: MOVD(Pq,Edp);
5776576Sgblack@eecs.umich.edu                        0x7: MOVQ(Pq,Qq);
5786576Sgblack@eecs.umich.edu                        default: UD2();
5796576Sgblack@eecs.umich.edu                    }
5806576Sgblack@eecs.umich.edu                    // repe (0xF3)
5816576Sgblack@eecs.umich.edu                    0x4: decode OPCODE_OP_BOTTOM3 {
5826576Sgblack@eecs.umich.edu                        0x7: WarnUnimpl::movdqu_Vo_Wo();
5836576Sgblack@eecs.umich.edu                        default: UD2();
5846576Sgblack@eecs.umich.edu                    }
5856576Sgblack@eecs.umich.edu                    // operand size (0x66)
5866576Sgblack@eecs.umich.edu                    0x1: decode OPCODE_OP_BOTTOM3 {
5876576Sgblack@eecs.umich.edu                        0x0: PUNPCKHBW(Vo,Wo);
5886576Sgblack@eecs.umich.edu                        0x1: PUNPCKHWD(Vo,Wo);
5896576Sgblack@eecs.umich.edu                        0x2: PUNPCKHDQ(Vo,Wo);
5906576Sgblack@eecs.umich.edu                        0x3: PACKSSDW(Vo,Wo);
5916576Sgblack@eecs.umich.edu                        0x4: PUNPCKLQDQ(Vo,Wq);
5926576Sgblack@eecs.umich.edu                        0x5: PUNPCKHQDQ(Vo,Wq);
5936576Sgblack@eecs.umich.edu                        0x6: WarnUnimpl::movd_Vo_Ed();
5946576Sgblack@eecs.umich.edu                        0x7: WarnUnimpl::movdqa_Vo_Wo();
5956576Sgblack@eecs.umich.edu                    }
5966576Sgblack@eecs.umich.edu                    default: UD2();
5975020Sgblack@eecs.umich.edu                }
5986584Sgblack@eecs.umich.edu                0x0E: decode LEGACY_DECODEVAL {
5996584Sgblack@eecs.umich.edu                    // no prefix
6006584Sgblack@eecs.umich.edu                    0x0: decode OPCODE_OP_BOTTOM3 {
6016584Sgblack@eecs.umich.edu                        0x0: WarnUnimpl::pshufw_Pq_Qq_Ib();
6026584Sgblack@eecs.umich.edu                        //0x1: group13_pshimw();
6036584Sgblack@eecs.umich.edu                        0x1: decode MODRM_REG {
6046584Sgblack@eecs.umich.edu                            0x2: decode LEGACY_OP {
6056584Sgblack@eecs.umich.edu                                0x0: PSRLW(PRq,Ib);
6066584Sgblack@eecs.umich.edu                                0x1: PSRLW(VRo,Ib);
6076584Sgblack@eecs.umich.edu                            }
6086584Sgblack@eecs.umich.edu                            0x4: decode LEGACY_OP {
6096584Sgblack@eecs.umich.edu                                0x0: PSRAW(PRq,Ib);
6106584Sgblack@eecs.umich.edu                                0x1: PSRAW(VRo,Ib);
6116584Sgblack@eecs.umich.edu                            }
6126584Sgblack@eecs.umich.edu                            0x6: decode LEGACY_OP {
6136584Sgblack@eecs.umich.edu                                0x0: PSLLW(PRq,Ib);
6146584Sgblack@eecs.umich.edu                                0x1: PSLLW(VRo,Ib);
6156584Sgblack@eecs.umich.edu                            }
6166584Sgblack@eecs.umich.edu                            default: UD2();
6175238Sgblack@eecs.umich.edu                        }
6186584Sgblack@eecs.umich.edu                        //0x2: group14_pshimd();
6196584Sgblack@eecs.umich.edu                        0x2: decode MODRM_REG {
6206584Sgblack@eecs.umich.edu                            0x2: decode LEGACY_OP {
6216584Sgblack@eecs.umich.edu                                0x0: PSRLD(PRq,Ib);
6226584Sgblack@eecs.umich.edu                                0x1: PSRLD(VRo,Ib);
6236584Sgblack@eecs.umich.edu                            }
6246584Sgblack@eecs.umich.edu                            0x4: decode LEGACY_OP {
6256584Sgblack@eecs.umich.edu                                0x0: PSRAD(PRq,Ib);
6266584Sgblack@eecs.umich.edu                                0x1: PSRAD(VRo,Ib);
6276584Sgblack@eecs.umich.edu                            }
6286584Sgblack@eecs.umich.edu                            0x6: decode LEGACY_OP {
6296584Sgblack@eecs.umich.edu                                0x0: PSLLD(PRq,Ib);
6306584Sgblack@eecs.umich.edu                                0x1: PSLLD(VRo,Ib);
6316584Sgblack@eecs.umich.edu                            }
6326584Sgblack@eecs.umich.edu                            default: UD2();
6335238Sgblack@eecs.umich.edu                        }
6346584Sgblack@eecs.umich.edu                        //0x3: group15_pshimq();
6356584Sgblack@eecs.umich.edu                        0x3: decode MODRM_REG {
6366584Sgblack@eecs.umich.edu                            0x2: decode LEGACY_OP {
6376584Sgblack@eecs.umich.edu                                0x0: PSRLQ(PRq,Ib);
6386584Sgblack@eecs.umich.edu                                0x1: PSRLQ(VRo,Ib);
6396584Sgblack@eecs.umich.edu                            }
6406584Sgblack@eecs.umich.edu                            0x3: decode LEGACY_OP {
6416584Sgblack@eecs.umich.edu                                0x0: UD2();
6426584Sgblack@eecs.umich.edu                                0x1: WarnUnimpl::psrldq_VRo_Ib();
6436584Sgblack@eecs.umich.edu                            }
6446584Sgblack@eecs.umich.edu                            0x6: decode LEGACY_OP {
6456584Sgblack@eecs.umich.edu                                0x0: PSLLQ(PRq,Ib);
6466584Sgblack@eecs.umich.edu                                0x1: PSLLQ(VRo,Ib);
6476584Sgblack@eecs.umich.edu                            }
6486584Sgblack@eecs.umich.edu                            0x7: decode LEGACY_OP {
6496584Sgblack@eecs.umich.edu                                0x0: UD2();
6506584Sgblack@eecs.umich.edu                                0x1: WarnUnimpl::pslldq_VRo_Ib();
6516584Sgblack@eecs.umich.edu                            }
6526584Sgblack@eecs.umich.edu                            default: Inst::UD2();
6535238Sgblack@eecs.umich.edu                        }
6546584Sgblack@eecs.umich.edu                        0x4: Inst::PCMPEQB(Pq,Qq);
6556584Sgblack@eecs.umich.edu                        0x5: Inst::PCMPEQW(Pq,Qq);
6566584Sgblack@eecs.umich.edu                        0x6: Inst::PCMPEQD(Pq,Qq);
6576584Sgblack@eecs.umich.edu                        0x7: WarnUnimpl::emms();
6585238Sgblack@eecs.umich.edu                    }
6596584Sgblack@eecs.umich.edu                    // repe (0xF3)
6606584Sgblack@eecs.umich.edu                    0x4: decode OPCODE_OP_BOTTOM3 {
6616584Sgblack@eecs.umich.edu                        0x0: WarnUnimpl::pshufhw_Vo_Wo_Ib();
6626584Sgblack@eecs.umich.edu                        default: UD2();
6636584Sgblack@eecs.umich.edu                    }
6646584Sgblack@eecs.umich.edu                    // operand size (0x66)
6656584Sgblack@eecs.umich.edu                    0x1: decode OPCODE_OP_BOTTOM3 {
6666584Sgblack@eecs.umich.edu                        0x0: WarnUnimpl::pshufd_Vo_Wo_Ib();
6676584Sgblack@eecs.umich.edu                        //0x1: group13_pshimw();
6686584Sgblack@eecs.umich.edu                        0x1: decode MODRM_REG {
6696584Sgblack@eecs.umich.edu                            0x2: decode LEGACY_OP {
6706584Sgblack@eecs.umich.edu                                0x0: PSRLW(PRq,Ib);
6716584Sgblack@eecs.umich.edu                                0x1: PSRLW(VRo,Ib);
6726584Sgblack@eecs.umich.edu                            }
6736584Sgblack@eecs.umich.edu                            0x4: decode LEGACY_OP {
6746584Sgblack@eecs.umich.edu                                0x0: PSRAW(PRq,Ib);
6756584Sgblack@eecs.umich.edu                                0x1: PSRAW(VRo,Ib);
6766584Sgblack@eecs.umich.edu                            }
6776584Sgblack@eecs.umich.edu                            0x6: decode LEGACY_OP {
6786584Sgblack@eecs.umich.edu                                0x0: PSLLW(PRq,Ib);
6796584Sgblack@eecs.umich.edu                                0x1: PSLLW(VRo,Ib);
6806584Sgblack@eecs.umich.edu                            }
6816584Sgblack@eecs.umich.edu                            default: Inst::UD2();
6825238Sgblack@eecs.umich.edu                        }
6836584Sgblack@eecs.umich.edu                        //0x2: group14_pshimd();
6846584Sgblack@eecs.umich.edu                        0x2: decode MODRM_REG {
6856584Sgblack@eecs.umich.edu                            0x2: decode LEGACY_OP {
6866584Sgblack@eecs.umich.edu                                0x0: PSRLD(PRq,Ib);
6876584Sgblack@eecs.umich.edu                                0x1: PSRLD(VRo,Ib);
6886584Sgblack@eecs.umich.edu                            }
6896584Sgblack@eecs.umich.edu                            0x4: decode LEGACY_OP {
6906584Sgblack@eecs.umich.edu                                0x0: PSRAD(PRq,Ib);
6916584Sgblack@eecs.umich.edu                                0x1: PSRAD(VRo,Ib);
6926584Sgblack@eecs.umich.edu                            }
6936584Sgblack@eecs.umich.edu                            0x6: decode LEGACY_OP {
6946584Sgblack@eecs.umich.edu                                0x0: PSLLD(PRq,Ib);
6956584Sgblack@eecs.umich.edu                                0x1: PSLLD(VRo,Ib);
6966584Sgblack@eecs.umich.edu                            }
6976584Sgblack@eecs.umich.edu                            default: UD2();
6985238Sgblack@eecs.umich.edu                        }
6996584Sgblack@eecs.umich.edu                        //0x3: group15_pshimq();
7006584Sgblack@eecs.umich.edu                        0x3: decode MODRM_REG {
7016584Sgblack@eecs.umich.edu                            0x2: decode LEGACY_OP {
7026584Sgblack@eecs.umich.edu                                0x0: PSRLQ(PRq,Ib);
7036584Sgblack@eecs.umich.edu                                0x1: PSRLQ(VRo,Ib);
7046584Sgblack@eecs.umich.edu                            }
7056584Sgblack@eecs.umich.edu                            0x3: decode LEGACY_OP {
7066584Sgblack@eecs.umich.edu                                0x0: UD2();
7076584Sgblack@eecs.umich.edu                                0x1: WarnUnimpl::psrldq_VRo_Ib();
7086584Sgblack@eecs.umich.edu                            }
7096584Sgblack@eecs.umich.edu                            0x6: decode LEGACY_OP {
7106584Sgblack@eecs.umich.edu                                0x0: PSLLQ(PRq,Ib);
7116584Sgblack@eecs.umich.edu                                0x1: PSLLQ(VRo,Ib);
7126584Sgblack@eecs.umich.edu                            }
7136584Sgblack@eecs.umich.edu                            0x7: decode LEGACY_OP {
7146584Sgblack@eecs.umich.edu                                0x0: UD2();
7156584Sgblack@eecs.umich.edu                                0x1: WarnUnimpl::pslldq_VRo_Ib();
7166584Sgblack@eecs.umich.edu                            }
7176584Sgblack@eecs.umich.edu                            default: UD2();
7185238Sgblack@eecs.umich.edu                        }
7196584Sgblack@eecs.umich.edu                        0x4: PCMPEQB(Vo,Wo);
7206584Sgblack@eecs.umich.edu                        0x5: PCMPEQW(Vo,Wo);
7216584Sgblack@eecs.umich.edu                        0x6: PCMPEQD(Vo,Wo);
7226584Sgblack@eecs.umich.edu                        default: UD2();
7235238Sgblack@eecs.umich.edu                    }
7246584Sgblack@eecs.umich.edu                    // repne (0xF2)
7256584Sgblack@eecs.umich.edu                    0x8: decode OPCODE_OP_BOTTOM3 {
7266584Sgblack@eecs.umich.edu                        0x0: WarnUnimpl::pshuflw_Vo_Wo_Ib();
7276584Sgblack@eecs.umich.edu                        default: UD2();
7285238Sgblack@eecs.umich.edu                    }
7296584Sgblack@eecs.umich.edu                    default: UD2();
7305020Sgblack@eecs.umich.edu                }
7316584Sgblack@eecs.umich.edu                0x0F: decode LEGACY_DECODEVAL {
7326584Sgblack@eecs.umich.edu                    // no prefix
7336584Sgblack@eecs.umich.edu                    0x0: decode OPCODE_OP_BOTTOM3 {
7346584Sgblack@eecs.umich.edu                        0x0: WarnUnimpl::vmread_Ed_or_Eq_Gd_or_Gq();
7356584Sgblack@eecs.umich.edu                        0x1: WarnUnimpl::vmwrite_Gd_or_Gq_Ed_or_Eq();
7366584Sgblack@eecs.umich.edu                        0x6: MOVD(Edp,Pdp);
7376584Sgblack@eecs.umich.edu                        0x7: MOVQ(Qq,Pq);
7386584Sgblack@eecs.umich.edu                        default: UD2();
7396584Sgblack@eecs.umich.edu                    }
7406584Sgblack@eecs.umich.edu                    // repe (0xF3)
7416584Sgblack@eecs.umich.edu                    0x4: decode OPCODE_OP_BOTTOM3 {
7426584Sgblack@eecs.umich.edu                        0x6: MOVQ(Vq,Wq);
7436584Sgblack@eecs.umich.edu                        0x7: WarnUnimpl::movdqu_Wo_Vo();
7446584Sgblack@eecs.umich.edu                        default: UD2();
7456584Sgblack@eecs.umich.edu                    }
7466584Sgblack@eecs.umich.edu                    // operand size (0x66)
7476584Sgblack@eecs.umich.edu                    0x1: decode OPCODE_OP_BOTTOM3 {
7486584Sgblack@eecs.umich.edu                        0x4: WarnUnimpl::haddpd_Vo_Wo();
7496584Sgblack@eecs.umich.edu                        0x5: WarnUnimpl::hsubpd_Vo_Wo();
7506584Sgblack@eecs.umich.edu                        0x6: WarnUnimpl::movd_Ed_Vd();
7516584Sgblack@eecs.umich.edu                        0x7: WarnUnimpl::movdqa_Wo_Vo();
7526584Sgblack@eecs.umich.edu                        default: UD2();
7536584Sgblack@eecs.umich.edu                    }
7546584Sgblack@eecs.umich.edu                    // repne (0xF2)
7556584Sgblack@eecs.umich.edu                    0x8: decode OPCODE_OP_BOTTOM3 {
7566584Sgblack@eecs.umich.edu                        0x4: WarnUnimpl::haddps_Vo_Wo();
7576584Sgblack@eecs.umich.edu                        0x5: WarnUnimpl::hsubps_Vo_Wo();
7586584Sgblack@eecs.umich.edu                        default: UD2();
7596584Sgblack@eecs.umich.edu                    }
7606584Sgblack@eecs.umich.edu                    default: UD2();
7615020Sgblack@eecs.umich.edu                }
7624727Sgblack@eecs.umich.edu                0x10: decode OPCODE_OP_BOTTOM3 {
7634727Sgblack@eecs.umich.edu                    0x0: JO(Jz);
7644727Sgblack@eecs.umich.edu                    0x1: JNO(Jz);
7654727Sgblack@eecs.umich.edu                    0x2: JB(Jz);
7664727Sgblack@eecs.umich.edu                    0x3: JNB(Jz);
7674727Sgblack@eecs.umich.edu                    0x4: JZ(Jz);
7684727Sgblack@eecs.umich.edu                    0x5: JNZ(Jz);
7694727Sgblack@eecs.umich.edu                    0x6: JBE(Jz);
7704727Sgblack@eecs.umich.edu                    0x7: JNBE(Jz);
7714727Sgblack@eecs.umich.edu                }
7724727Sgblack@eecs.umich.edu                0x11: decode OPCODE_OP_BOTTOM3 {
7734727Sgblack@eecs.umich.edu                    0x0: JS(Jz);
7744727Sgblack@eecs.umich.edu                    0x1: JNS(Jz);
7754727Sgblack@eecs.umich.edu                    0x2: JP(Jz);
7764727Sgblack@eecs.umich.edu                    0x3: JNP(Jz);
7774727Sgblack@eecs.umich.edu                    0x4: JL(Jz);
7784727Sgblack@eecs.umich.edu                    0x5: JNL(Jz);
7794727Sgblack@eecs.umich.edu                    0x6: JLE(Jz);
7804727Sgblack@eecs.umich.edu                    0x7: JNLE(Jz);
7814727Sgblack@eecs.umich.edu                }
7824760Sgblack@eecs.umich.edu                0x12: decode OPCODE_OP_BOTTOM3 {
7834760Sgblack@eecs.umich.edu                    0x0: SETO(Eb);
7844760Sgblack@eecs.umich.edu                    0x1: SETNO(Eb);
7854760Sgblack@eecs.umich.edu                    0x2: SETB(Eb);
7864760Sgblack@eecs.umich.edu                    0x3: SETNB(Eb);
7874760Sgblack@eecs.umich.edu                    0x4: SETZ(Eb);
7884760Sgblack@eecs.umich.edu                    0x5: SETNZ(Eb);
7894760Sgblack@eecs.umich.edu                    0x6: SETBE(Eb);
7904760Sgblack@eecs.umich.edu                    0x7: SETNBE(Eb);
7914760Sgblack@eecs.umich.edu                }
7924760Sgblack@eecs.umich.edu                0x13: decode OPCODE_OP_BOTTOM3 {
7934760Sgblack@eecs.umich.edu                    0x0: SETS(Eb);
7944760Sgblack@eecs.umich.edu                    0x1: SETNS(Eb);
7954760Sgblack@eecs.umich.edu                    0x2: SETP(Eb);
7964760Sgblack@eecs.umich.edu                    0x3: SETNP(Eb);
7974760Sgblack@eecs.umich.edu                    0x4: SETL(Eb);
7984760Sgblack@eecs.umich.edu                    0x5: SETNL(Eb);
7994760Sgblack@eecs.umich.edu                    0x6: SETLE(Eb);
8004760Sgblack@eecs.umich.edu                    0x7: SETNLE(Eb);
8014760Sgblack@eecs.umich.edu                }
8024276Sgblack@eecs.umich.edu            }
8034276Sgblack@eecs.umich.edu            0x14: decode OPCODE_OP_BOTTOM3 {
8044712Sgblack@eecs.umich.edu                0x0: push_fs();
8054712Sgblack@eecs.umich.edu                0x1: pop_fs();
8065659Sgblack@eecs.umich.edu                0x2: CPUIDInst::CPUID({{
8075659Sgblack@eecs.umich.edu                    CpuidResult result;
8086052Sgblack@eecs.umich.edu                    success = doCpuid(xc->tcBase(), bits(Rax, 31, 0), result);
8095659Sgblack@eecs.umich.edu                    Rax = result.rax;
8105659Sgblack@eecs.umich.edu                    Rbx = result.rbx;
8115659Sgblack@eecs.umich.edu                    Rcx = result.rcx;
8125659Sgblack@eecs.umich.edu                    Rdx = result.rdx;
8135659Sgblack@eecs.umich.edu                    }});
8145240Sgblack@eecs.umich.edu                0x3: Inst::BT(Ev,Gv);
8156480Sgblack@eecs.umich.edu                0x4: Inst::SHLD(Ev,Gv,Ib);
8166480Sgblack@eecs.umich.edu                0x5: Inst::SHLD(Ev,Gv);
8174712Sgblack@eecs.umich.edu                0x6: xbts_and_cmpxchg();
8184712Sgblack@eecs.umich.edu                0x7: ibts_and_cmpxchg();
8194276Sgblack@eecs.umich.edu            }
8204276Sgblack@eecs.umich.edu            0x15: decode OPCODE_OP_BOTTOM3 {
8214712Sgblack@eecs.umich.edu                0x0: push_gs();
8224712Sgblack@eecs.umich.edu                0x1: pop_gs();
8234712Sgblack@eecs.umich.edu                0x2: rsm_smm();
8245240Sgblack@eecs.umich.edu                0x3: Inst::BTS(Ev,Gv);
8255977Sgblack@eecs.umich.edu                0x4: Inst::SHRD(Ev,Gv,Ib);
8266481Sgblack@eecs.umich.edu                0x5: Inst::SHRD(Ev,Gv);
8275238Sgblack@eecs.umich.edu                //0x6: group16();
8285967Sgblack@eecs.umich.edu                0x6: decode MODRM_REG {
8295967Sgblack@eecs.umich.edu                    0x0: fxsave();
8305967Sgblack@eecs.umich.edu                    0x1: fxrstor();
8315967Sgblack@eecs.umich.edu                    0x2: ldmxcsr();
8325967Sgblack@eecs.umich.edu                    0x3: stmxcsr();
8335967Sgblack@eecs.umich.edu                    0x4: Inst::UD2();
8345967Sgblack@eecs.umich.edu                    0x5: decode MODRM_MOD {
8355967Sgblack@eecs.umich.edu                        0x3: BasicOperate::LFENCE(
8365923Sgblack@eecs.umich.edu                                     {{/*Nothing*/}}, IsReadBarrier);
8375238Sgblack@eecs.umich.edu                        default: Inst::UD2();
8385238Sgblack@eecs.umich.edu                    }
8395967Sgblack@eecs.umich.edu                    0x6: decode MODRM_MOD {
8405967Sgblack@eecs.umich.edu                        0x3: BasicOperate::MFENCE(
8415967Sgblack@eecs.umich.edu                                     {{/*Nothing*/}}, IsMemBarrier);
8425967Sgblack@eecs.umich.edu                        default: Inst::UD2();
8435967Sgblack@eecs.umich.edu                    }
8445967Sgblack@eecs.umich.edu                    0x7: decode MODRM_MOD {
8455967Sgblack@eecs.umich.edu                        0x3: BasicOperate::SFENCE(
8465967Sgblack@eecs.umich.edu                                     {{/*Nothing*/}}, IsWriteBarrier);
8475238Sgblack@eecs.umich.edu                        default: Inst::UD2();
8485238Sgblack@eecs.umich.edu                    }
8495238Sgblack@eecs.umich.edu                }
8504724Sgblack@eecs.umich.edu                0x7: Inst::IMUL(Gv,Ev);
8514276Sgblack@eecs.umich.edu            }
8524276Sgblack@eecs.umich.edu            0x16: decode OPCODE_OP_BOTTOM3 {
8534864Sgblack@eecs.umich.edu                0x0: Inst::CMPXCHG(Eb,Gb);
8544864Sgblack@eecs.umich.edu                0x1: Inst::CMPXCHG(Ev,Gv);
8554712Sgblack@eecs.umich.edu                0x2: lss_Gz_Mp();
8565240Sgblack@eecs.umich.edu                0x3: Inst::BTR(Ev,Gv);
8574712Sgblack@eecs.umich.edu                0x4: lfs_Gz_Mp();
8584712Sgblack@eecs.umich.edu                0x5: lgs_Gz_Mp();
8594746Sgblack@eecs.umich.edu                //The size of the second operand in these instructions should
8604746Sgblack@eecs.umich.edu                //really be "b" or "w", but it's set to v in order to have a
8614746Sgblack@eecs.umich.edu                //consistent register size. This shouldn't affect behavior.
8624746Sgblack@eecs.umich.edu                0x6: Inst::MOVZX_B(Gv,Ev);
8634746Sgblack@eecs.umich.edu                0x7: Inst::MOVZX_W(Gv,Ev);
8644276Sgblack@eecs.umich.edu            }
8654276Sgblack@eecs.umich.edu            0x17: decode OPCODE_OP_BOTTOM3 {
8664712Sgblack@eecs.umich.edu                0x0: jmpe_Jz(); // IA-64?
8675240Sgblack@eecs.umich.edu                format Inst {
8685240Sgblack@eecs.umich.edu                    //0x1: group11_UD2();
8695240Sgblack@eecs.umich.edu                    0x1: UD2();
8705240Sgblack@eecs.umich.edu                    //0x2: group8_Ev_Ib();
8715240Sgblack@eecs.umich.edu                    0x2: decode MODRM_REG {
8725240Sgblack@eecs.umich.edu                        0x4: BT(Ev,Ib);
8735240Sgblack@eecs.umich.edu                        0x5: BTS(Ev,Ib);
8745240Sgblack@eecs.umich.edu                        0x6: BTR(Ev,Ib);
8755240Sgblack@eecs.umich.edu                        0x7: BTC(Ev,Ib);
8765240Sgblack@eecs.umich.edu                        default: UD2();
8775240Sgblack@eecs.umich.edu                    }
8785240Sgblack@eecs.umich.edu                    0x3: BTC(Ev,Gv);
8795238Sgblack@eecs.umich.edu                }
8805332Sgblack@eecs.umich.edu                0x4: Inst::BSF(Gv,Ev);
8815332Sgblack@eecs.umich.edu                0x5: Inst::BSR(Gv,Ev);
8824746Sgblack@eecs.umich.edu                //The size of the second operand in these instructions should
8834746Sgblack@eecs.umich.edu                //really be "b" or "w", but it's set to v in order to have a
8844746Sgblack@eecs.umich.edu                //consistent register size. This shouldn't affect behavior.
8854746Sgblack@eecs.umich.edu                0x6: Inst::MOVSX_B(Gv,Ev);
8864746Sgblack@eecs.umich.edu                0x7: Inst::MOVSX_W(Gv,Ev);
8874276Sgblack@eecs.umich.edu            }
8886576Sgblack@eecs.umich.edu            format Inst {
8896576Sgblack@eecs.umich.edu                0x18: decode OPCODE_OP_BOTTOM3 {
8906576Sgblack@eecs.umich.edu                    0x0: XADD(Eb,Gb);
8916576Sgblack@eecs.umich.edu                    0x1: XADD(Ev,Gv);
8926576Sgblack@eecs.umich.edu                    //0x7: group9();
8936576Sgblack@eecs.umich.edu                    0x7: decode MODRM_REG {
8946576Sgblack@eecs.umich.edu                        //Also CMPXCHG16B
8956576Sgblack@eecs.umich.edu                        0x1: CMPXCHG8B(Mdp);
8966576Sgblack@eecs.umich.edu                        0x6: decode LEGACY_OP {
8976576Sgblack@eecs.umich.edu                            0x1: WarnUnimpl::vmclear_Mq();
8986576Sgblack@eecs.umich.edu                            default: decode LEGACY_REP {
8996576Sgblack@eecs.umich.edu                                0x1: WarnUnimpl::vmxon_Mq();
9006576Sgblack@eecs.umich.edu                                0x0: WarnUnimpl::vmptrld_Mq();
9016576Sgblack@eecs.umich.edu                            }
9025238Sgblack@eecs.umich.edu                        }
9036576Sgblack@eecs.umich.edu                        0x7: WarnUnimpl::vmptrst_Mq();
9046576Sgblack@eecs.umich.edu                        default: UD2();
9055238Sgblack@eecs.umich.edu                    }
9066576Sgblack@eecs.umich.edu                    default: decode LEGACY_DECODEVAL {
9076576Sgblack@eecs.umich.edu                        // no prefix
9086576Sgblack@eecs.umich.edu                        0x0: decode OPCODE_OP_BOTTOM3 {
9096576Sgblack@eecs.umich.edu                            0x2: WarnUnimpl::cmpccps_Vo_Wo_Ib();
9106576Sgblack@eecs.umich.edu                            0x3: CVTDQ2PS(Vo,Wo);
9116576Sgblack@eecs.umich.edu                            0x4: SUBPS(Vo,Wo);
9126576Sgblack@eecs.umich.edu                            0x5: MINPS(Vo,Wo);
9136576Sgblack@eecs.umich.edu                            0x6: DIVPS(Vo,Wo);
9146576Sgblack@eecs.umich.edu                        }
9156576Sgblack@eecs.umich.edu                        // repe (0xF3)
9166576Sgblack@eecs.umich.edu                        0x4: decode OPCODE_OP_BOTTOM3 {
9176576Sgblack@eecs.umich.edu                            0x2: WarnUnimpl::cmpccss_Vd_Wd_Ib();
9186576Sgblack@eecs.umich.edu                            default: UD2();
9196576Sgblack@eecs.umich.edu                        }
9206576Sgblack@eecs.umich.edu                        // operand size (0x66)
9216576Sgblack@eecs.umich.edu                        0x1: decode OPCODE_OP_BOTTOM3 {
9226576Sgblack@eecs.umich.edu                            0x2: WarnUnimpl::cmpccpd_Vo_Wo_Ib();
9236576Sgblack@eecs.umich.edu                            0x4: SUBPD(Vo,Wo);
9246576Sgblack@eecs.umich.edu                            0x5: MINPD(Vo,Wo);
9256576Sgblack@eecs.umich.edu                            0x6: DIVPD(Vo,Wo);
9266576Sgblack@eecs.umich.edu                            default: UD2();
9276576Sgblack@eecs.umich.edu                        }
9286576Sgblack@eecs.umich.edu                        // repne (0xF2)
9296576Sgblack@eecs.umich.edu                        0x8: decode OPCODE_OP_BOTTOM3 {
9306576Sgblack@eecs.umich.edu                            0x2: WarnUnimpl::cmpccsd_Vq_Wq_Ib();
9316576Sgblack@eecs.umich.edu                            default: UD2();
9326576Sgblack@eecs.umich.edu                        }
9336576Sgblack@eecs.umich.edu                        default: UD2();
9346576Sgblack@eecs.umich.edu                    }
9355238Sgblack@eecs.umich.edu                }
9366576Sgblack@eecs.umich.edu                0x19: decode OPSIZE {
9376576Sgblack@eecs.umich.edu                    4: BSWAP_D(Bd);
9386576Sgblack@eecs.umich.edu                    8: BSWAP_Q(Bq);
9396576Sgblack@eecs.umich.edu                    default: UD2();
9405020Sgblack@eecs.umich.edu                }
9414276Sgblack@eecs.umich.edu            }
9425020Sgblack@eecs.umich.edu            0x1A: decode LEGACY_DECODEVAL {
9435020Sgblack@eecs.umich.edu                // no prefix
9445020Sgblack@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
9456584Sgblack@eecs.umich.edu                    0x1: Inst::PSRLW(Pq,Qq);
9466584Sgblack@eecs.umich.edu                    0x2: Inst::PSRLD(Pq,Qq);
9476584Sgblack@eecs.umich.edu                    0x3: Inst::PSRLQ(Pq,Qq);
9486571Sgblack@eecs.umich.edu                    0x4: Inst::PADDQ(Pq,Qq);
9496578Sgblack@eecs.umich.edu                    0x5: Inst::PMULLW(Pq,Qq);
9505020Sgblack@eecs.umich.edu                    0x7: pmovmskb_Gd_PRq();
9515020Sgblack@eecs.umich.edu                    default: Inst::UD2();
9525020Sgblack@eecs.umich.edu                }
9535020Sgblack@eecs.umich.edu                // repe (0xF3)
9545020Sgblack@eecs.umich.edu                0x4: decode OPCODE_OP_BOTTOM3 {
9555020Sgblack@eecs.umich.edu                    0x6: movq2dq_Vo_PRq();
9565020Sgblack@eecs.umich.edu                    default: Inst::UD2();
9575020Sgblack@eecs.umich.edu                }
9585020Sgblack@eecs.umich.edu                // operand size (0x66)
9595020Sgblack@eecs.umich.edu                0x1: decode OPCODE_OP_BOTTOM3 {
9605020Sgblack@eecs.umich.edu                    0x0: addsubpd_Vo_Wo();
9616584Sgblack@eecs.umich.edu                    0x1: Inst::PSRLW(Vo,Wo);
9626584Sgblack@eecs.umich.edu                    0x2: Inst::PSRLD(Vo,Wo);
9636584Sgblack@eecs.umich.edu                    0x3: Inst::PSRLQ(Vo,Wo);
9646571Sgblack@eecs.umich.edu                    0x4: Inst::PADDQ(Vo,Wo);
9656578Sgblack@eecs.umich.edu                    0x5: Inst::PMULLW(Vo,Wo);
9666525Sgblack@eecs.umich.edu                    0x6: Inst::MOVQ(Wq,Vq);
9675020Sgblack@eecs.umich.edu                    0x7: pmovmskb_Gd_VRo();
9685020Sgblack@eecs.umich.edu                }
9695020Sgblack@eecs.umich.edu                // repne (0xF2)
9705020Sgblack@eecs.umich.edu                0x8: decode OPCODE_OP_BOTTOM3 {
9715020Sgblack@eecs.umich.edu                    0x0: addsubps_Vo_Wo();
9725020Sgblack@eecs.umich.edu                    0x6: movdq2q_Pq_VRq();
9735020Sgblack@eecs.umich.edu                    default: Inst::UD2();
9745020Sgblack@eecs.umich.edu                }
9755020Sgblack@eecs.umich.edu                default: Inst::UD2();
9764276Sgblack@eecs.umich.edu            }
9776576Sgblack@eecs.umich.edu            format Inst {
9786576Sgblack@eecs.umich.edu                0x1B: decode LEGACY_DECODEVAL {
9796576Sgblack@eecs.umich.edu                    // no prefix
9806576Sgblack@eecs.umich.edu                    0x0: decode OPCODE_OP_BOTTOM3 {
9816580Sgblack@eecs.umich.edu                        0x0: PSUBUSB(Pq,Qq);
9826580Sgblack@eecs.umich.edu                        0x1: PSUBUSW(Pq,Qq);
9836576Sgblack@eecs.umich.edu                        0x2: PMINUB(Pq,Qq);
9846576Sgblack@eecs.umich.edu                        0x3: PAND(Pq,Qq);
9856576Sgblack@eecs.umich.edu                        0x4: PADDUSB(Pq,Qq);
9866576Sgblack@eecs.umich.edu                        0x5: PADDUSW(Pq,Qq);
9876576Sgblack@eecs.umich.edu                        0x6: PMAXUB(Pq,Qq);
9886576Sgblack@eecs.umich.edu                        0x7: PANDN(Pq,Qq);
9896576Sgblack@eecs.umich.edu                    }
9906576Sgblack@eecs.umich.edu                    // operand size (0x66)
9916576Sgblack@eecs.umich.edu                    0x1: decode OPCODE_OP_BOTTOM3 {
9926580Sgblack@eecs.umich.edu                        0x0: PSUBUSB(Vo,Wo);
9936580Sgblack@eecs.umich.edu                        0x1: PSUBUSW(Vo,Wo);
9946576Sgblack@eecs.umich.edu                        0x2: PMINUB(Vo,Wo);
9956576Sgblack@eecs.umich.edu                        0x3: PAND(Vo,Wo);
9966576Sgblack@eecs.umich.edu                        0x4: PADDUSB(Vo,Wo);
9976576Sgblack@eecs.umich.edu                        0x5: PADDUSW(Vo,Wo);
9986576Sgblack@eecs.umich.edu                        0x6: PMAXUB(Vo,Wo);
9996576Sgblack@eecs.umich.edu                        0x7: PANDN(Vo,Wo);
10006576Sgblack@eecs.umich.edu                    }
10016576Sgblack@eecs.umich.edu                    default: UD2();
10025020Sgblack@eecs.umich.edu                }
10034276Sgblack@eecs.umich.edu            }
10045022Sgblack@eecs.umich.edu            0x1C: decode LEGACY_DECODEVAL {
10055022Sgblack@eecs.umich.edu                // no prefix
10065022Sgblack@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
10075022Sgblack@eecs.umich.edu                    0x0: pavgb_Pq_Qq();
10086584Sgblack@eecs.umich.edu                    0x1: Inst::PSRAW(Pq,Qq);
10096584Sgblack@eecs.umich.edu                    0x2: Inst::PSRAD(Pq,Qq);
10105022Sgblack@eecs.umich.edu                    0x3: pavgw_Pq_Qq();
10116578Sgblack@eecs.umich.edu                    0x4: Inst::PMULHUW(Pq,Qq);
10126578Sgblack@eecs.umich.edu                    0x5: Inst::PMULHW(Pq,Qq);
10135022Sgblack@eecs.umich.edu                    0x7: movntq_Mq_Pq();
10145022Sgblack@eecs.umich.edu                    default: Inst::UD2();
10155022Sgblack@eecs.umich.edu                }
10165022Sgblack@eecs.umich.edu                // repe (0xF3)
10175022Sgblack@eecs.umich.edu                0x4: decode OPCODE_OP_BOTTOM3 {
10186563Sgblack@eecs.umich.edu                    0x6: Inst::CVTDQ2PD(Vo,Wq);
10195022Sgblack@eecs.umich.edu                    default: Inst::UD2();
10205022Sgblack@eecs.umich.edu                }
10215022Sgblack@eecs.umich.edu                // operand size (0x66)
10225022Sgblack@eecs.umich.edu                0x1: decode OPCODE_OP_BOTTOM3 {
10235022Sgblack@eecs.umich.edu                    0x0: pavgb_Vo_Wo();
10246584Sgblack@eecs.umich.edu                    0x1: Inst::PSRAW(Vo,Wo);
10256584Sgblack@eecs.umich.edu                    0x2: Inst::PSRAD(Vo,Wo);
10265022Sgblack@eecs.umich.edu                    0x3: pavgw_Vo_Wo();
10276578Sgblack@eecs.umich.edu                    0x4: Inst::PMULHUW(Vo,Wo);
10286578Sgblack@eecs.umich.edu                    0x5: Inst::PMULHW(Vo,Wo);
10295022Sgblack@eecs.umich.edu                    0x6: cvttpd2dq_Vo_Wo();
10305022Sgblack@eecs.umich.edu                    0x7: movntdq_Mo_Vo();
10315022Sgblack@eecs.umich.edu                }
10325022Sgblack@eecs.umich.edu                // repne (0xF2)
10335022Sgblack@eecs.umich.edu                0x8: decode OPCODE_OP_BOTTOM3 {
10345022Sgblack@eecs.umich.edu                    0x6: cvtpd2dq_Vo_Wo();
10355022Sgblack@eecs.umich.edu                    default: Inst::UD2();
10365022Sgblack@eecs.umich.edu                }
10375022Sgblack@eecs.umich.edu                default: Inst::UD2();
10384276Sgblack@eecs.umich.edu            }
10396576Sgblack@eecs.umich.edu            format Inst {
10406576Sgblack@eecs.umich.edu                0x1D: decode LEGACY_DECODEVAL {
10416576Sgblack@eecs.umich.edu                    // no prefix
10426576Sgblack@eecs.umich.edu                    0x0: decode OPCODE_OP_BOTTOM3 {
10436580Sgblack@eecs.umich.edu                        0x0: PSUBSB(Pq,Qq);
10446580Sgblack@eecs.umich.edu                        0x1: PSUBSW(Pq,Qq);
10456576Sgblack@eecs.umich.edu                        0x2: PMINSW(Pq,Qq);
10466576Sgblack@eecs.umich.edu                        0x3: POR(Pq,Qq);
10476576Sgblack@eecs.umich.edu                        0x4: PADDSB(Pq,Qq);
10486576Sgblack@eecs.umich.edu                        0x5: PADDSW(Pq,Qq);
10496576Sgblack@eecs.umich.edu                        0x6: PMAXSW(Pq,Qq);
10506576Sgblack@eecs.umich.edu                        0x7: PXOR(Pq,Qq);
10516576Sgblack@eecs.umich.edu                    }
10526576Sgblack@eecs.umich.edu                    // operand size (0x66)
10536576Sgblack@eecs.umich.edu                    0x1: decode OPCODE_OP_BOTTOM3 {
10546580Sgblack@eecs.umich.edu                        0x0: PSUBSB(Vo,Wo);
10556580Sgblack@eecs.umich.edu                        0x1: PSUBSW(Vo,Wo);
10566576Sgblack@eecs.umich.edu                        0x2: PMINSW(Vo,Wo);
10576576Sgblack@eecs.umich.edu                        0x3: POR(Vo,Wo);
10586576Sgblack@eecs.umich.edu                        0x4: PADDSB(Vo,Wo);
10596576Sgblack@eecs.umich.edu                        0x5: PADDSW(Vo,Wo);
10606576Sgblack@eecs.umich.edu                        0x6: PMAXSW(Vo,Wo);
10616576Sgblack@eecs.umich.edu                        0x7: PXOR(Vo,Wo);
10626576Sgblack@eecs.umich.edu                    }
10636576Sgblack@eecs.umich.edu                    default: UD2();
10645020Sgblack@eecs.umich.edu                }
10656586Sgblack@eecs.umich.edu                0x1E: decode LEGACY_DECODEVAL {
10666586Sgblack@eecs.umich.edu                    // no prefix
10676586Sgblack@eecs.umich.edu                    0x0: decode OPCODE_OP_BOTTOM3 {
10686586Sgblack@eecs.umich.edu                        0x1: PSLLW(Pq,Qq);
10696586Sgblack@eecs.umich.edu                        0x2: PSLLD(Pq,Qq);
10706586Sgblack@eecs.umich.edu                        0x3: PSLLQ(Pq,Qq);
10716586Sgblack@eecs.umich.edu                        0x4: PMULUDQ(Pq,Qq);
10726586Sgblack@eecs.umich.edu                        0x5: PMADDWD(Pq,Qq);
10736586Sgblack@eecs.umich.edu                        0x6: PSADBW(Pq,Qq);
10746586Sgblack@eecs.umich.edu                        0x7: WarnUnimpl::maskmovq_Pq_PRq();
10756586Sgblack@eecs.umich.edu                        default: UD2();
10766586Sgblack@eecs.umich.edu                    }
10776586Sgblack@eecs.umich.edu                    // operand size (0x66)
10786586Sgblack@eecs.umich.edu                    0x1: decode OPCODE_OP_BOTTOM3 {
10796586Sgblack@eecs.umich.edu                        0x1: PSLLW(Vo,Wo);
10806586Sgblack@eecs.umich.edu                        0x2: PSLLD(Vo,Wo);
10816586Sgblack@eecs.umich.edu                        0x3: PSLLQ(Vo,Wo);
10826586Sgblack@eecs.umich.edu                        0x4: PMULUDQ(Vo,Wo);
10836586Sgblack@eecs.umich.edu                        0x5: PMADDWD(Vo,Wo);
10846586Sgblack@eecs.umich.edu                        0x6: PSADBW(Vo,Wo);
10856586Sgblack@eecs.umich.edu                        0x7: WarnUnimpl::maskmovdqu_Vo_VRo();
10866586Sgblack@eecs.umich.edu                        default: UD2();
10876586Sgblack@eecs.umich.edu                    }
10886586Sgblack@eecs.umich.edu                    // repne (0xF2)
10896586Sgblack@eecs.umich.edu                    0x8: decode OPCODE_OP_BOTTOM3 {
10906586Sgblack@eecs.umich.edu                        0x0: WarnUnimpl::lddqu_Vo_Mo();
10916586Sgblack@eecs.umich.edu                        default: UD2();
10926586Sgblack@eecs.umich.edu                    }
10936586Sgblack@eecs.umich.edu                    default: UD2();
10945022Sgblack@eecs.umich.edu                }
10956576Sgblack@eecs.umich.edu                0x1F: decode LEGACY_DECODEVAL {
10966576Sgblack@eecs.umich.edu                    // no prefix
10976576Sgblack@eecs.umich.edu                    0x0: decode OPCODE_OP_BOTTOM3 {
10986580Sgblack@eecs.umich.edu                        0x0: PSUBB(Pq,Qq);
10996580Sgblack@eecs.umich.edu                        0x1: PSUBW(Pq,Qq);
11006580Sgblack@eecs.umich.edu                        0x2: PSUBD(Pq,Qq);
11016580Sgblack@eecs.umich.edu                        0x3: PSUBQ(Pq,Qq);
11026576Sgblack@eecs.umich.edu                        0x4: PADDB(Pq,Qq);
11036576Sgblack@eecs.umich.edu                        0x5: PADDW(Pq,Qq);
11046576Sgblack@eecs.umich.edu                        0x6: PADDD(Pq,Qq);
11056576Sgblack@eecs.umich.edu                        0x7: UD2();
11066576Sgblack@eecs.umich.edu                    }
11076576Sgblack@eecs.umich.edu                    // operand size (0x66)
11086576Sgblack@eecs.umich.edu                    0x1: decode OPCODE_OP_BOTTOM3 {
11096580Sgblack@eecs.umich.edu                        0x0: PSUBB(Vo,Wo);
11106580Sgblack@eecs.umich.edu                        0x1: PSUBW(Vo,Wo);
11116580Sgblack@eecs.umich.edu                        0x2: PSUBD(Vo,Wo);
11126580Sgblack@eecs.umich.edu                        0x3: PSUBQ(Vo,Wo);
11136576Sgblack@eecs.umich.edu                        0x4: PADDB(Vo,Wo);
11146576Sgblack@eecs.umich.edu                        0x5: PADDW(Vo,Wo);
11156576Sgblack@eecs.umich.edu                        0x6: PADDD(Vo,Wo);
11166576Sgblack@eecs.umich.edu                        0x7: UD2();
11176576Sgblack@eecs.umich.edu                    }
11186576Sgblack@eecs.umich.edu                    default: UD2();
11195020Sgblack@eecs.umich.edu                }
11204276Sgblack@eecs.umich.edu            }
11214276Sgblack@eecs.umich.edu            default: FailUnimpl::twoByteOps();
11224276Sgblack@eecs.umich.edu        }
11234276Sgblack@eecs.umich.edu    }
11244276Sgblack@eecs.umich.edu    default: M5InternalError::error(
11254276Sgblack@eecs.umich.edu        {{"Unexpected first opcode byte in two byte opcode!"}});
11264276Sgblack@eecs.umich.edu}
1127