two_byte_opcodes.isa revision 11703
1955SN/A// Copyright (c) 2007-2008 The Hewlett-Packard Development Company
2955SN/A// Copyright (c) 2012-2013 AMD
31762SN/A// All rights reserved.
4955SN/A//
5955SN/A// The license below extends only to copyright in the software and shall
6955SN/A// not be construed as granting a license to any other intellectual
7955SN/A// property including but not limited to intellectual property relating
8955SN/A// to a hardware implementation of the functionality of the software
9955SN/A// licensed hereunder.  You may use the software subject to the license
10955SN/A// terms below provided that you ensure that this notice is replicated
11955SN/A// unmodified and in its entirety in all distributions of the software,
12955SN/A// modified or unmodified, in source code or in binary form.
13955SN/A//
14955SN/A// Copyright (c) 2008 The Regents of The University of Michigan
15955SN/A// All rights reserved.
16955SN/A//
17955SN/A// Redistribution and use in source and binary forms, with or without
18955SN/A// modification, are permitted provided that the following conditions are
19955SN/A// met: redistributions of source code must retain the above copyright
20955SN/A// notice, this list of conditions and the following disclaimer;
21955SN/A// redistributions in binary form must reproduce the above copyright
22955SN/A// notice, this list of conditions and the following disclaimer in the
23955SN/A// documentation and/or other materials provided with the distribution;
24955SN/A// neither the name of the copyright holders nor the names of its
25955SN/A// contributors may be used to endorse or promote products derived from
26955SN/A// this software without specific prior written permission.
27955SN/A//
282665Ssaidi@eecs.umich.edu// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
294762Snate@binkert.org// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30955SN/A// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
315522Snate@binkert.org// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
326143Snate@binkert.org// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
334762Snate@binkert.org// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
345522Snate@binkert.org// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35955SN/A// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
365522Snate@binkert.org// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37955SN/A// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
385522Snate@binkert.org// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
394202Sbinkertn@umich.edu//
405742Snate@binkert.org// Authors: Gabe Black
41955SN/A
424381Sbinkertn@umich.edu////////////////////////////////////////////////////////////////////
434381Sbinkertn@umich.edu//
44955SN/A// Decode the two byte opcodes
45955SN/A//
46955SN/A'X86ISA::TwoByteOpcode': decode OPCODE_OP_TOP5 {
474202Sbinkertn@umich.edu    format WarnUnimpl {
48955SN/A        0x00: decode OPCODE_OP_BOTTOM3 {
494382Sbinkertn@umich.edu            //0x00: group6();
504382Sbinkertn@umich.edu            0x00: decode MODRM_REG {
514382Sbinkertn@umich.edu                0x0: sldt_Mw_or_Rv();
526654Snate@binkert.org                0x1: str_Mw_or_Rv();
535517Snate@binkert.org                0x2: Inst::LLDT(Ew);
546143Snate@binkert.org                0x3: Inst::LTR(Ew);
556143Snate@binkert.org                0x4: verr_Mw_or_Rv();
566143Snate@binkert.org                0x5: verw_Mw_or_Rv();
576143Snate@binkert.org                //0x6: jmpe_Ev(); // IA-64
586143Snate@binkert.org                default: Inst::UD2();
596143Snate@binkert.org            }
606143Snate@binkert.org            //0x01: group7(); // Ugly, ugly, ugly...
616143Snate@binkert.org            0x01: decode MODRM_REG {
626143Snate@binkert.org                0x0: decode MODRM_MOD {
636143Snate@binkert.org                    0x3: decode MODRM_RM {
646143Snate@binkert.org                        0x1: vmcall();
656143Snate@binkert.org                        0x2: vmlaunch();
666143Snate@binkert.org                        0x3: vmresume();
676143Snate@binkert.org                        0x4: vmxoff();
686143Snate@binkert.org                        default: Inst::UD2();
694762Snate@binkert.org                    }
706143Snate@binkert.org                    default: sgdt_Ms();
716143Snate@binkert.org                }
726143Snate@binkert.org                0x1: decode MODRM_MOD {
736143Snate@binkert.org                    0x3: decode MODRM_RM {
746143Snate@binkert.org                        0x0: MonitorInst::monitor({{
756143Snate@binkert.org                           xc->armMonitor(Rax);
766143Snate@binkert.org                        }});
776143Snate@binkert.org                        0x1: MwaitInst::mwait({{
786143Snate@binkert.org                           uint64_t m = 0;          //mem
796143Snate@binkert.org                           unsigned s = 0x8;        //size
806143Snate@binkert.org                           unsigned f = 0;          //flags
816143Snate@binkert.org                           readMemAtomic(xc, traceData,
826143Snate@binkert.org                                         xc->getAddrMonitor()->vAddr,
836143Snate@binkert.org                                         m, s, f);
846143Snate@binkert.org                           xc->mwaitAtomic(xc->tcBase());
856143Snate@binkert.org                           MicroHalt hltObj(machInst, mnemonic, 0x0);
866143Snate@binkert.org                           hltObj.execute(xc, traceData);
876143Snate@binkert.org                        }});
886143Snate@binkert.org                        default: Inst::UD2();
896143Snate@binkert.org                    }
906143Snate@binkert.org                    default: sidt_Ms();
916143Snate@binkert.org                }
926143Snate@binkert.org                0x2: decode MODRM_MOD {
936143Snate@binkert.org                    0x3: decode MODRM_RM {
946143Snate@binkert.org                        0x0: xgetbv();
956143Snate@binkert.org                        0x1: xsetbv();
966143Snate@binkert.org                    }
976143Snate@binkert.org                    default: decode MODE_SUBMODE {
986143Snate@binkert.org                        0x0: Inst::LGDT(M);
996143Snate@binkert.org                        default: decode OPSIZE {
1006143Snate@binkert.org                            // 16 bit operand sizes are special, but only
1016143Snate@binkert.org                            // in legacy and compatability modes.
1026143Snate@binkert.org                            0x2: Inst::LGDT_16(M);
1036143Snate@binkert.org                            default: Inst::LGDT(M);
1046143Snate@binkert.org                        }
1056143Snate@binkert.org                    }
1066143Snate@binkert.org                }
1076143Snate@binkert.org                0x3: decode MODRM_MOD {
1086143Snate@binkert.org                    0x3: decode MODRM_RM {
1096143Snate@binkert.org                        0x0: vmrun();
1106143Snate@binkert.org                        0x1: vmmcall();
1116143Snate@binkert.org                        0x2: vmload();
1126143Snate@binkert.org                        0x3: vmsave();
1135522Snate@binkert.org                        0x4: stgi();
1146143Snate@binkert.org                        0x5: clgi();
1156143Snate@binkert.org                        0x6: skinit();
1166143Snate@binkert.org                        0x7: invlpga();
1176143Snate@binkert.org                    }
1186143Snate@binkert.org                    default: decode MODE_SUBMODE {
1196143Snate@binkert.org                        0x0: Inst::LIDT(M);
1206143Snate@binkert.org                        default: decode OPSIZE {
1216143Snate@binkert.org                            // 16 bit operand sizes are special, but only
1226143Snate@binkert.org                            // in legacy and compatability modes.
1236143Snate@binkert.org                            0x2: Inst::LIDT_16(M);
1245522Snate@binkert.org                            default: Inst::LIDT(M);
1255522Snate@binkert.org                        }
1265522Snate@binkert.org                    }
1275522Snate@binkert.org                }
1285604Snate@binkert.org                0x4: decode MODRM_MOD {
1295604Snate@binkert.org                    0x3: Inst::SMSW(Rv);
1306143Snate@binkert.org                    default: Inst::SMSW(Mw);
1316143Snate@binkert.org                }
1324762Snate@binkert.org                0x6: Inst::LMSW(Ew);
1334762Snate@binkert.org                0x7: decode MODRM_MOD {
1346143Snate@binkert.org                    0x3: decode MODRM_RM {
1356727Ssteve.reinhardt@amd.com                        0x0: Inst::SWAPGS();
1366727Ssteve.reinhardt@amd.com                        0x1: rdtscp();
1376727Ssteve.reinhardt@amd.com                        default: Inst::UD2();
1384762Snate@binkert.org                    }
1396143Snate@binkert.org                    default: Inst::INVLPG(M);
1406143Snate@binkert.org                }
1416143Snate@binkert.org            }
1426143Snate@binkert.org            0x02: lar_Gv_Ew();
1436727Ssteve.reinhardt@amd.com            0x03: lsl_Gv_Ew();
1446143Snate@binkert.org            // sandpile.org doesn't seem to know what this is...? We'll
1456143Snate@binkert.org            // use it for pseudo instructions. We've got 16 bits of space
1466143Snate@binkert.org            // to play with so there can be quite a few pseudo
1475604Snate@binkert.org            // instructions.
1486143Snate@binkert.org            //0x04: loadall_or_reset_or_hang();
1496143Snate@binkert.org            0x4: decode IMMEDIATE {
1506143Snate@binkert.org                format BasicOperate {
1514762Snate@binkert.org                    0x00: m5arm({{
1526143Snate@binkert.org                        PseudoInst::arm(xc->tcBase());
1534762Snate@binkert.org                    }}, IsNonSpeculative);
1544762Snate@binkert.org                    0x01: m5quiesce({{
1554762Snate@binkert.org                        PseudoInst::quiesce(xc->tcBase());
1566143Snate@binkert.org                    }}, IsNonSpeculative, IsQuiesce);
1576143Snate@binkert.org                    0x02: m5quiesceNs({{
1584762Snate@binkert.org                        PseudoInst::quiesceNs(xc->tcBase(), Rdi);
1596143Snate@binkert.org                    }}, IsNonSpeculative, IsQuiesce);
1606143Snate@binkert.org                    0x03: m5quiesceCycle({{
1616143Snate@binkert.org                        PseudoInst::quiesceCycles(xc->tcBase(), Rdi);
1626143Snate@binkert.org                    }}, IsNonSpeculative, IsQuiesce);
1634762Snate@binkert.org                    0x04: m5quiesceTime({{
1646143Snate@binkert.org                        Rax = PseudoInst::quiesceTime(xc->tcBase());
1654762Snate@binkert.org                    }}, IsNonSpeculative);
1666143Snate@binkert.org                    0x07: m5rpns({{
1674762Snate@binkert.org                        Rax = PseudoInst::rpns(xc->tcBase());
1686143Snate@binkert.org                    }}, IsNonSpeculative);
1696143Snate@binkert.org                    0x21: m5exit({{
1706143Snate@binkert.org                        PseudoInst::m5exit(xc->tcBase(), Rdi);
1716143Snate@binkert.org                    }}, IsNonSpeculative);
1726143Snate@binkert.org                    0x22: m5fail({{
1736143Snate@binkert.org                        PseudoInst::m5fail(xc->tcBase(), Rdi, Rsi);
1746143Snate@binkert.org                    }}, IsNonSpeculative);
1756143Snate@binkert.org                    0x30: m5initparam({{
1766143Snate@binkert.org                        Rax = PseudoInst::initParam(xc->tcBase(), Rdi, Rsi);
1776143Snate@binkert.org                    }}, IsNonSpeculative);
1786143Snate@binkert.org                    0x31: m5loadsymbol({{
1796143Snate@binkert.org                        PseudoInst::loadsymbol(xc->tcBase());
1806143Snate@binkert.org                    }}, IsNonSpeculative);
181955SN/A                    0x40: m5resetstats({{
1825584Snate@binkert.org                        PseudoInst::resetstats(xc->tcBase(), Rdi, Rsi);
1835584Snate@binkert.org                    }}, IsNonSpeculative);
1845584Snate@binkert.org                    0x41: m5dumpstats({{
1855584Snate@binkert.org                        PseudoInst::dumpstats(xc->tcBase(), Rdi, Rsi);
1866143Snate@binkert.org                    }}, IsNonSpeculative);
1876143Snate@binkert.org                    0x42: m5dumpresetstats({{
1886143Snate@binkert.org                        PseudoInst::dumpresetstats(xc->tcBase(), Rdi, Rsi);
1895584Snate@binkert.org                    }}, IsNonSpeculative);
1904382Sbinkertn@umich.edu                    0x43: m5checkpoint({{
1914202Sbinkertn@umich.edu                        PseudoInst::m5checkpoint(xc->tcBase(), Rdi, Rsi);
1924382Sbinkertn@umich.edu                    }}, IsNonSpeculative);
1934382Sbinkertn@umich.edu                    0x50: m5readfile({{
1944382Sbinkertn@umich.edu                        Rax = PseudoInst::readfile(
1955584Snate@binkert.org                            xc->tcBase(), Rdi, Rsi, Rdx);
1964382Sbinkertn@umich.edu                    }}, IsNonSpeculative);
1974382Sbinkertn@umich.edu                    0x51: m5debugbreak({{
1984382Sbinkertn@umich.edu                        PseudoInst::debugbreak(xc->tcBase());
1995192Ssaidi@eecs.umich.edu                    }}, IsNonSpeculative);
2005192Ssaidi@eecs.umich.edu                    0x52: m5switchcpu({{
2015799Snate@binkert.org                        PseudoInst::switchcpu(xc->tcBase());
2025799Snate@binkert.org                    }}, IsNonSpeculative);
2035799Snate@binkert.org                    0x53: m5addsymbol({{
2045192Ssaidi@eecs.umich.edu                        PseudoInst::addsymbol(xc->tcBase(), Rdi, Rsi);
2055799Snate@binkert.org                    }}, IsNonSpeculative);
2065192Ssaidi@eecs.umich.edu                    0x54: m5panic({{
2075799Snate@binkert.org                        panic("M5 panic instruction called at pc = %#x.\n",
2085799Snate@binkert.org                              RIP);
2095192Ssaidi@eecs.umich.edu                    }}, IsNonSpeculative);
2105192Ssaidi@eecs.umich.edu                    0x55: m5reserved1({{
2115192Ssaidi@eecs.umich.edu                        warn("M5 reserved opcode 1 ignored.\n");
2125799Snate@binkert.org                    }}, IsNonSpeculative);
2135192Ssaidi@eecs.umich.edu                    0x56: m5reserved2({{
2145192Ssaidi@eecs.umich.edu                        warn("M5 reserved opcode 2 ignored.\n");
2155192Ssaidi@eecs.umich.edu                    }}, IsNonSpeculative);
2165192Ssaidi@eecs.umich.edu                    0x57: m5reserved3({{
2175192Ssaidi@eecs.umich.edu                        warn("M5 reserved opcode 3 ignored.\n");
2185192Ssaidi@eecs.umich.edu                    }}, IsNonSpeculative);
2194382Sbinkertn@umich.edu                    0x58: m5reserved4({{
2204382Sbinkertn@umich.edu                        warn("M5 reserved opcode 4 ignored.\n");
2214382Sbinkertn@umich.edu                    }}, IsNonSpeculative);
2222667Sstever@eecs.umich.edu                    0x59: m5reserved5({{
2232667Sstever@eecs.umich.edu                        warn("M5 reserved opcode 5 ignored.\n");
2242667Sstever@eecs.umich.edu                    }}, IsNonSpeculative);
2252667Sstever@eecs.umich.edu                    0x5a: m5_work_begin({{
2262667Sstever@eecs.umich.edu                        PseudoInst::workbegin(xc->tcBase(), Rdi, Rsi);
2272667Sstever@eecs.umich.edu                    }}, IsNonSpeculative);
2285742Snate@binkert.org                    0x5b: m5_work_end({{
2295742Snate@binkert.org                        PseudoInst::workend(xc->tcBase(), Rdi, Rsi);
2305742Snate@binkert.org                    }}, IsNonSpeculative);
2315793Snate@binkert.org                    0x62: m5togglesync({{
2325793Snate@binkert.org                        PseudoInst::togglesync(xc->tcBase());
2335793Snate@binkert.org                    }}, IsNonSpeculative, IsQuiesce);
2345793Snate@binkert.org                    default: Inst::UD2();
2355793Snate@binkert.org                }
2364382Sbinkertn@umich.edu            }
2374762Snate@binkert.org            0x05: decode FullSystemInt {
2385344Sstever@gmail.com                0: SyscallInst::syscall('xc->syscall(Rax)',
2394382Sbinkertn@umich.edu                        IsSyscall, IsNonSpeculative, IsSerializeAfter);
2405341Sstever@gmail.com                default: decode MODE_MODE {
2415742Snate@binkert.org                    0x0: decode MODE_SUBMODE {
2425742Snate@binkert.org                        0x0: Inst::SYSCALL_64();
2435742Snate@binkert.org                        0x1: Inst::SYSCALL_COMPAT();
2445742Snate@binkert.org                    }
2455742Snate@binkert.org                    0x1: Inst::SYSCALL_LEGACY();
2464762Snate@binkert.org                }
2475742Snate@binkert.org            }
2485742Snate@binkert.org            0x06: Inst::CLTS();
2495742Snate@binkert.org            0x07: decode MODE_SUBMODE {
2505742Snate@binkert.org                0x0: decode OPSIZE {
2515742Snate@binkert.org                    // Return to 64 bit mode.
2525742Snate@binkert.org                    0x8: Inst::SYSRET_TO_64();
2535742Snate@binkert.org                    // Return to compatibility mode.
2545341Sstever@gmail.com                    default: Inst::SYSRET_TO_COMPAT();
2555742Snate@binkert.org                }
2565341Sstever@gmail.com                default: Inst::SYSRET_NON_64();
2574773Snate@binkert.org            }
2586108Snate@binkert.org        }
2591858SN/A        0x01: decode OPCODE_OP_BOTTOM3 {
2601085SN/A            0x0: invd();
2616658Snate@binkert.org            0x1: wbinvd();
2626658Snate@binkert.org            0x2: Inst::UD2();
2636658Snate@binkert.org            0x3: Inst::UD2();
2646658Snate@binkert.org            0x4: Inst::UD2();
2656658Snate@binkert.org            0x5: Inst::PREFETCH(Mb);
2666658Snate@binkert.org            0x6: FailUnimpl::femms();
2676658Snate@binkert.org            0x7: decode IMMEDIATE {
2686658Snate@binkert.org                0x0C: pi2fw_Pq_Qq();
2696658Snate@binkert.org                0x0D: pi2fd_Pq_Qq();
2706658Snate@binkert.org                0x1C: pf2iw_Pq_Qq();
2716658Snate@binkert.org                0x1D: pf2id_Pq_Qq();
2726658Snate@binkert.org                0x8A: pfnacc_Pq_Qq();
2736658Snate@binkert.org                0x8E: pfpnacc_Pq_Qq();
2746658Snate@binkert.org                0x90: pfcmpge_Pq_Qq();
2756658Snate@binkert.org                0x94: pfmin_Pq_Qq();
2766658Snate@binkert.org                0x96: pfrcp_Pq_Qq();
2776658Snate@binkert.org                0x97: pfrsqrt_Pq_Qq();
2786658Snate@binkert.org                0x9A: Inst::PFSUB(Pq,Qq);
2796658Snate@binkert.org                0x9E: pfadd_Pq_Qq();
2806658Snate@binkert.org                0xA0: pfcmpgt_Pq_Qq();
2816658Snate@binkert.org                0xA4: pfmax_Pq_Qq();
2826658Snate@binkert.org                0xA6: pfrcpit1_Pq_Qq();
2836658Snate@binkert.org                0xA7: pfrsqit1_Pq_Qq();
2846658Snate@binkert.org                0xAA: Inst::PFSUBR(Pq,Qq);
2856658Snate@binkert.org                0xAE: pfacc_Pq_Qq();
2864382Sbinkertn@umich.edu                0xB0: pfcmpeq_Pq_Qq();
2874382Sbinkertn@umich.edu                0xB4: Inst::PFMUL(Pq,Qq);
2884762Snate@binkert.org                0xB6: pfrcpit2_Pq_Qq();
2894762Snate@binkert.org                0xB7: Inst::PMULHRW(Pq,Qq);
2904762Snate@binkert.org                0xBB: pswapd_Pq_Qq();
2916654Snate@binkert.org                0xBF: pavgusb_Pq_Qq();
2926654Snate@binkert.org                default: Inst::UD2();
2935517Snate@binkert.org            }
2945517Snate@binkert.org        }
2955517Snate@binkert.org        format Inst{
2965517Snate@binkert.org            0x02: decode LEGACY_DECODEVAL {
2975517Snate@binkert.org                // no prefix
2985517Snate@binkert.org                0x0: decode OPCODE_OP_BOTTOM3 {
2995517Snate@binkert.org                    0x0: MOVUPS(Vo,Wo);
3005517Snate@binkert.org                    0x1: MOVUPS(Wo,Vo);
3015517Snate@binkert.org                    0x2: decode MODRM_MOD {
3025517Snate@binkert.org                        0x3: MOVHLPS(Vps,VRq);
3035517Snate@binkert.org                        default: MOVLPS(Vps,Mq);
3045517Snate@binkert.org                    }
3055517Snate@binkert.org                    0x3: MOVLPS(Mq,Vps);
3065517Snate@binkert.org                    0x4: UNPCKLPS(Vps,Wq);
3075517Snate@binkert.org                    0x5: UNPCKHPS(Vps,Wq);
3085517Snate@binkert.org                    0x6: decode MODRM_MOD {
3095517Snate@binkert.org                        0x3: MOVLHPS(Vps,VRq);
3106654Snate@binkert.org                        default: MOVHPS(Vps,Mq);
3115517Snate@binkert.org                    }
3125517Snate@binkert.org                    0x7: MOVHPS(Mq,Vq);
3135517Snate@binkert.org                }
3145517Snate@binkert.org                // repe (0xF3)
3155517Snate@binkert.org                0x4: decode OPCODE_OP_BOTTOM3 {
3165517Snate@binkert.org                    0x0: MOVSS(Vd,Wd);
3175517Snate@binkert.org                    0x1: MOVSS(Wd,Vd);
3185517Snate@binkert.org                    0x2: WarnUnimpl::movsldup_Vo_Wo();
3196143Snate@binkert.org                    0x6: WarnUnimpl::movshdup_Vo_Wo();
3206654Snate@binkert.org                    default: UD2();
3215517Snate@binkert.org                }
3225517Snate@binkert.org                // operand size (0x66)
3235517Snate@binkert.org                0x1: decode OPCODE_OP_BOTTOM3 {
3245517Snate@binkert.org                    0x0: MOVUPD(Vo,Wo);
3255517Snate@binkert.org                    0x1: MOVUPD(Wo,Vo);
3265517Snate@binkert.org                    0x2: MOVLPD(Vq,Mq);
3275517Snate@binkert.org                    0x3: MOVLPD(Mq,Vq);
3285517Snate@binkert.org                    0x4: UNPCKLPD(Vo,Wq);
3295517Snate@binkert.org                    0x5: UNPCKHPD(Vo,Wo);
3305517Snate@binkert.org                    0x6: MOVHPD(Vq,Mq);
3315517Snate@binkert.org                    0x7: MOVHPD(Mq,Vq);
3325517Snate@binkert.org            }
3335517Snate@binkert.org                // repne (0xF2)
3345517Snate@binkert.org                0x8: decode OPCODE_OP_BOTTOM3 {
3356654Snate@binkert.org                    0x0: MOVSD(Vq,Wq);
3366654Snate@binkert.org                    0x1: MOVSD(Wq,Vq);
3375517Snate@binkert.org                    0x2: MOVDDUP(Vo,Wq);
3385517Snate@binkert.org                    default: UD2();
3396143Snate@binkert.org                }
3406143Snate@binkert.org                default: UD2();
3416143Snate@binkert.org            }
3426727Ssteve.reinhardt@amd.com            0x03: decode OPCODE_OP_BOTTOM3 {
3435517Snate@binkert.org                //group16();
3446727Ssteve.reinhardt@amd.com                0x0: decode MODRM_REG {
3455517Snate@binkert.org                    0x0: WarnUnimpl::prefetch_nta();
3465517Snate@binkert.org                    0x1: PREFETCH_T0(Mb);
3475517Snate@binkert.org                    0x2: WarnUnimpl::prefetch_t1();
3486654Snate@binkert.org                    0x3: WarnUnimpl::prefetch_t2();
3496654Snate@binkert.org                    default: HINT_NOP();
3506654Snate@binkert.org                }
3516654Snate@binkert.org                0x1: HINT_NOP();
3526654Snate@binkert.org                0x2: HINT_NOP();
3536654Snate@binkert.org                0x3: HINT_NOP();
3545517Snate@binkert.org                0x4: HINT_NOP();
3555517Snate@binkert.org                0x5: HINT_NOP();
3565517Snate@binkert.org                0x6: HINT_NOP();
3576143Snate@binkert.org                0x7: HINT_NOP();
3585517Snate@binkert.org            }
3594762Snate@binkert.org            0x04: decode LEGACY_DECODEVAL {
3605517Snate@binkert.org                // no prefix
3615517Snate@binkert.org                0x0: decode OPCODE_OP_BOTTOM3 {
3626143Snate@binkert.org                    0x0: MOV(Rd,Cd);
3636143Snate@binkert.org                    0x1: MOV(Rd,Dd);
3645517Snate@binkert.org                    0x2: MOV(Cd,Rd);
3655517Snate@binkert.org                    0x3: MOV(Dd,Rd);
3665517Snate@binkert.org                    default: UD2();
3675517Snate@binkert.org                }
3685517Snate@binkert.org                // operand size (0x66)
3695517Snate@binkert.org                0x1: decode OPCODE_OP_BOTTOM3 {
3705517Snate@binkert.org                    0x0: MOV(Rd,Cd);
3715517Snate@binkert.org                    0x2: MOV(Cd,Rd);
3725517Snate@binkert.org                }
3735517Snate@binkert.org                default: UD2();
3746143Snate@binkert.org            }
3755517Snate@binkert.org            0x05: decode LEGACY_DECODEVAL {
3766654Snate@binkert.org                // no prefix
3776654Snate@binkert.org                0x0: decode OPCODE_OP_BOTTOM3 {
3786654Snate@binkert.org                    //These moves should really use size o (octword), but
3796654Snate@binkert.org                    //because they are split in two, they use q (quadword).
3806654Snate@binkert.org                    0x0: MOVAPS(Vq,Wq);
3816654Snate@binkert.org                    0x1: MOVAPS(Wq,Vq);
3825517Snate@binkert.org                    0x2: CVTPI2PS(Vq,Qq);
3835517Snate@binkert.org                    0x3: WarnUnimpl::movntps_Mo_Vo();
3845517Snate@binkert.org                    0x4: CVTTPS2PI(Pq,Wq);
3855517Snate@binkert.org                    0x5: CVTPS2PI(Pq,Wq);
3865517Snate@binkert.org                    0x6: UCOMISS(Vd,Wd);
3874762Snate@binkert.org                    0x7: COMISS(Vd,Wd);
3884762Snate@binkert.org                }
3894762Snate@binkert.org                // repe (0xF3)
3904762Snate@binkert.org                0x4: decode OPCODE_OP_BOTTOM3 {
3914762Snate@binkert.org                    0x2: CVTSI2SS(Vd,Ed);
3924762Snate@binkert.org                    0x4: CVTTSS2SI(Gd,Wd);
3936143Snate@binkert.org                    0x5: CVTSS2SI(Gd,Wd);
3944762Snate@binkert.org                    default: UD2();
3954762Snate@binkert.org                }
3964762Snate@binkert.org                // operand size (0x66)
3974762Snate@binkert.org                0x1: decode OPCODE_OP_BOTTOM3 {
3984382Sbinkertn@umich.edu                    0x0: MOVAPD(Vo,Wo);
3994382Sbinkertn@umich.edu                    0x1: MOVAPD(Wo,Vo);
4005517Snate@binkert.org                    0x2: CVTPI2PD(Vo,Qq);
4016654Snate@binkert.org                    0x3: WarnUnimpl::movntpd_Mo_Vo();
4025517Snate@binkert.org                    0x4: CVTTPD2PI(Pq,Wo);
4035798Snate@binkert.org                    0x5: CVTPD2PI(Pq,Wo);
4046654Snate@binkert.org                    0x6: UCOMISD(Vq,Wq);
4056654Snate@binkert.org                    0x7: COMISD(Vq,Wq);
4066654Snate@binkert.org                }
4076654Snate@binkert.org                // repne (0xF2)
4086654Snate@binkert.org                0x8: decode OPCODE_OP_BOTTOM3 {
4096654Snate@binkert.org                    // The size of the V operand should be q, not dp
4106654Snate@binkert.org                    0x2: CVTSI2SD(Vdp,Edp);
4116654Snate@binkert.org                    // The size of the W operand should be q, not dp
4126654Snate@binkert.org                    0x4: CVTTSD2SI(Gdp,Wdp);
4136654Snate@binkert.org                    0x5: CVTSD2SI(Gd,Wq);
4146669Snate@binkert.org                    default: UD2();
4156669Snate@binkert.org                }
4166669Snate@binkert.org                default: UD2();
4176669Snate@binkert.org            }
4186669Snate@binkert.org        }
4196669Snate@binkert.org        0x06: decode OPCODE_OP_BOTTOM3 {
4206654Snate@binkert.org            0x0: Inst::WRMSR();
4216654Snate@binkert.org            0x1: Inst::RDTSC();
4225517Snate@binkert.org            0x2: Inst::RDMSR();
4235863Snate@binkert.org            0x3: rdpmc();
4245798Snate@binkert.org            0x4: decode FullSystemInt {
4255798Snate@binkert.org                0: SyscallInst::sysenter('xc->syscall(Rax)',
4265798Snate@binkert.org                        IsSyscall, IsNonSpeculative, IsSerializeAfter);
4275798Snate@binkert.org                default: sysenter();
4285517Snate@binkert.org            }
4295517Snate@binkert.org            0x5: sysexit();
4305517Snate@binkert.org            0x6: Inst::UD2();
4315517Snate@binkert.org            0x7: getsec();
4325517Snate@binkert.org        }
4335517Snate@binkert.org        0x07: decode OPCODE_OP_BOTTOM3 {
4345517Snate@binkert.org            0x0: M5InternalError::error(
4355517Snate@binkert.org                {{"Three byte opcode shouldn't be handled by "
4365798Snate@binkert.org                  "two_byte_opcodes.isa!"}});
4375798Snate@binkert.org            0x2: M5InternalError::error(
4385798Snate@binkert.org                {{"Three byte opcode shouldn't be handled by "
4395798Snate@binkert.org                  "two_byte_opcodes.isa!"}});
4405798Snate@binkert.org            default: UD2();
4415798Snate@binkert.org        }
4425517Snate@binkert.org        format Inst {
4435517Snate@binkert.org            0x08: decode OPCODE_OP_BOTTOM3 {
4445517Snate@binkert.org                0x0: CMOVO(Gv,Ev);
4455517Snate@binkert.org                0x1: CMOVNO(Gv,Ev);
4465517Snate@binkert.org                0x2: CMOVB(Gv,Ev);
4475517Snate@binkert.org                0x3: CMOVNB(Gv,Ev);
4485517Snate@binkert.org                0x4: CMOVZ(Gv,Ev);
4495517Snate@binkert.org                0x5: CMOVNZ(Gv,Ev);
4505517Snate@binkert.org                0x6: CMOVBE(Gv,Ev);
4514762Snate@binkert.org                0x7: CMOVNBE(Gv,Ev);
4524382Sbinkertn@umich.edu            }
4536143Snate@binkert.org            0x09: decode OPCODE_OP_BOTTOM3 {
4545517Snate@binkert.org                0x0: CMOVS(Gv,Ev);
4554382Sbinkertn@umich.edu                0x1: CMOVNS(Gv,Ev);
4564382Sbinkertn@umich.edu                0x2: CMOVP(Gv,Ev);
4574762Snate@binkert.org                0x3: CMOVNP(Gv,Ev);
4584762Snate@binkert.org                0x4: CMOVL(Gv,Ev);
4594762Snate@binkert.org                0x5: CMOVNL(Gv,Ev);
4604762Snate@binkert.org                0x6: CMOVLE(Gv,Ev);
4614762Snate@binkert.org                0x7: CMOVNLE(Gv,Ev);
4625517Snate@binkert.org            }
4635517Snate@binkert.org            0x0A: decode LEGACY_DECODEVAL {
4645517Snate@binkert.org                // no prefix
4655517Snate@binkert.org                0x0: decode OPCODE_OP_BOTTOM3 {
4665517Snate@binkert.org                    0x0: MOVMSKPS(Gd,VRo);
4675517Snate@binkert.org                    0x1: SQRTPS(Vo,Wo);
4685517Snate@binkert.org                    0x2: WarnUnimpl::rqsrtps_Vo_Wo();
4695517Snate@binkert.org                    0x3: RCPPS(Vo,Wo);
4706143Snate@binkert.org                    0x4: ANDPS(Vo,Wo);
4715517Snate@binkert.org                    0x5: ANDNPS(Vo,Wo);
4725517Snate@binkert.org                    0x6: ORPS(Vo,Wo);
4735517Snate@binkert.org                    0x7: XORPS(Vo,Wo);
4745517Snate@binkert.org                }
4755517Snate@binkert.org                // repe (0xF3)
4765517Snate@binkert.org                0x4: decode OPCODE_OP_BOTTOM3 {
4775517Snate@binkert.org                    0x1: SQRTSS(Vd,Wd);
4785517Snate@binkert.org                    0x2: WarnUnimpl::rsqrtss_Vd_Wd();
4795517Snate@binkert.org                    0x3: RCPSS(Vd,Wd);
4805517Snate@binkert.org                    default: UD2();
4816143Snate@binkert.org                }
4825517Snate@binkert.org                // operand size (0x66)
4835517Snate@binkert.org                0x1: decode OPCODE_OP_BOTTOM3 {
4845517Snate@binkert.org                    0x0: MOVMSKPD(Gd,VRo);
4855517Snate@binkert.org                    0x1: SQRTPD(Vo,Wo);
4865517Snate@binkert.org                    0x4: ANDPD(Vo,Wo);
4875517Snate@binkert.org                    0x5: ANDNPD(Vo,Wo);
4885517Snate@binkert.org                    0x6: ORPD(Vo,Wo);
4895517Snate@binkert.org                    0x7: XORPD(Vo,Wo);
4905517Snate@binkert.org                    default: UD2();
4915517Snate@binkert.org                }
4925517Snate@binkert.org                // repne (0xF2)
4935517Snate@binkert.org                0x8: decode OPCODE_OP_BOTTOM3 {
4945517Snate@binkert.org                    0x1: SQRTSD(Vq,Wq);
4955517Snate@binkert.org                    default: UD2();
4965517Snate@binkert.org                }
4975517Snate@binkert.org                default: UD2();
4985517Snate@binkert.org            }
4995517Snate@binkert.org            0x0B: decode LEGACY_DECODEVAL {
5005517Snate@binkert.org                // no prefix
5016143Snate@binkert.org                0x0: decode OPCODE_OP_BOTTOM3 {
5025517Snate@binkert.org                    0x0: ADDPS(Vo,Wo);
5034762Snate@binkert.org                    0x1: MULPS(Vo,Wo);
5044762Snate@binkert.org                    0x2: CVTPS2PD(Vo,Wq);
5056143Snate@binkert.org                    0x3: CVTDQ2PS(Vo,Wo);
5066143Snate@binkert.org                    0x4: SUBPS(Vo,Wo);
5076143Snate@binkert.org                    0x5: MINPS(Vo,Wo);
5084762Snate@binkert.org                    0x6: DIVPS(Vo,Wo);
5094762Snate@binkert.org                    0x7: MAXPS(Vo,Wo);
5104762Snate@binkert.org                }
5115517Snate@binkert.org                // repe (0xF3)
5124762Snate@binkert.org                0x4: decode OPCODE_OP_BOTTOM3 {
5134762Snate@binkert.org                    0x0: ADDSS(Vd,Wd);
5144762Snate@binkert.org                    0x1: MULSS(Vd,Wd);
5155463Snate@binkert.org                    0x2: CVTSS2SD(Vq,Wd);
5165517Snate@binkert.org                    0x3: CVTTPS2DQ(Vo,Wo);
5176656Snate@binkert.org                    0x4: SUBSS(Vd,Wd);
5185463Snate@binkert.org                    0x5: MINSS(Vd,Wd);
5195517Snate@binkert.org                    0x6: DIVSS(Vd,Wd);
5204762Snate@binkert.org                    0x7: MAXSS(Vd,Wd);
5214762Snate@binkert.org                }
5224762Snate@binkert.org                // operand size (0x66)
5236143Snate@binkert.org                0x1: decode OPCODE_OP_BOTTOM3 {
5246143Snate@binkert.org                    0x0: ADDPD(Vo,Wo);
5256143Snate@binkert.org                    0x1: MULPD(Vo,Wo);
5264762Snate@binkert.org                    0x2: CVTPD2PS(Vo,Wo);
5274762Snate@binkert.org                    0x3: CVTPS2DQ(Vo,Wo);
5285517Snate@binkert.org                    0x4: SUBPD(Vo,Wo);
5294762Snate@binkert.org                    0x5: MINPD(Vo,Wo);
5304762Snate@binkert.org                    0x6: DIVPD(Vo,Wo);
5314762Snate@binkert.org                    0x7: MAXPD(Vo,Wo);
5324762Snate@binkert.org                }
5335517Snate@binkert.org                // repne (0xF2)
5344762Snate@binkert.org                0x8: decode OPCODE_OP_BOTTOM3 {
5354762Snate@binkert.org                    0x0: ADDSD(Vq,Wq);
5364762Snate@binkert.org                    0x1: MULSD(Vq,Wq);
5374762Snate@binkert.org                    0x2: CVTSD2SS(Vd,Wq);
5385517Snate@binkert.org                    0x4: SUBSD(Vq,Wq);
5395517Snate@binkert.org                    0x5: MINSD(Vq,Wq);
5405517Snate@binkert.org                    0x6: DIVSD(Vq,Wq);
5415517Snate@binkert.org                    0x7: MAXSD(Vq,Wq);
5425517Snate@binkert.org                    default: UD2();
5435517Snate@binkert.org                }
5445517Snate@binkert.org                default: UD2();
5455517Snate@binkert.org            }
5465517Snate@binkert.org            0x0C: decode LEGACY_DECODEVAL {
5475517Snate@binkert.org                // no prefix
5485517Snate@binkert.org                0x0: decode OPCODE_OP_BOTTOM3 {
5495517Snate@binkert.org                    0x0: PUNPCKLBW(Pq,Qd);
5505517Snate@binkert.org                    0x1: PUNPCKLWD(Pq,Qd);
5515517Snate@binkert.org                    0x2: PUNPCKLDQ(Pq,Qd);
5525517Snate@binkert.org                    0x3: PACKSSWB(Pq,Qq);
5535517Snate@binkert.org                    0x4: PCMPGTB(Pq,Qq);
5545517Snate@binkert.org                    0x5: PCMPGTW(Pq,Qq);
5555517Snate@binkert.org                    0x6: PCMPGTD(Pq,Qq);
5565517Snate@binkert.org                    0x7: PACKUSWB(Pq,Qq);
5575517Snate@binkert.org                }
5585517Snate@binkert.org                // operand size (0x66)
5595517Snate@binkert.org                0x1: decode OPCODE_OP_BOTTOM3 {
5605517Snate@binkert.org                    0x0: PUNPCKLBW(Vo,Wq);
5615517Snate@binkert.org                    0x1: PUNPCKLWD(Vo,Wq);
5625517Snate@binkert.org                    0x2: PUNPCKLDQ(Vo,Wq);
5635517Snate@binkert.org                    0x3: PACKSSWB(Vo,Wo);
5645517Snate@binkert.org                    0x4: PCMPGTB(Vo,Wo);
5655517Snate@binkert.org                    0x5: PCMPGTW(Vo,Wo);
5665517Snate@binkert.org                    0x6: PCMPGTD(Vo,Wo);
5675517Snate@binkert.org                    0x7: PACKUSWB(Vo,Wo);
5685517Snate@binkert.org                }
5695517Snate@binkert.org                default: UD2();
5705517Snate@binkert.org            }
5715517Snate@binkert.org            0x0D: decode LEGACY_DECODEVAL {
5725517Snate@binkert.org                // no prefix
5735517Snate@binkert.org                0x0: decode OPCODE_OP_BOTTOM3 {
5745517Snate@binkert.org                    0x0: PUNPCKHBW(Pq,Qq);
5755517Snate@binkert.org                    0x1: PUNPCKHWD(Pq,Qq);
5765517Snate@binkert.org                    0x2: PUNPCKHDQ(Pq,Qq);
5775517Snate@binkert.org                    0x3: PACKSSDW(Pq,Qq);
5785517Snate@binkert.org                    0x6: MOVD(Pq,Edp);
5795517Snate@binkert.org                    0x7: MOVQ(Pq,Qq);
5805517Snate@binkert.org                    default: UD2();
5815517Snate@binkert.org                }
5825517Snate@binkert.org                // repe (0xF3)
5835517Snate@binkert.org                0x4: decode OPCODE_OP_BOTTOM3 {
5845517Snate@binkert.org                    0x7: MOVDQU(Vo,Wo);
5855517Snate@binkert.org                    default: UD2();
5865517Snate@binkert.org                }
5875517Snate@binkert.org                // operand size (0x66)
5885517Snate@binkert.org                0x1: decode OPCODE_OP_BOTTOM3 {
5895517Snate@binkert.org                    0x0: PUNPCKHBW(Vo,Wo);
5905517Snate@binkert.org                    0x1: PUNPCKHWD(Vo,Wo);
5915517Snate@binkert.org                    0x2: PUNPCKHDQ(Vo,Wo);
5925517Snate@binkert.org                    0x3: PACKSSDW(Vo,Wo);
5935517Snate@binkert.org                    0x4: PUNPCKLQDQ(Vo,Wq);
5945517Snate@binkert.org                    0x5: PUNPCKHQDQ(Vo,Wq);
5955517Snate@binkert.org                    0x6: MOVD(Vo,Edp);
5965517Snate@binkert.org                    0x7: MOVDQA(Vo,Wo);
5975517Snate@binkert.org                }
5985517Snate@binkert.org                default: UD2();
5995517Snate@binkert.org            }
6005517Snate@binkert.org            0x0E: decode LEGACY_DECODEVAL {
6015517Snate@binkert.org                // no prefix
6025517Snate@binkert.org                0x0: decode OPCODE_OP_BOTTOM3 {
6035517Snate@binkert.org                    0x0: PSHUFW(Pq,Qq,Ib);
6045610Snate@binkert.org                    //0x1: group12_pshimw();
6055623Snate@binkert.org                    0x1: decode MODRM_REG {
6065623Snate@binkert.org                        0x2: PSRLW(PRq,Ib);
6075623Snate@binkert.org                        0x4: PSRAW(PRq,Ib);
6085610Snate@binkert.org                        0x6: PSLLW(PRq,Ib);
6095517Snate@binkert.org                        default: UD2();
6105623Snate@binkert.org                    }
6115623Snate@binkert.org                    //0x2: group13_pshimd();
6125623Snate@binkert.org                    0x2: decode MODRM_REG {
6135623Snate@binkert.org                        0x2: PSRLD(PRq,Ib);
6145623Snate@binkert.org                        0x4: PSRAD(PRq,Ib);
6155623Snate@binkert.org                        0x6: PSLLD(PRq,Ib);
6165623Snate@binkert.org                        default: UD2();
6175517Snate@binkert.org                    }
6185610Snate@binkert.org                    //0x3: group14_pshimq();
6195610Snate@binkert.org                    0x3: decode MODRM_REG {
6205610Snate@binkert.org                        0x2: PSRLQ(PRq,Ib);
6215610Snate@binkert.org                        0x6: PSLLQ(PRq,Ib);
6225517Snate@binkert.org                        default: Inst::UD2();
6235517Snate@binkert.org                    }
6245610Snate@binkert.org                    0x4: Inst::PCMPEQB(Pq,Qq);
6255610Snate@binkert.org                    0x5: Inst::PCMPEQW(Pq,Qq);
6265517Snate@binkert.org                    0x6: Inst::PCMPEQD(Pq,Qq);
6275517Snate@binkert.org                    0x7: Inst::EMMS();
6285517Snate@binkert.org                }
6295517Snate@binkert.org                // repe (0xF3)
6305517Snate@binkert.org                0x4: decode OPCODE_OP_BOTTOM3 {
6315517Snate@binkert.org                    0x0: PSHUFHW(Vo,Wo,Ib);
6325517Snate@binkert.org                    default: UD2();
6335517Snate@binkert.org                }
6345517Snate@binkert.org                // operand size (0x66)
6355517Snate@binkert.org                0x1: decode OPCODE_OP_BOTTOM3 {
6364762Snate@binkert.org                    0x0: PSHUFD(Vo,Wo,Ib);
6376143Snate@binkert.org                    //0x1: group12_pshimw();
6386143Snate@binkert.org                    0x1: decode MODRM_REG {
6395463Snate@binkert.org                        0x2: PSRLW(VRo,Ib);
6404762Snate@binkert.org                        0x4: PSRAW(VRo,Ib);
6414762Snate@binkert.org                        0x6: PSLLW(VRo,Ib);
6424762Snate@binkert.org                    }
6436143Snate@binkert.org                    //0x2: group13_pshimd();
6446143Snate@binkert.org                    0x2: decode MODRM_REG {
6454382Sbinkertn@umich.edu                        0x2: PSRLD(VRo,Ib);
6464382Sbinkertn@umich.edu                        0x4: PSRAD(VRo,Ib);
6476143Snate@binkert.org                        0x6: PSLLD(VRo,Ib);
6486143Snate@binkert.org                        default: UD2();
6494382Sbinkertn@umich.edu                    }
6504762Snate@binkert.org                    //0x3: group14_pshimq();
6515517Snate@binkert.org                    0x3: decode MODRM_REG {
6525517Snate@binkert.org                        0x2: PSRLQ(VRo,Ib);
6535517Snate@binkert.org                        0x3: PSRLDQ(VRo,Ib);
6545517Snate@binkert.org                        0x6: PSLLQ(VRo,Ib);
6555517Snate@binkert.org                        0x7: PSLLDQ(VRo,Ib);
6565517Snate@binkert.org                        default: UD2();
6575522Snate@binkert.org                    }
6585517Snate@binkert.org                    0x4: PCMPEQB(Vo,Wo);
6595517Snate@binkert.org                    0x5: PCMPEQW(Vo,Wo);
6605517Snate@binkert.org                    0x6: PCMPEQD(Vo,Wo);
6615517Snate@binkert.org                    default: UD2();
6625517Snate@binkert.org                }
6636143Snate@binkert.org                // repne (0xF2)
6646143Snate@binkert.org                0x8: decode OPCODE_OP_BOTTOM3 {
6656143Snate@binkert.org                    0x0: PSHUFLW(Vo,Wo,Ib);
6665522Snate@binkert.org                    default: UD2();
6674382Sbinkertn@umich.edu                }
6686229Snate@binkert.org                default: UD2();
6696229Snate@binkert.org            }
6706229Snate@binkert.org            0x0F: decode LEGACY_DECODEVAL {
6716229Snate@binkert.org                // no prefix
6726229Snate@binkert.org                0x0: decode OPCODE_OP_BOTTOM3 {
6736229Snate@binkert.org                    0x0: WarnUnimpl::vmread_Edp_Gdp();
6746229Snate@binkert.org                    0x1: WarnUnimpl::vmwrite_Gdp_Edp();
6756229Snate@binkert.org                    0x6: MOVD(Edp,Pdp);
6766229Snate@binkert.org                    0x7: MOVQ(Qq,Pq);
6776229Snate@binkert.org                    default: UD2();
6786229Snate@binkert.org                }
6796229Snate@binkert.org                // repe (0xF3)
6806229Snate@binkert.org                0x4: decode OPCODE_OP_BOTTOM3 {
6816229Snate@binkert.org                    0x6: MOVQ(Vq,Wq);
6826229Snate@binkert.org                    0x7: MOVDQU(Wo,Vo);
6836229Snate@binkert.org                    default: UD2();
6846229Snate@binkert.org                }
6856229Snate@binkert.org                // operand size (0x66)
6866229Snate@binkert.org                0x1: decode OPCODE_OP_BOTTOM3 {
6876229Snate@binkert.org                    0x4: HADDPD(Vo,Wo);
6886229Snate@binkert.org                    0x5: WarnUnimpl::hsubpd_Vo_Wo();
6895192Ssaidi@eecs.umich.edu                    0x6: MOVD(Edp,Vd);
6905517Snate@binkert.org                    0x7: MOVDQA(Wo,Vo);
6915517Snate@binkert.org                    default: UD2();
6925517Snate@binkert.org                }
6935517Snate@binkert.org                // repne (0xF2)
6946229Snate@binkert.org                0x8: decode OPCODE_OP_BOTTOM3 {
6956229Snate@binkert.org                    0x4: HADDPS(Vo,Wo);
6965799Snate@binkert.org                    0x5: WarnUnimpl::hsubps_Vo_Wo();
6975799Snate@binkert.org                    default: UD2();
6985517Snate@binkert.org                }
6995517Snate@binkert.org                default: UD2();
7005517Snate@binkert.org            }
7015517Snate@binkert.org            0x10: decode OPCODE_OP_BOTTOM3 {
7025517Snate@binkert.org                0x0: JO(Jz);
7035517Snate@binkert.org                0x1: JNO(Jz);
7045799Snate@binkert.org                0x2: JB(Jz);
7055517Snate@binkert.org                0x3: JNB(Jz);
7065517Snate@binkert.org                0x4: JZ(Jz);
7075517Snate@binkert.org                0x5: JNZ(Jz);
7085517Snate@binkert.org                0x6: JBE(Jz);
7095517Snate@binkert.org                0x7: JNBE(Jz);
7105517Snate@binkert.org            }
7115517Snate@binkert.org            0x11: decode OPCODE_OP_BOTTOM3 {
7125799Snate@binkert.org                0x0: JS(Jz);
7135517Snate@binkert.org                0x1: JNS(Jz);
7145517Snate@binkert.org                0x2: JP(Jz);
7155799Snate@binkert.org                0x3: JNP(Jz);
7165517Snate@binkert.org                0x4: JL(Jz);
7175517Snate@binkert.org                0x5: JNL(Jz);
7185517Snate@binkert.org                0x6: JLE(Jz);
7195517Snate@binkert.org                0x7: JNLE(Jz);
7205517Snate@binkert.org            }
7215517Snate@binkert.org            0x12: decode OPCODE_OP_BOTTOM3 {
7225517Snate@binkert.org                0x0: SETO(Eb);
7235517Snate@binkert.org                0x1: SETNO(Eb);
7245799Snate@binkert.org                0x2: SETB(Eb);
7255517Snate@binkert.org                0x3: SETNB(Eb);
7265517Snate@binkert.org                0x4: SETZ(Eb);
7275517Snate@binkert.org                0x5: SETNZ(Eb);
7285517Snate@binkert.org                0x6: SETBE(Eb);
7295517Snate@binkert.org                0x7: SETNBE(Eb);
7305517Snate@binkert.org            }
7315517Snate@binkert.org            0x13: decode OPCODE_OP_BOTTOM3 {
7325517Snate@binkert.org                0x0: SETS(Eb);
7335517Snate@binkert.org                0x1: SETNS(Eb);
7345517Snate@binkert.org                0x2: SETP(Eb);
7355517Snate@binkert.org                0x3: SETNP(Eb);
7365517Snate@binkert.org                0x4: SETL(Eb);
7376229Snate@binkert.org                0x5: SETNL(Eb);
7385517Snate@binkert.org                0x6: SETLE(Eb);
7395517Snate@binkert.org                0x7: SETNLE(Eb);
7405517Snate@binkert.org            }
7415517Snate@binkert.org        }
7425517Snate@binkert.org        0x14: decode OPCODE_OP_BOTTOM3 {
7435517Snate@binkert.org            0x0: push_fs();
7445517Snate@binkert.org            0x1: pop_fs();
7455517Snate@binkert.org            0x2: CPUIDInst::CPUID({{
7465517Snate@binkert.org                CpuidResult result;
7475517Snate@binkert.org                bool success = doCpuid(xc->tcBase(), bits(Rax, 31, 0),
7485517Snate@binkert.org                    bits(Rcx, 31, 0), result);
7495517Snate@binkert.org                if (success) {
7505517Snate@binkert.org                    Rax = result.rax;
7515517Snate@binkert.org                    Rbx = result.rbx;
7525517Snate@binkert.org                    Rcx = result.rcx;
7535517Snate@binkert.org                    Rdx = result.rdx;
7545517Snate@binkert.org                } else {
7555517Snate@binkert.org                    Rax = Rax;
7565517Snate@binkert.org                    Rbx = Rbx;
7575517Snate@binkert.org                    Rcx = Rcx;
7585517Snate@binkert.org                    Rdx = Rdx;
7595517Snate@binkert.org                }
7605517Snate@binkert.org                }});
7615517Snate@binkert.org            0x3: Inst::BT(Ev,Gv);
7625517Snate@binkert.org            0x4: Inst::SHLD(Ev,Gv,Ib);
7635517Snate@binkert.org            0x5: Inst::SHLD(Ev,Gv);
7645517Snate@binkert.org            default: Inst::UD2();
7655517Snate@binkert.org        }
7665517Snate@binkert.org        0x15: decode OPCODE_OP_BOTTOM3 {
7675517Snate@binkert.org            0x0: push_gs();
7685517Snate@binkert.org            0x1: pop_gs();
7695517Snate@binkert.org            0x2: rsm_smm();
7705517Snate@binkert.org            0x3: Inst::BTS(Ev,Gv);
7715517Snate@binkert.org            0x4: Inst::SHRD(Ev,Gv,Ib);
7725517Snate@binkert.org            0x5: Inst::SHRD(Ev,Gv);
7735517Snate@binkert.org            //0x6: group15();
7745517Snate@binkert.org            0x6: decode MODRM_MOD {
7755517Snate@binkert.org                0x3: decode MODRM_REG {
7765517Snate@binkert.org                    0x5: BasicOperate::LFENCE(
7775517Snate@binkert.org                                 {{/*Nothing*/}}, IsReadBarrier);
7785517Snate@binkert.org                    0x6: BasicOperate::MFENCE(
7795517Snate@binkert.org                                 {{/*Nothing*/}}, IsMemBarrier);
7805517Snate@binkert.org                    0x7: BasicOperate::SFENCE(
7815517Snate@binkert.org                                 {{/*Nothing*/}}, IsWriteBarrier);
7825517Snate@binkert.org                    default: Inst::UD2();
7835517Snate@binkert.org                }
7845517Snate@binkert.org                default: decode MODRM_REG {
7855517Snate@binkert.org                    0x0: decode OPSIZE {
7865517Snate@binkert.org                        4: Inst::FXSAVE(M);
7875517Snate@binkert.org                        8: Inst::FXSAVE64(M);
7885517Snate@binkert.org                        default: fxsave();
7895517Snate@binkert.org                    }
7905517Snate@binkert.org                    0x1: decode OPSIZE {
7915517Snate@binkert.org                        4: Inst::FXRSTOR(M);
7925517Snate@binkert.org                        8: Inst::FXRSTOR64(M);
7935517Snate@binkert.org                        default: fxrstor();
7945517Snate@binkert.org                    }
7955517Snate@binkert.org                    0x2: Inst::LDMXCSR(Md);
7965517Snate@binkert.org                    0x3: Inst::STMXCSR(Md);
7975517Snate@binkert.org                    0x4: xsave();
7985517Snate@binkert.org                    0x5: xrstor();
7995517Snate@binkert.org                    0x6: Inst::UD2();
8005517Snate@binkert.org                    0x7: clflush();
8015517Snate@binkert.org                }
8025517Snate@binkert.org            }
8035517Snate@binkert.org            0x7: Inst::IMUL(Gv,Ev);
8045517Snate@binkert.org        }
8055517Snate@binkert.org        format Inst {
8065517Snate@binkert.org            0x16: decode OPCODE_OP_BOTTOM3 {
8075517Snate@binkert.org                0x0: CMPXCHG(Eb,Gb);
8085517Snate@binkert.org                0x1: CMPXCHG(Ev,Gv);
8095517Snate@binkert.org                0x2: WarnUnimpl::lss_Gz_Mp();
8106229Snate@binkert.org                0x3: BTR(Ev,Gv);
8115517Snate@binkert.org                0x4: WarnUnimpl::lfs_Gz_Mp();
8125517Snate@binkert.org                0x5: WarnUnimpl::lgs_Gz_Mp();
8135517Snate@binkert.org                //The size of the second operand in these instructions
8145517Snate@binkert.org                //should really be "b" or "w", but it's set to v in order
8155517Snate@binkert.org                //to have a consistent register size. This shouldn't
8165517Snate@binkert.org                //affect behavior.
8175517Snate@binkert.org                0x6: MOVZX_B(Gv,Ev);
8185517Snate@binkert.org                0x7: MOVZX_W(Gv,Ev);
8195517Snate@binkert.org            }
8205517Snate@binkert.org            0x17: decode OPCODE_OP_BOTTOM3 {
8215517Snate@binkert.org                0x0: decode LEGACY_REP {
8225517Snate@binkert.org                    0x0: WarnUnimpl::jmpe_Jz();
8235517Snate@binkert.org                    0x1: WarnUnimpl::popcnt_Gv_Ev();
8245517Snate@binkert.org                }
8255517Snate@binkert.org                //0x1: group10_UD2();
8265517Snate@binkert.org                0x1: UD2();
8275517Snate@binkert.org                //0x2: group8_Ev_Ib();
8285517Snate@binkert.org                0x2: decode MODRM_REG {
8295517Snate@binkert.org                    0x4: BT(Ev,Ib);
8305517Snate@binkert.org                    0x5: BTS(Ev,Ib);
8315517Snate@binkert.org                    0x6: BTR(Ev,Ib);
8325517Snate@binkert.org                    0x7: BTC(Ev,Ib);
8335517Snate@binkert.org                    default: UD2();
8345517Snate@binkert.org                }
8355517Snate@binkert.org                0x3: BTC(Ev,Gv);
8365517Snate@binkert.org                0x4: BSF(Gv,Ev);
8375517Snate@binkert.org                0x5: BSR(Gv,Ev);
8385517Snate@binkert.org                //The size of the second operand in these instructions
8395517Snate@binkert.org                //should really be "b" or "w", but it's set to v in order
8405517Snate@binkert.org                //to have a consistent register size. This shouldn't
8415517Snate@binkert.org                //affect behavior.
8425517Snate@binkert.org                0x6: MOVSX_B(Gv,Ev);
8435517Snate@binkert.org                0x7: MOVSX_W(Gv,Ev);
8445517Snate@binkert.org            }
8455517Snate@binkert.org            0x18: decode OPCODE_OP_BOTTOM3 {
8465517Snate@binkert.org                0x0: XADD(Eb,Gb);
8475517Snate@binkert.org                0x1: XADD(Ev,Gv);
8485517Snate@binkert.org                //0x7: group9();
8495517Snate@binkert.org                0x7: decode MODRM_REG {
8505517Snate@binkert.org                    //Also CMPXCHG16B
8515517Snate@binkert.org                    0x1: CMPXCHG8B(Mdp);
8525517Snate@binkert.org                    0x6: decode LEGACY_OP {
8535517Snate@binkert.org                        0x1: WarnUnimpl::vmclear_Mq();
8545517Snate@binkert.org                        default: decode LEGACY_REP {
8555517Snate@binkert.org                            0x1: WarnUnimpl::vmxon_Mq();
8565517Snate@binkert.org                            0x0: WarnUnimpl::vmptrld_Mq();
8575517Snate@binkert.org                        }
8585517Snate@binkert.org                    }
8595517Snate@binkert.org                    0x7: WarnUnimpl::vmptrst_Mq();
8605517Snate@binkert.org                    default: UD2();
8615517Snate@binkert.org                }
8625517Snate@binkert.org                default: decode LEGACY_DECODEVAL {
8635517Snate@binkert.org                    // no prefix
8645517Snate@binkert.org                    0x0: decode OPCODE_OP_BOTTOM3 {
8655517Snate@binkert.org                        0x2: CMPPS(Vo,Wo,Ib);
8665517Snate@binkert.org                        0x3: MOVNTI(Mdp,Gdp);
8675517Snate@binkert.org                        0x4: PINSRW(Pq,Ew,Ib);
8685517Snate@binkert.org                        0x5: PEXTRW(Gd,PRq,Ib);
8695517Snate@binkert.org                        0x6: SHUFPS(Vps,Wps,Ib);
8705517Snate@binkert.org                    }
8715517Snate@binkert.org                    // repe (0xF3)
8726143Snate@binkert.org                    0x4: decode OPCODE_OP_BOTTOM3 {
8735517Snate@binkert.org                        0x2: CMPSS(Vd,Wd,Ib);
8745192Ssaidi@eecs.umich.edu                        default: UD2();
8755192Ssaidi@eecs.umich.edu                    }
8765517Snate@binkert.org                    // operand size (0x66)
8775517Snate@binkert.org                    0x1: decode OPCODE_OP_BOTTOM3 {
8785192Ssaidi@eecs.umich.edu                        0x2: CMPPD(Vo,Wo,Ib);
8795192Ssaidi@eecs.umich.edu                        0x4: PINSRW(Vdw,Ew,Ib);
8805522Snate@binkert.org                        0x5: PEXTRW(Gd,VRdq,Ib);
8815522Snate@binkert.org                        0x6: SHUFPD(Vpd,Wpd,Ib);
8825522Snate@binkert.org                        default: UD2();
8835522Snate@binkert.org                    }
8845522Snate@binkert.org                    // repne (0xF2)
8855522Snate@binkert.org                    0x8: decode OPCODE_OP_BOTTOM3 {
8865522Snate@binkert.org                        0x2: CMPSD(Vq,Wq,Ib);
8875522Snate@binkert.org                        default: UD2();
8885522Snate@binkert.org                    }
8895522Snate@binkert.org                    default: UD2();
8905517Snate@binkert.org                }
8915522Snate@binkert.org            }
8925522Snate@binkert.org            0x19: decode OPSIZE {
8935517Snate@binkert.org                4: BSWAP_D(Bd);
8946143Snate@binkert.org                8: BSWAP_Q(Bq);
8956727Ssteve.reinhardt@amd.com                default: UD2();
8965522Snate@binkert.org            }
8975522Snate@binkert.org            0x1A: decode LEGACY_DECODEVAL {
8985522Snate@binkert.org                // no prefix
8995517Snate@binkert.org                0x0: decode OPCODE_OP_BOTTOM3 {
9005522Snate@binkert.org                    0x1: PSRLW(Pq,Qq);
9015522Snate@binkert.org                    0x2: PSRLD(Pq,Qq);
9025522Snate@binkert.org                    0x3: PSRLQ(Pq,Qq);
9035522Snate@binkert.org                    0x4: PADDQ(Pq,Qq);
9045522Snate@binkert.org                    0x5: PMULLW(Pq,Qq);
9055522Snate@binkert.org                    0x7: PMOVMSKB(Gd,PRq);
9065522Snate@binkert.org                    default: UD2();
9075522Snate@binkert.org                }
9085522Snate@binkert.org                // repe (0xF3)
9095522Snate@binkert.org                0x4: decode OPCODE_OP_BOTTOM3 {
9105522Snate@binkert.org                    0x6: MOVQ2DQ(Vo,PRq);
9115522Snate@binkert.org                    default: UD2();
9125522Snate@binkert.org                }
9135522Snate@binkert.org                // operand size (0x66)
9145522Snate@binkert.org                0x1: decode OPCODE_OP_BOTTOM3 {
9155522Snate@binkert.org                    0x0: ADDSUBPD(Vo,Wo);
9165522Snate@binkert.org                    0x1: PSRLW(Vo,Wo);
9175522Snate@binkert.org                    0x2: PSRLD(Vo,Wo);
9185522Snate@binkert.org                    0x3: PSRLQ(Vo,Wo);
9196143Snate@binkert.org                    0x4: PADDQ(Vo,Wo);
9205522Snate@binkert.org                    0x5: PMULLW(Vo,Wo);
9215522Snate@binkert.org                    0x6: MOVQ(Wq,Vq);
9224382Sbinkertn@umich.edu                    0x7: PMOVMSKB(Gd,VRo);
9235522Snate@binkert.org                }
9245522Snate@binkert.org                // repne (0xF2)
9255522Snate@binkert.org                0x8: decode OPCODE_OP_BOTTOM3 {
9265522Snate@binkert.org                    0x0: WarnUnimpl::addsubps_Vo_Wo();
9275522Snate@binkert.org                    0x6: MOVDQ2Q(Pq,VRq);
9285522Snate@binkert.org                    default: UD2();
9295522Snate@binkert.org                }
9304382Sbinkertn@umich.edu                default: UD2();
9315522Snate@binkert.org            }
9326143Snate@binkert.org            0x1B: decode LEGACY_DECODEVAL {
9335522Snate@binkert.org                // no prefix
9345522Snate@binkert.org                0x0: decode OPCODE_OP_BOTTOM3 {
9355522Snate@binkert.org                    0x0: PSUBUSB(Pq,Qq);
9365522Snate@binkert.org                    0x1: PSUBUSW(Pq,Qq);
9375522Snate@binkert.org                    0x2: PMINUB(Pq,Qq);
9385522Snate@binkert.org                    0x3: PAND(Pq,Qq);
9395522Snate@binkert.org                    0x4: PADDUSB(Pq,Qq);
9405522Snate@binkert.org                    0x5: PADDUSW(Pq,Qq);
9415522Snate@binkert.org                    0x6: PMAXUB(Pq,Qq);
9425522Snate@binkert.org                    0x7: PANDN(Pq,Qq);
9435522Snate@binkert.org                }
9445522Snate@binkert.org                // operand size (0x66)
9455522Snate@binkert.org                0x1: decode OPCODE_OP_BOTTOM3 {
9465522Snate@binkert.org                    0x0: PSUBUSB(Vo,Wo);
9475522Snate@binkert.org                    0x1: PSUBUSW(Vo,Wo);
9485522Snate@binkert.org                    0x2: PMINUB(Vo,Wo);
9495522Snate@binkert.org                    0x3: PAND(Vo,Wo);
9505522Snate@binkert.org                    0x4: PADDUSB(Vo,Wo);
9515522Snate@binkert.org                    0x5: PADDUSW(Vo,Wo);
9525522Snate@binkert.org                    0x6: PMAXUB(Vo,Wo);
9535522Snate@binkert.org                    0x7: PANDN(Vo,Wo);
9545522Snate@binkert.org                }
9555522Snate@binkert.org                default: UD2();
9565522Snate@binkert.org            }
9575522Snate@binkert.org            0x1C: decode LEGACY_DECODEVAL {
9585522Snate@binkert.org                // no prefix
9596143Snate@binkert.org                0x0: decode OPCODE_OP_BOTTOM3 {
9606143Snate@binkert.org                    0x0: PAVGB(Pq,Qq);
9616143Snate@binkert.org                    0x1: PSRAW(Pq,Qq);
9626143Snate@binkert.org                    0x2: PSRAD(Pq,Qq);
9635522Snate@binkert.org                    0x3: PAVGW(Pq,Qq);
9644382Sbinkertn@umich.edu                    0x4: PMULHUW(Pq,Qq);
9654382Sbinkertn@umich.edu                    0x5: PMULHW(Pq,Qq);
9664382Sbinkertn@umich.edu                    0x7: WarnUnimpl::movntq_Mq_Pq();
9674382Sbinkertn@umich.edu                    default: UD2();
9684382Sbinkertn@umich.edu                }
9694382Sbinkertn@umich.edu                // repe (0xF3)
9704382Sbinkertn@umich.edu                0x4: decode OPCODE_OP_BOTTOM3 {
9714382Sbinkertn@umich.edu                    0x6: CVTDQ2PD(Vo,Wq);
9724382Sbinkertn@umich.edu                    default: UD2();
9734382Sbinkertn@umich.edu                }
9746143Snate@binkert.org                // operand size (0x66)
975955SN/A                0x1: decode OPCODE_OP_BOTTOM3 {
9762655Sstever@eecs.umich.edu                    0x0: PAVGB(Vo,Wo);
9772655Sstever@eecs.umich.edu                    0x1: PSRAW(Vo,Wo);
9782655Sstever@eecs.umich.edu                    0x2: PSRAD(Vo,Wo);
9792655Sstever@eecs.umich.edu                    0x3: PAVGW(Vo,Wo);
9802655Sstever@eecs.umich.edu                    0x4: PMULHUW(Vo,Wo);
9815601Snate@binkert.org                    0x5: PMULHW(Vo,Wo);
9825601Snate@binkert.org                    0x6: CVTTPD2DQ(Vo,Wo);
9835601Snate@binkert.org                    0x7: WarnUnimpl::movntdq_Mo_Vo();
9845601Snate@binkert.org                }
9855522Snate@binkert.org                // repne (0xF2)
9865863Snate@binkert.org                0x8: decode OPCODE_OP_BOTTOM3 {
9875601Snate@binkert.org                    0x6: CVTPD2DQ(Vo,Wo);
9885601Snate@binkert.org                    default: UD2();
9895601Snate@binkert.org                }
9905863Snate@binkert.org                default: UD2();
9916143Snate@binkert.org            }
9925559Snate@binkert.org            0x1D: decode LEGACY_DECODEVAL {
9935559Snate@binkert.org                // no prefix
9945559Snate@binkert.org                0x0: decode OPCODE_OP_BOTTOM3 {
9955559Snate@binkert.org                    0x0: PSUBSB(Pq,Qq);
9965601Snate@binkert.org                    0x1: PSUBSW(Pq,Qq);
9976143Snate@binkert.org                    0x2: PMINSW(Pq,Qq);
9986143Snate@binkert.org                    0x3: POR(Pq,Qq);
9996143Snate@binkert.org                    0x4: PADDSB(Pq,Qq);
10006143Snate@binkert.org                    0x5: PADDSW(Pq,Qq);
10016143Snate@binkert.org                    0x6: PMAXSW(Pq,Qq);
10026143Snate@binkert.org                    0x7: PXOR(Pq,Qq);
10036143Snate@binkert.org                }
10046143Snate@binkert.org                // operand size (0x66)
10056143Snate@binkert.org                0x1: decode OPCODE_OP_BOTTOM3 {
10066143Snate@binkert.org                    0x0: PSUBSB(Vo,Wo);
10076143Snate@binkert.org                    0x1: PSUBSW(Vo,Wo);
10086143Snate@binkert.org                    0x2: PMINSW(Vo,Wo);
10096143Snate@binkert.org                    0x3: POR(Vo,Wo);
10106143Snate@binkert.org                    0x4: PADDSB(Vo,Wo);
10116143Snate@binkert.org                    0x5: PADDSW(Vo,Wo);
10126143Snate@binkert.org                    0x6: PMAXSW(Vo,Wo);
10136143Snate@binkert.org                    0x7: PXOR(Vo,Wo);
10146143Snate@binkert.org                }
10156143Snate@binkert.org                default: UD2();
10166143Snate@binkert.org            }
10176143Snate@binkert.org            0x1E: decode LEGACY_DECODEVAL {
10186143Snate@binkert.org                // no prefix
10196143Snate@binkert.org                0x0: decode OPCODE_OP_BOTTOM3 {
10206143Snate@binkert.org                    0x1: PSLLW(Pq,Qq);
10216143Snate@binkert.org                    0x2: PSLLD(Pq,Qq);
10226143Snate@binkert.org                    0x3: PSLLQ(Pq,Qq);
10236143Snate@binkert.org                    0x4: PMULUDQ(Pq,Qq);
10246143Snate@binkert.org                    0x5: PMADDWD(Pq,Qq);
10256143Snate@binkert.org                    0x6: PSADBW(Pq,Qq);
10266143Snate@binkert.org                    0x7: MASKMOVQ(Pq,PRq);
10276143Snate@binkert.org                    default: UD2();
10286143Snate@binkert.org                }
10296240Snate@binkert.org                // operand size (0x66)
10305554Snate@binkert.org                0x1: decode OPCODE_OP_BOTTOM3 {
10315522Snate@binkert.org                    0x1: PSLLW(Vo,Wo);
10325522Snate@binkert.org                    0x2: PSLLD(Vo,Wo);
10335797Snate@binkert.org                    0x3: PSLLQ(Vo,Wo);
10345797Snate@binkert.org                    0x4: PMULUDQ(Vo,Wo);
10355522Snate@binkert.org                    0x5: PMADDWD(Vo,Wo);
10365584Snate@binkert.org                    0x6: PSADBW(Vo,Wo);
10376143Snate@binkert.org                    0x7: MASKMOVDQU(Vo,VRo);
10385862Snate@binkert.org                    default: UD2();
10395584Snate@binkert.org                }
10405601Snate@binkert.org                // repne (0xF2)
10416143Snate@binkert.org                0x8: decode OPCODE_OP_BOTTOM3 {
10426143Snate@binkert.org                    0x0: WarnUnimpl::lddqu_Vo_Mo();
10432655Sstever@eecs.umich.edu                    default: UD2();
10446143Snate@binkert.org                }
10456143Snate@binkert.org                default: UD2();
10466143Snate@binkert.org            }
10476143Snate@binkert.org            0x1F: decode LEGACY_DECODEVAL {
10486143Snate@binkert.org                // no prefix
10494007Ssaidi@eecs.umich.edu                0x0: decode OPCODE_OP_BOTTOM3 {
10504596Sbinkertn@umich.edu                    0x0: PSUBB(Pq,Qq);
10514007Ssaidi@eecs.umich.edu                    0x1: PSUBW(Pq,Qq);
10524596Sbinkertn@umich.edu                    0x2: PSUBD(Pq,Qq);
10536143Snate@binkert.org                    0x3: PSUBQ(Pq,Qq);
10545522Snate@binkert.org                    0x4: PADDB(Pq,Qq);
10555601Snate@binkert.org                    0x5: PADDW(Pq,Qq);
10565601Snate@binkert.org                    0x6: PADDD(Pq,Qq);
10572655Sstever@eecs.umich.edu                    0x7: UD2();
1058955SN/A                }
10593918Ssaidi@eecs.umich.edu                // operand size (0x66)
10603918Ssaidi@eecs.umich.edu                0x1: decode OPCODE_OP_BOTTOM3 {
10613918Ssaidi@eecs.umich.edu                    0x0: PSUBB(Vo,Wo);
10623918Ssaidi@eecs.umich.edu                    0x1: PSUBW(Vo,Wo);
10633918Ssaidi@eecs.umich.edu                    0x2: PSUBD(Vo,Wo);
10643918Ssaidi@eecs.umich.edu                    0x3: PSUBQ(Vo,Wo);
10653918Ssaidi@eecs.umich.edu                    0x4: PADDB(Vo,Wo);
10663918Ssaidi@eecs.umich.edu                    0x5: PADDW(Vo,Wo);
10673918Ssaidi@eecs.umich.edu                    0x6: PADDD(Vo,Wo);
10683918Ssaidi@eecs.umich.edu                    0x7: UD2();
10693918Ssaidi@eecs.umich.edu                }
10703918Ssaidi@eecs.umich.edu                default: UD2();
10713918Ssaidi@eecs.umich.edu            }
10723918Ssaidi@eecs.umich.edu        }
10733940Ssaidi@eecs.umich.edu        default: FailUnimpl::twoByteOps();
10743940Ssaidi@eecs.umich.edu    }
10753940Ssaidi@eecs.umich.edu}
10763942Ssaidi@eecs.umich.edu