two_byte_opcodes.isa revision 12205
17087Snate@binkert.org// Copyright (c) 2007-2008 The Hewlett-Packard Development Company
210959Sdavid.hashe@amd.com// Copyright (c) 2012-2013 AMD
37087Snate@binkert.org// All rights reserved.
47087Snate@binkert.org//
57087Snate@binkert.org// The license below extends only to copyright in the software and shall
67087Snate@binkert.org// not be construed as granting a license to any other intellectual
77087Snate@binkert.org// property including but not limited to intellectual property relating
87087Snate@binkert.org// to a hardware implementation of the functionality of the software
97087Snate@binkert.org// licensed hereunder.  You may use the software subject to the license
107087Snate@binkert.org// terms below provided that you ensure that this notice is replicated
117087Snate@binkert.org// unmodified and in its entirety in all distributions of the software,
127087Snate@binkert.org// modified or unmodified, in source code or in binary form.
137087Snate@binkert.org//
145331Sgblack@eecs.umich.edu// Copyright (c) 2008 The Regents of The University of Michigan
155331Sgblack@eecs.umich.edu// All rights reserved.
165331Sgblack@eecs.umich.edu//
175331Sgblack@eecs.umich.edu// Redistribution and use in source and binary forms, with or without
185331Sgblack@eecs.umich.edu// modification, are permitted provided that the following conditions are
195331Sgblack@eecs.umich.edu// met: redistributions of source code must retain the above copyright
205331Sgblack@eecs.umich.edu// notice, this list of conditions and the following disclaimer;
215331Sgblack@eecs.umich.edu// redistributions in binary form must reproduce the above copyright
225331Sgblack@eecs.umich.edu// notice, this list of conditions and the following disclaimer in the
235331Sgblack@eecs.umich.edu// documentation and/or other materials provided with the distribution;
245331Sgblack@eecs.umich.edu// neither the name of the copyright holders nor the names of its
255331Sgblack@eecs.umich.edu// contributors may be used to endorse or promote products derived from
265331Sgblack@eecs.umich.edu// this software without specific prior written permission.
275331Sgblack@eecs.umich.edu//
285331Sgblack@eecs.umich.edu// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
295331Sgblack@eecs.umich.edu// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
305331Sgblack@eecs.umich.edu// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
315331Sgblack@eecs.umich.edu// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
325331Sgblack@eecs.umich.edu// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
335331Sgblack@eecs.umich.edu// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
345331Sgblack@eecs.umich.edu// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
355331Sgblack@eecs.umich.edu// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
365331Sgblack@eecs.umich.edu// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
375331Sgblack@eecs.umich.edu// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
385331Sgblack@eecs.umich.edu// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
395331Sgblack@eecs.umich.edu//
405331Sgblack@eecs.umich.edu// Authors: Gabe Black
415331Sgblack@eecs.umich.edu
424276Sgblack@eecs.umich.edu////////////////////////////////////////////////////////////////////
434276Sgblack@eecs.umich.edu//
444276Sgblack@eecs.umich.edu// Decode the two byte opcodes
454276Sgblack@eecs.umich.edu//
4610593Sgabeblack@google.com'X86ISA::TwoByteOpcode': decode OPCODE_OP_TOP5 {
4710593Sgabeblack@google.com    format WarnUnimpl {
4810593Sgabeblack@google.com        0x00: decode OPCODE_OP_BOTTOM3 {
4910593Sgabeblack@google.com            //0x00: group6();
5010593Sgabeblack@google.com            0x00: decode MODRM_REG {
5110593Sgabeblack@google.com                0x0: sldt_Mw_or_Rv();
5210593Sgabeblack@google.com                0x1: str_Mw_or_Rv();
5310593Sgabeblack@google.com                0x2: Inst::LLDT(Ew);
5410593Sgabeblack@google.com                0x3: Inst::LTR(Ew);
5510593Sgabeblack@google.com                0x4: verr_Mw_or_Rv();
5610593Sgabeblack@google.com                0x5: verw_Mw_or_Rv();
5710593Sgabeblack@google.com                //0x6: jmpe_Ev(); // IA-64
5810593Sgabeblack@google.com                default: Inst::UD2();
5910593Sgabeblack@google.com            }
6010593Sgabeblack@google.com            //0x01: group7(); // Ugly, ugly, ugly...
6110593Sgabeblack@google.com            0x01: decode MODRM_REG {
6210593Sgabeblack@google.com                0x0: decode MODRM_MOD {
6310593Sgabeblack@google.com                    0x3: decode MODRM_RM {
6410593Sgabeblack@google.com                        0x1: vmcall();
6510593Sgabeblack@google.com                        0x2: vmlaunch();
6610593Sgabeblack@google.com                        0x3: vmresume();
6710593Sgabeblack@google.com                        0x4: vmxoff();
6810593Sgabeblack@google.com                        default: Inst::UD2();
6910593Sgabeblack@google.com                    }
7010593Sgabeblack@google.com                    default: sgdt_Ms();
715238Sgblack@eecs.umich.edu                }
7210593Sgabeblack@google.com                0x1: decode MODRM_MOD {
7310593Sgabeblack@google.com                    0x3: decode MODRM_RM {
7410593Sgabeblack@google.com                        0x0: MonitorInst::monitor({{
7510593Sgabeblack@google.com                           xc->armMonitor(Rax);
7610593Sgabeblack@google.com                        }});
7710593Sgabeblack@google.com                        0x1: MwaitInst::mwait({{
7810593Sgabeblack@google.com                           uint64_t m = 0;          //mem
7910593Sgabeblack@google.com                           unsigned s = 0x8;        //size
8010593Sgabeblack@google.com                           unsigned f = 0;          //flags
8110593Sgabeblack@google.com                           readMemAtomic(xc, traceData,
8210593Sgabeblack@google.com                                         xc->getAddrMonitor()->vAddr,
8310593Sgabeblack@google.com                                         m, s, f);
8410593Sgabeblack@google.com                           xc->mwaitAtomic(xc->tcBase());
8510593Sgabeblack@google.com                           MicroHalt hltObj(machInst, mnemonic, 0x0);
8610593Sgabeblack@google.com                           hltObj.execute(xc, traceData);
8710593Sgabeblack@google.com                        }});
8810593Sgabeblack@google.com                        default: Inst::UD2();
896611Sgblack@eecs.umich.edu                    }
9010593Sgabeblack@google.com                    default: sidt_Ms();
9110593Sgabeblack@google.com                }
9210593Sgabeblack@google.com                0x2: decode MODRM_MOD {
9310593Sgabeblack@google.com                    0x3: decode MODRM_RM {
9410593Sgabeblack@google.com                        0x0: xgetbv();
9510593Sgabeblack@google.com                        0x1: xsetbv();
966611Sgblack@eecs.umich.edu                    }
9710593Sgabeblack@google.com                    default: decode MODE_SUBMODE {
9810593Sgabeblack@google.com                        0x0: Inst::LGDT(M);
9910593Sgabeblack@google.com                        default: decode OPSIZE {
10010593Sgabeblack@google.com                            // 16 bit operand sizes are special, but only
10110593Sgabeblack@google.com                            // in legacy and compatability modes.
10210593Sgabeblack@google.com                            0x2: Inst::LGDT_16(M);
10310593Sgabeblack@google.com                            default: Inst::LGDT(M);
1046611Sgblack@eecs.umich.edu                        }
1056611Sgblack@eecs.umich.edu                    }
10610593Sgabeblack@google.com                }
10710593Sgabeblack@google.com                0x3: decode MODRM_MOD {
10810593Sgabeblack@google.com                    0x3: decode MODRM_RM {
10910593Sgabeblack@google.com                        0x0: vmrun();
11010593Sgabeblack@google.com                        0x1: vmmcall();
11110593Sgabeblack@google.com                        0x2: vmload();
11210593Sgabeblack@google.com                        0x3: vmsave();
11310593Sgabeblack@google.com                        0x4: stgi();
11410593Sgabeblack@google.com                        0x5: clgi();
11510593Sgabeblack@google.com                        0x6: skinit();
11610593Sgabeblack@google.com                        0x7: invlpga();
11710593Sgabeblack@google.com                    }
11810593Sgabeblack@google.com                    default: decode MODE_SUBMODE {
11910593Sgabeblack@google.com                        0x0: Inst::LIDT(M);
12010593Sgabeblack@google.com                        default: decode OPSIZE {
12110593Sgabeblack@google.com                            // 16 bit operand sizes are special, but only
12210593Sgabeblack@google.com                            // in legacy and compatability modes.
12310593Sgabeblack@google.com                            0x2: Inst::LIDT_16(M);
12410593Sgabeblack@google.com                            default: Inst::LIDT(M);
1255292Sgblack@eecs.umich.edu                        }
1266611Sgblack@eecs.umich.edu                    }
1275238Sgblack@eecs.umich.edu                }
12810593Sgabeblack@google.com                0x4: decode MODRM_MOD {
12910593Sgabeblack@google.com                    0x3: Inst::SMSW(Rv);
13010593Sgabeblack@google.com                    default: Inst::SMSW(Mw);
13110593Sgabeblack@google.com                }
13210593Sgabeblack@google.com                0x6: Inst::LMSW(Ew);
13310593Sgabeblack@google.com                0x7: decode MODRM_MOD {
13410593Sgabeblack@google.com                    0x3: decode MODRM_RM {
13510593Sgabeblack@google.com                        0x0: Inst::SWAPGS();
13610593Sgabeblack@google.com                        0x1: rdtscp();
1375789Sgblack@eecs.umich.edu                        default: Inst::UD2();
1385789Sgblack@eecs.umich.edu                    }
13910593Sgabeblack@google.com                    default: Inst::INVLPG(M);
1405908Sgblack@eecs.umich.edu                }
1414276Sgblack@eecs.umich.edu            }
14210593Sgabeblack@google.com            0x02: lar_Gv_Ew();
14310593Sgabeblack@google.com            0x03: lsl_Gv_Ew();
14410593Sgabeblack@google.com            // sandpile.org doesn't seem to know what this is...? We'll
14510593Sgabeblack@google.com            // use it for pseudo instructions. We've got 16 bits of space
14610593Sgabeblack@google.com            // to play with so there can be quite a few pseudo
14710593Sgabeblack@google.com            // instructions.
14810593Sgabeblack@google.com            //0x04: loadall_or_reset_or_hang();
14910593Sgabeblack@google.com            0x4: decode IMMEDIATE {
15010593Sgabeblack@google.com                format BasicOperate {
15110593Sgabeblack@google.com                    0x00: m5arm({{
15210593Sgabeblack@google.com                        PseudoInst::arm(xc->tcBase());
15310593Sgabeblack@google.com                    }}, IsNonSpeculative);
15410593Sgabeblack@google.com                    0x01: m5quiesce({{
15510593Sgabeblack@google.com                        PseudoInst::quiesce(xc->tcBase());
15610593Sgabeblack@google.com                    }}, IsNonSpeculative, IsQuiesce);
15710593Sgabeblack@google.com                    0x02: m5quiesceNs({{
15810593Sgabeblack@google.com                        PseudoInst::quiesceNs(xc->tcBase(), Rdi);
15910593Sgabeblack@google.com                    }}, IsNonSpeculative, IsQuiesce);
16010593Sgabeblack@google.com                    0x03: m5quiesceCycle({{
16110593Sgabeblack@google.com                        PseudoInst::quiesceCycles(xc->tcBase(), Rdi);
16210593Sgabeblack@google.com                    }}, IsNonSpeculative, IsQuiesce);
16310593Sgabeblack@google.com                    0x04: m5quiesceTime({{
16410593Sgabeblack@google.com                        Rax = PseudoInst::quiesceTime(xc->tcBase());
16510593Sgabeblack@google.com                    }}, IsNonSpeculative);
16610593Sgabeblack@google.com                    0x07: m5rpns({{
16710593Sgabeblack@google.com                        Rax = PseudoInst::rpns(xc->tcBase());
16810593Sgabeblack@google.com                    }}, IsNonSpeculative);
16910593Sgabeblack@google.com                    0x21: m5exit({{
17010593Sgabeblack@google.com                        PseudoInst::m5exit(xc->tcBase(), Rdi);
17110593Sgabeblack@google.com                    }}, IsNonSpeculative);
17210593Sgabeblack@google.com                    0x22: m5fail({{
17310593Sgabeblack@google.com                        PseudoInst::m5fail(xc->tcBase(), Rdi, Rsi);
17410593Sgabeblack@google.com                    }}, IsNonSpeculative);
17510593Sgabeblack@google.com                    0x30: m5initparam({{
17611289Sgabor.dozsa@arm.com                        Rax = PseudoInst::initParam(xc->tcBase(), Rdi, Rsi);
17710593Sgabeblack@google.com                    }}, IsNonSpeculative);
17810593Sgabeblack@google.com                    0x31: m5loadsymbol({{
17910593Sgabeblack@google.com                        PseudoInst::loadsymbol(xc->tcBase());
18010593Sgabeblack@google.com                    }}, IsNonSpeculative);
18110593Sgabeblack@google.com                    0x40: m5resetstats({{
18210593Sgabeblack@google.com                        PseudoInst::resetstats(xc->tcBase(), Rdi, Rsi);
18310593Sgabeblack@google.com                    }}, IsNonSpeculative);
18410593Sgabeblack@google.com                    0x41: m5dumpstats({{
18510593Sgabeblack@google.com                        PseudoInst::dumpstats(xc->tcBase(), Rdi, Rsi);
18610593Sgabeblack@google.com                    }}, IsNonSpeculative);
18710593Sgabeblack@google.com                    0x42: m5dumpresetstats({{
18810593Sgabeblack@google.com                        PseudoInst::dumpresetstats(xc->tcBase(), Rdi, Rsi);
18910593Sgabeblack@google.com                    }}, IsNonSpeculative);
19010593Sgabeblack@google.com                    0x43: m5checkpoint({{
19110593Sgabeblack@google.com                        PseudoInst::m5checkpoint(xc->tcBase(), Rdi, Rsi);
19210593Sgabeblack@google.com                    }}, IsNonSpeculative);
19310593Sgabeblack@google.com                    0x50: m5readfile({{
19410593Sgabeblack@google.com                        Rax = PseudoInst::readfile(
19510593Sgabeblack@google.com                            xc->tcBase(), Rdi, Rsi, Rdx);
19610593Sgabeblack@google.com                    }}, IsNonSpeculative);
19710593Sgabeblack@google.com                    0x51: m5debugbreak({{
19810593Sgabeblack@google.com                        PseudoInst::debugbreak(xc->tcBase());
19910593Sgabeblack@google.com                    }}, IsNonSpeculative);
20010593Sgabeblack@google.com                    0x52: m5switchcpu({{
20110593Sgabeblack@google.com                        PseudoInst::switchcpu(xc->tcBase());
20210593Sgabeblack@google.com                    }}, IsNonSpeculative);
20310593Sgabeblack@google.com                    0x53: m5addsymbol({{
20410593Sgabeblack@google.com                        PseudoInst::addsymbol(xc->tcBase(), Rdi, Rsi);
20510593Sgabeblack@google.com                    }}, IsNonSpeculative);
20610593Sgabeblack@google.com                    0x54: m5panic({{
20710593Sgabeblack@google.com                        panic("M5 panic instruction called at pc = %#x.\n",
20810593Sgabeblack@google.com                              RIP);
20910593Sgabeblack@google.com                    }}, IsNonSpeculative);
21010593Sgabeblack@google.com                    0x55: m5reserved1({{
21110593Sgabeblack@google.com                        warn("M5 reserved opcode 1 ignored.\n");
21210593Sgabeblack@google.com                    }}, IsNonSpeculative);
21310593Sgabeblack@google.com                    0x56: m5reserved2({{
21410593Sgabeblack@google.com                        warn("M5 reserved opcode 2 ignored.\n");
21510593Sgabeblack@google.com                    }}, IsNonSpeculative);
21610593Sgabeblack@google.com                    0x57: m5reserved3({{
21710593Sgabeblack@google.com                        warn("M5 reserved opcode 3 ignored.\n");
21810593Sgabeblack@google.com                    }}, IsNonSpeculative);
21910593Sgabeblack@google.com                    0x58: m5reserved4({{
22010593Sgabeblack@google.com                        warn("M5 reserved opcode 4 ignored.\n");
22110593Sgabeblack@google.com                    }}, IsNonSpeculative);
22210593Sgabeblack@google.com                    0x59: m5reserved5({{
22310593Sgabeblack@google.com                        warn("M5 reserved opcode 5 ignored.\n");
22410593Sgabeblack@google.com                    }}, IsNonSpeculative);
22510593Sgabeblack@google.com                    0x5a: m5_work_begin({{
22610593Sgabeblack@google.com                        PseudoInst::workbegin(xc->tcBase(), Rdi, Rsi);
22710593Sgabeblack@google.com                    }}, IsNonSpeculative);
22810593Sgabeblack@google.com                    0x5b: m5_work_end({{
22910593Sgabeblack@google.com                        PseudoInst::workend(xc->tcBase(), Rdi, Rsi);
23010593Sgabeblack@google.com                    }}, IsNonSpeculative);
23111703Smichael.lebeane@amd.com                    0x62: m5togglesync({{
23211703Smichael.lebeane@amd.com                        PseudoInst::togglesync(xc->tcBase());
23311703Smichael.lebeane@amd.com                    }}, IsNonSpeculative, IsQuiesce);
2346616Sgblack@eecs.umich.edu                    default: Inst::UD2();
2356616Sgblack@eecs.umich.edu                }
2364276Sgblack@eecs.umich.edu            }
23710593Sgabeblack@google.com            0x05: decode FullSystemInt {
23811877Sbrandon.potter@amd.com                0: SyscallInst::syscall('xc->syscall(Rax, &fault)',
23911877Sbrandon.potter@amd.com                                        IsSyscall, IsNonSpeculative,
24011877Sbrandon.potter@amd.com                                        IsSerializeAfter);
24110593Sgabeblack@google.com                default: decode MODE_MODE {
24210593Sgabeblack@google.com                    0x0: decode MODE_SUBMODE {
24310593Sgabeblack@google.com                        0x0: Inst::SYSCALL_64();
24410593Sgabeblack@google.com                        0x1: Inst::SYSCALL_COMPAT();
24510593Sgabeblack@google.com                    }
24610593Sgabeblack@google.com                    0x1: Inst::SYSCALL_LEGACY();
24710593Sgabeblack@google.com                }
24810593Sgabeblack@google.com            }
24910593Sgabeblack@google.com            0x06: Inst::CLTS();
25010593Sgabeblack@google.com            0x07: decode MODE_SUBMODE {
25110593Sgabeblack@google.com                0x0: decode OPSIZE {
25210593Sgabeblack@google.com                    // Return to 64 bit mode.
25310593Sgabeblack@google.com                    0x8: Inst::SYSRET_TO_64();
25410593Sgabeblack@google.com                    // Return to compatibility mode.
25510593Sgabeblack@google.com                    default: Inst::SYSRET_TO_COMPAT();
25610593Sgabeblack@google.com                }
25710593Sgabeblack@google.com                default: Inst::SYSRET_NON_64();
25810593Sgabeblack@google.com            }
25910593Sgabeblack@google.com        }
26010593Sgabeblack@google.com        0x01: decode OPCODE_OP_BOTTOM3 {
26110593Sgabeblack@google.com            0x0: invd();
26210593Sgabeblack@google.com            0x1: wbinvd();
26310593Sgabeblack@google.com            0x2: Inst::UD2();
26410593Sgabeblack@google.com            0x3: Inst::UD2();
26510593Sgabeblack@google.com            0x4: Inst::UD2();
26610593Sgabeblack@google.com            0x5: Inst::PREFETCH(Mb);
26710593Sgabeblack@google.com            0x6: FailUnimpl::femms();
26810593Sgabeblack@google.com            0x7: decode IMMEDIATE {
26910593Sgabeblack@google.com                0x0C: pi2fw_Pq_Qq();
27010593Sgabeblack@google.com                0x0D: pi2fd_Pq_Qq();
27110593Sgabeblack@google.com                0x1C: pf2iw_Pq_Qq();
27210593Sgabeblack@google.com                0x1D: pf2id_Pq_Qq();
27310593Sgabeblack@google.com                0x8A: pfnacc_Pq_Qq();
27410593Sgabeblack@google.com                0x8E: pfpnacc_Pq_Qq();
27510593Sgabeblack@google.com                0x90: pfcmpge_Pq_Qq();
27610593Sgabeblack@google.com                0x94: pfmin_Pq_Qq();
27710593Sgabeblack@google.com                0x96: pfrcp_Pq_Qq();
27810593Sgabeblack@google.com                0x97: pfrsqrt_Pq_Qq();
27910593Sgabeblack@google.com                0x9A: Inst::PFSUB(Pq,Qq);
28010593Sgabeblack@google.com                0x9E: pfadd_Pq_Qq();
28110593Sgabeblack@google.com                0xA0: pfcmpgt_Pq_Qq();
28210593Sgabeblack@google.com                0xA4: pfmax_Pq_Qq();
28310593Sgabeblack@google.com                0xA6: pfrcpit1_Pq_Qq();
28410593Sgabeblack@google.com                0xA7: pfrsqit1_Pq_Qq();
28510593Sgabeblack@google.com                0xAA: Inst::PFSUBR(Pq,Qq);
28610593Sgabeblack@google.com                0xAE: pfacc_Pq_Qq();
28710593Sgabeblack@google.com                0xB0: pfcmpeq_Pq_Qq();
28810593Sgabeblack@google.com                0xB4: Inst::PFMUL(Pq,Qq);
28910593Sgabeblack@google.com                0xB6: pfrcpit2_Pq_Qq();
29010593Sgabeblack@google.com                0xB7: Inst::PMULHRW(Pq,Qq);
29110593Sgabeblack@google.com                0xBB: pswapd_Pq_Qq();
29210593Sgabeblack@google.com                0xBF: pavgusb_Pq_Qq();
29310593Sgabeblack@google.com                default: Inst::UD2();
29410593Sgabeblack@google.com            }
29510593Sgabeblack@google.com        }
29610593Sgabeblack@google.com        format Inst{
29710593Sgabeblack@google.com            0x02: decode LEGACY_DECODEVAL {
29810593Sgabeblack@google.com                // no prefix
29910593Sgabeblack@google.com                0x0: decode OPCODE_OP_BOTTOM3 {
30010593Sgabeblack@google.com                    0x0: MOVUPS(Vo,Wo);
30110593Sgabeblack@google.com                    0x1: MOVUPS(Wo,Vo);
30210593Sgabeblack@google.com                    0x2: decode MODRM_MOD {
30310593Sgabeblack@google.com                        0x3: MOVHLPS(Vps,VRq);
30410593Sgabeblack@google.com                        default: MOVLPS(Vps,Mq);
30510593Sgabeblack@google.com                    }
30610593Sgabeblack@google.com                    0x3: MOVLPS(Mq,Vps);
30710593Sgabeblack@google.com                    0x4: UNPCKLPS(Vps,Wq);
30810593Sgabeblack@google.com                    0x5: UNPCKHPS(Vps,Wq);
30910593Sgabeblack@google.com                    0x6: decode MODRM_MOD {
31010593Sgabeblack@google.com                        0x3: MOVLHPS(Vps,VRq);
31110593Sgabeblack@google.com                        default: MOVHPS(Vps,Mq);
31210593Sgabeblack@google.com                    }
31310593Sgabeblack@google.com                    0x7: MOVHPS(Mq,Vq);
31410593Sgabeblack@google.com                }
31510593Sgabeblack@google.com                // repe (0xF3)
31610593Sgabeblack@google.com                0x4: decode OPCODE_OP_BOTTOM3 {
31710593Sgabeblack@google.com                    0x0: MOVSS(Vd,Wd);
31810593Sgabeblack@google.com                    0x1: MOVSS(Wd,Vd);
31910593Sgabeblack@google.com                    0x2: WarnUnimpl::movsldup_Vo_Wo();
32010593Sgabeblack@google.com                    0x6: WarnUnimpl::movshdup_Vo_Wo();
32110593Sgabeblack@google.com                    default: UD2();
32210593Sgabeblack@google.com                }
32310593Sgabeblack@google.com                // operand size (0x66)
32410593Sgabeblack@google.com                0x1: decode OPCODE_OP_BOTTOM3 {
32510593Sgabeblack@google.com                    0x0: MOVUPD(Vo,Wo);
32610593Sgabeblack@google.com                    0x1: MOVUPD(Wo,Vo);
32710593Sgabeblack@google.com                    0x2: MOVLPD(Vq,Mq);
32810593Sgabeblack@google.com                    0x3: MOVLPD(Mq,Vq);
32910593Sgabeblack@google.com                    0x4: UNPCKLPD(Vo,Wq);
33010593Sgabeblack@google.com                    0x5: UNPCKHPD(Vo,Wo);
33110593Sgabeblack@google.com                    0x6: MOVHPD(Vq,Mq);
33210593Sgabeblack@google.com                    0x7: MOVHPD(Mq,Vq);
33310593Sgabeblack@google.com            }
33410593Sgabeblack@google.com                // repne (0xF2)
33510593Sgabeblack@google.com                0x8: decode OPCODE_OP_BOTTOM3 {
33610593Sgabeblack@google.com                    0x0: MOVSD(Vq,Wq);
33710593Sgabeblack@google.com                    0x1: MOVSD(Wq,Vq);
33810593Sgabeblack@google.com                    0x2: MOVDDUP(Vo,Wq);
33910593Sgabeblack@google.com                    default: UD2();
34010593Sgabeblack@google.com                }
34110593Sgabeblack@google.com                default: UD2();
34210593Sgabeblack@google.com            }
34310593Sgabeblack@google.com            0x03: decode OPCODE_OP_BOTTOM3 {
34410593Sgabeblack@google.com                //group16();
34510593Sgabeblack@google.com                0x0: decode MODRM_REG {
34610593Sgabeblack@google.com                    0x0: WarnUnimpl::prefetch_nta();
34710593Sgabeblack@google.com                    0x1: PREFETCH_T0(Mb);
34810593Sgabeblack@google.com                    0x2: WarnUnimpl::prefetch_t1();
34910593Sgabeblack@google.com                    0x3: WarnUnimpl::prefetch_t2();
35010593Sgabeblack@google.com                    default: HINT_NOP();
35110593Sgabeblack@google.com                }
35210593Sgabeblack@google.com                0x1: HINT_NOP();
35310593Sgabeblack@google.com                0x2: HINT_NOP();
35410593Sgabeblack@google.com                0x3: HINT_NOP();
35510593Sgabeblack@google.com                0x4: HINT_NOP();
35610593Sgabeblack@google.com                0x5: HINT_NOP();
35710593Sgabeblack@google.com                0x6: HINT_NOP();
35810593Sgabeblack@google.com                0x7: HINT_NOP();
35910593Sgabeblack@google.com            }
36010593Sgabeblack@google.com            0x04: decode LEGACY_DECODEVAL {
36110593Sgabeblack@google.com                // no prefix
36210593Sgabeblack@google.com                0x0: decode OPCODE_OP_BOTTOM3 {
36312170Sgabeblack@google.com                    0x0: CondInst::MOV(
36412205Sbaz21@cam.ac.uk                        {{isValidMiscReg(MISCREG_CR(MODRM_REG))}},Rd,Cd);
36510593Sgabeblack@google.com                    0x1: MOV(Rd,Dd);
36612170Sgabeblack@google.com                    0x2: CondInst::MOV(
36712170Sgabeblack@google.com                        {{isValidMiscReg(MISCREG_CR(MODRM_REG))}},Cd,Rd);
36810593Sgabeblack@google.com                    0x3: MOV(Dd,Rd);
36910593Sgabeblack@google.com                    default: UD2();
37010593Sgabeblack@google.com                }
37110959Sdavid.hashe@amd.com                // operand size (0x66)
37210959Sdavid.hashe@amd.com                0x1: decode OPCODE_OP_BOTTOM3 {
37310959Sdavid.hashe@amd.com                    0x0: MOV(Rd,Cd);
37410959Sdavid.hashe@amd.com                    0x2: MOV(Cd,Rd);
37510959Sdavid.hashe@amd.com                }
37610593Sgabeblack@google.com                default: UD2();
37710593Sgabeblack@google.com            }
37810593Sgabeblack@google.com            0x05: decode LEGACY_DECODEVAL {
37910593Sgabeblack@google.com                // no prefix
38010593Sgabeblack@google.com                0x0: decode OPCODE_OP_BOTTOM3 {
38110593Sgabeblack@google.com                    //These moves should really use size o (octword), but
38210593Sgabeblack@google.com                    //because they are split in two, they use q (quadword).
38310593Sgabeblack@google.com                    0x0: MOVAPS(Vq,Wq);
38410593Sgabeblack@google.com                    0x1: MOVAPS(Wq,Vq);
38510593Sgabeblack@google.com                    0x2: CVTPI2PS(Vq,Qq);
38610593Sgabeblack@google.com                    0x3: WarnUnimpl::movntps_Mo_Vo();
38710593Sgabeblack@google.com                    0x4: CVTTPS2PI(Pq,Wq);
38810593Sgabeblack@google.com                    0x5: CVTPS2PI(Pq,Wq);
38910593Sgabeblack@google.com                    0x6: UCOMISS(Vd,Wd);
39010593Sgabeblack@google.com                    0x7: COMISS(Vd,Wd);
39110593Sgabeblack@google.com                }
39210593Sgabeblack@google.com                // repe (0xF3)
39310593Sgabeblack@google.com                0x4: decode OPCODE_OP_BOTTOM3 {
39410593Sgabeblack@google.com                    0x2: CVTSI2SS(Vd,Ed);
39510593Sgabeblack@google.com                    0x4: CVTTSS2SI(Gd,Wd);
39610593Sgabeblack@google.com                    0x5: CVTSS2SI(Gd,Wd);
39710593Sgabeblack@google.com                    default: UD2();
39810593Sgabeblack@google.com                }
39910593Sgabeblack@google.com                // operand size (0x66)
40010593Sgabeblack@google.com                0x1: decode OPCODE_OP_BOTTOM3 {
40110593Sgabeblack@google.com                    0x0: MOVAPD(Vo,Wo);
40210593Sgabeblack@google.com                    0x1: MOVAPD(Wo,Vo);
40310593Sgabeblack@google.com                    0x2: CVTPI2PD(Vo,Qq);
40410593Sgabeblack@google.com                    0x3: WarnUnimpl::movntpd_Mo_Vo();
40510593Sgabeblack@google.com                    0x4: CVTTPD2PI(Pq,Wo);
40610593Sgabeblack@google.com                    0x5: CVTPD2PI(Pq,Wo);
40710593Sgabeblack@google.com                    0x6: UCOMISD(Vq,Wq);
40810593Sgabeblack@google.com                    0x7: COMISD(Vq,Wq);
40910593Sgabeblack@google.com                }
41010593Sgabeblack@google.com                // repne (0xF2)
41110593Sgabeblack@google.com                0x8: decode OPCODE_OP_BOTTOM3 {
41210593Sgabeblack@google.com                    // The size of the V operand should be q, not dp
41310593Sgabeblack@google.com                    0x2: CVTSI2SD(Vdp,Edp);
41410593Sgabeblack@google.com                    // The size of the W operand should be q, not dp
41510593Sgabeblack@google.com                    0x4: CVTTSD2SI(Gdp,Wdp);
41610593Sgabeblack@google.com                    0x5: CVTSD2SI(Gd,Wq);
41710593Sgabeblack@google.com                    default: UD2();
41810593Sgabeblack@google.com                }
41910593Sgabeblack@google.com                default: UD2();
42010593Sgabeblack@google.com            }
42110593Sgabeblack@google.com        }
42210593Sgabeblack@google.com        0x06: decode OPCODE_OP_BOTTOM3 {
42310593Sgabeblack@google.com            0x0: Inst::WRMSR();
42410593Sgabeblack@google.com            0x1: Inst::RDTSC();
42510593Sgabeblack@google.com            0x2: Inst::RDMSR();
42610593Sgabeblack@google.com            0x3: rdpmc();
42710593Sgabeblack@google.com            0x4: decode FullSystemInt {
42811877Sbrandon.potter@amd.com                0: SyscallInst::sysenter('xc->syscall(Rax, &fault)',
42911877Sbrandon.potter@amd.com                                         IsSyscall, IsNonSpeculative,
43011877Sbrandon.potter@amd.com                                         IsSerializeAfter);
43110593Sgabeblack@google.com                default: sysenter();
43210593Sgabeblack@google.com            }
43310593Sgabeblack@google.com            0x5: sysexit();
43410593Sgabeblack@google.com            0x6: Inst::UD2();
43510593Sgabeblack@google.com            0x7: getsec();
43610593Sgabeblack@google.com        }
43710593Sgabeblack@google.com        0x07: decode OPCODE_OP_BOTTOM3 {
43810593Sgabeblack@google.com            0x0: M5InternalError::error(
43910593Sgabeblack@google.com                {{"Three byte opcode shouldn't be handled by "
44010593Sgabeblack@google.com                  "two_byte_opcodes.isa!"}});
44110593Sgabeblack@google.com            0x2: M5InternalError::error(
44210593Sgabeblack@google.com                {{"Three byte opcode shouldn't be handled by "
44310593Sgabeblack@google.com                  "two_byte_opcodes.isa!"}});
44410593Sgabeblack@google.com            default: UD2();
44510593Sgabeblack@google.com        }
44610593Sgabeblack@google.com        format Inst {
44710593Sgabeblack@google.com            0x08: decode OPCODE_OP_BOTTOM3 {
44810593Sgabeblack@google.com                0x0: CMOVO(Gv,Ev);
44910593Sgabeblack@google.com                0x1: CMOVNO(Gv,Ev);
45010593Sgabeblack@google.com                0x2: CMOVB(Gv,Ev);
45110593Sgabeblack@google.com                0x3: CMOVNB(Gv,Ev);
45210593Sgabeblack@google.com                0x4: CMOVZ(Gv,Ev);
45310593Sgabeblack@google.com                0x5: CMOVNZ(Gv,Ev);
45410593Sgabeblack@google.com                0x6: CMOVBE(Gv,Ev);
45510593Sgabeblack@google.com                0x7: CMOVNBE(Gv,Ev);
45610593Sgabeblack@google.com            }
45710593Sgabeblack@google.com            0x09: decode OPCODE_OP_BOTTOM3 {
45810593Sgabeblack@google.com                0x0: CMOVS(Gv,Ev);
45910593Sgabeblack@google.com                0x1: CMOVNS(Gv,Ev);
46010593Sgabeblack@google.com                0x2: CMOVP(Gv,Ev);
46110593Sgabeblack@google.com                0x3: CMOVNP(Gv,Ev);
46210593Sgabeblack@google.com                0x4: CMOVL(Gv,Ev);
46310593Sgabeblack@google.com                0x5: CMOVNL(Gv,Ev);
46410593Sgabeblack@google.com                0x6: CMOVLE(Gv,Ev);
46510593Sgabeblack@google.com                0x7: CMOVNLE(Gv,Ev);
46610593Sgabeblack@google.com            }
46710593Sgabeblack@google.com            0x0A: decode LEGACY_DECODEVAL {
46810593Sgabeblack@google.com                // no prefix
46910593Sgabeblack@google.com                0x0: decode OPCODE_OP_BOTTOM3 {
47010593Sgabeblack@google.com                    0x0: MOVMSKPS(Gd,VRo);
47110593Sgabeblack@google.com                    0x1: SQRTPS(Vo,Wo);
47210593Sgabeblack@google.com                    0x2: WarnUnimpl::rqsrtps_Vo_Wo();
47311160Ssteve.reinhardt@amd.com                    0x3: RCPPS(Vo,Wo);
47410593Sgabeblack@google.com                    0x4: ANDPS(Vo,Wo);
47510593Sgabeblack@google.com                    0x5: ANDNPS(Vo,Wo);
47610593Sgabeblack@google.com                    0x6: ORPS(Vo,Wo);
47710593Sgabeblack@google.com                    0x7: XORPS(Vo,Wo);
47810593Sgabeblack@google.com                }
47910593Sgabeblack@google.com                // repe (0xF3)
48010593Sgabeblack@google.com                0x4: decode OPCODE_OP_BOTTOM3 {
48110593Sgabeblack@google.com                    0x1: SQRTSS(Vd,Wd);
48210593Sgabeblack@google.com                    0x2: WarnUnimpl::rsqrtss_Vd_Wd();
48311160Ssteve.reinhardt@amd.com                    0x3: RCPSS(Vd,Wd);
48410593Sgabeblack@google.com                    default: UD2();
48510593Sgabeblack@google.com                }
48610593Sgabeblack@google.com                // operand size (0x66)
48710593Sgabeblack@google.com                0x1: decode OPCODE_OP_BOTTOM3 {
48810593Sgabeblack@google.com                    0x0: MOVMSKPD(Gd,VRo);
48910593Sgabeblack@google.com                    0x1: SQRTPD(Vo,Wo);
49010593Sgabeblack@google.com                    0x4: ANDPD(Vo,Wo);
49110593Sgabeblack@google.com                    0x5: ANDNPD(Vo,Wo);
49210593Sgabeblack@google.com                    0x6: ORPD(Vo,Wo);
49310593Sgabeblack@google.com                    0x7: XORPD(Vo,Wo);
49410593Sgabeblack@google.com                    default: UD2();
49510593Sgabeblack@google.com                }
49610593Sgabeblack@google.com                // repne (0xF2)
49710593Sgabeblack@google.com                0x8: decode OPCODE_OP_BOTTOM3 {
49810593Sgabeblack@google.com                    0x1: SQRTSD(Vq,Wq);
49910593Sgabeblack@google.com                    default: UD2();
50010593Sgabeblack@google.com                }
50110593Sgabeblack@google.com                default: UD2();
50210593Sgabeblack@google.com            }
50310593Sgabeblack@google.com            0x0B: decode LEGACY_DECODEVAL {
50410593Sgabeblack@google.com                // no prefix
50510593Sgabeblack@google.com                0x0: decode OPCODE_OP_BOTTOM3 {
50610593Sgabeblack@google.com                    0x0: ADDPS(Vo,Wo);
50710593Sgabeblack@google.com                    0x1: MULPS(Vo,Wo);
50810593Sgabeblack@google.com                    0x2: CVTPS2PD(Vo,Wq);
50910593Sgabeblack@google.com                    0x3: CVTDQ2PS(Vo,Wo);
51010593Sgabeblack@google.com                    0x4: SUBPS(Vo,Wo);
51110593Sgabeblack@google.com                    0x5: MINPS(Vo,Wo);
51210593Sgabeblack@google.com                    0x6: DIVPS(Vo,Wo);
51310593Sgabeblack@google.com                    0x7: MAXPS(Vo,Wo);
51410593Sgabeblack@google.com                }
51510593Sgabeblack@google.com                // repe (0xF3)
51610593Sgabeblack@google.com                0x4: decode OPCODE_OP_BOTTOM3 {
51710593Sgabeblack@google.com                    0x0: ADDSS(Vd,Wd);
51810593Sgabeblack@google.com                    0x1: MULSS(Vd,Wd);
51910593Sgabeblack@google.com                    0x2: CVTSS2SD(Vq,Wd);
52010593Sgabeblack@google.com                    0x3: CVTTPS2DQ(Vo,Wo);
52110593Sgabeblack@google.com                    0x4: SUBSS(Vd,Wd);
52210593Sgabeblack@google.com                    0x5: MINSS(Vd,Wd);
52310593Sgabeblack@google.com                    0x6: DIVSS(Vd,Wd);
52410593Sgabeblack@google.com                    0x7: MAXSS(Vd,Wd);
52510593Sgabeblack@google.com                }
52610593Sgabeblack@google.com                // operand size (0x66)
52710593Sgabeblack@google.com                0x1: decode OPCODE_OP_BOTTOM3 {
52810593Sgabeblack@google.com                    0x0: ADDPD(Vo,Wo);
52910593Sgabeblack@google.com                    0x1: MULPD(Vo,Wo);
53010593Sgabeblack@google.com                    0x2: CVTPD2PS(Vo,Wo);
53110593Sgabeblack@google.com                    0x3: CVTPS2DQ(Vo,Wo);
53210593Sgabeblack@google.com                    0x4: SUBPD(Vo,Wo);
53310593Sgabeblack@google.com                    0x5: MINPD(Vo,Wo);
53410593Sgabeblack@google.com                    0x6: DIVPD(Vo,Wo);
53510593Sgabeblack@google.com                    0x7: MAXPD(Vo,Wo);
53610593Sgabeblack@google.com                }
53710593Sgabeblack@google.com                // repne (0xF2)
53810593Sgabeblack@google.com                0x8: decode OPCODE_OP_BOTTOM3 {
53910593Sgabeblack@google.com                    0x0: ADDSD(Vq,Wq);
54010593Sgabeblack@google.com                    0x1: MULSD(Vq,Wq);
54110593Sgabeblack@google.com                    0x2: CVTSD2SS(Vd,Wq);
54210593Sgabeblack@google.com                    0x4: SUBSD(Vq,Wq);
54310593Sgabeblack@google.com                    0x5: MINSD(Vq,Wq);
54410593Sgabeblack@google.com                    0x6: DIVSD(Vq,Wq);
54510593Sgabeblack@google.com                    0x7: MAXSD(Vq,Wq);
54610593Sgabeblack@google.com                    default: UD2();
54710593Sgabeblack@google.com                }
54810593Sgabeblack@google.com                default: UD2();
54910593Sgabeblack@google.com            }
55010593Sgabeblack@google.com            0x0C: decode LEGACY_DECODEVAL {
55110593Sgabeblack@google.com                // no prefix
55210593Sgabeblack@google.com                0x0: decode OPCODE_OP_BOTTOM3 {
55310593Sgabeblack@google.com                    0x0: PUNPCKLBW(Pq,Qd);
55410593Sgabeblack@google.com                    0x1: PUNPCKLWD(Pq,Qd);
55510593Sgabeblack@google.com                    0x2: PUNPCKLDQ(Pq,Qd);
55610593Sgabeblack@google.com                    0x3: PACKSSWB(Pq,Qq);
55710593Sgabeblack@google.com                    0x4: PCMPGTB(Pq,Qq);
55810593Sgabeblack@google.com                    0x5: PCMPGTW(Pq,Qq);
55910593Sgabeblack@google.com                    0x6: PCMPGTD(Pq,Qq);
56010593Sgabeblack@google.com                    0x7: PACKUSWB(Pq,Qq);
56110593Sgabeblack@google.com                }
56210593Sgabeblack@google.com                // operand size (0x66)
56310593Sgabeblack@google.com                0x1: decode OPCODE_OP_BOTTOM3 {
56410593Sgabeblack@google.com                    0x0: PUNPCKLBW(Vo,Wq);
56510593Sgabeblack@google.com                    0x1: PUNPCKLWD(Vo,Wq);
56610593Sgabeblack@google.com                    0x2: PUNPCKLDQ(Vo,Wq);
56710593Sgabeblack@google.com                    0x3: PACKSSWB(Vo,Wo);
56810593Sgabeblack@google.com                    0x4: PCMPGTB(Vo,Wo);
56910593Sgabeblack@google.com                    0x5: PCMPGTW(Vo,Wo);
57010593Sgabeblack@google.com                    0x6: PCMPGTD(Vo,Wo);
57110593Sgabeblack@google.com                    0x7: PACKUSWB(Vo,Wo);
57210593Sgabeblack@google.com                }
57310593Sgabeblack@google.com                default: UD2();
57410593Sgabeblack@google.com            }
57510593Sgabeblack@google.com            0x0D: decode LEGACY_DECODEVAL {
57610593Sgabeblack@google.com                // no prefix
57710593Sgabeblack@google.com                0x0: decode OPCODE_OP_BOTTOM3 {
57810593Sgabeblack@google.com                    0x0: PUNPCKHBW(Pq,Qq);
57910593Sgabeblack@google.com                    0x1: PUNPCKHWD(Pq,Qq);
58010593Sgabeblack@google.com                    0x2: PUNPCKHDQ(Pq,Qq);
58110593Sgabeblack@google.com                    0x3: PACKSSDW(Pq,Qq);
58210593Sgabeblack@google.com                    0x6: MOVD(Pq,Edp);
58310593Sgabeblack@google.com                    0x7: MOVQ(Pq,Qq);
58410593Sgabeblack@google.com                    default: UD2();
58510593Sgabeblack@google.com                }
58610593Sgabeblack@google.com                // repe (0xF3)
58710593Sgabeblack@google.com                0x4: decode OPCODE_OP_BOTTOM3 {
58810593Sgabeblack@google.com                    0x7: MOVDQU(Vo,Wo);
58910593Sgabeblack@google.com                    default: UD2();
59010593Sgabeblack@google.com                }
59110593Sgabeblack@google.com                // operand size (0x66)
59210593Sgabeblack@google.com                0x1: decode OPCODE_OP_BOTTOM3 {
59310593Sgabeblack@google.com                    0x0: PUNPCKHBW(Vo,Wo);
59410593Sgabeblack@google.com                    0x1: PUNPCKHWD(Vo,Wo);
59510593Sgabeblack@google.com                    0x2: PUNPCKHDQ(Vo,Wo);
59610593Sgabeblack@google.com                    0x3: PACKSSDW(Vo,Wo);
59710593Sgabeblack@google.com                    0x4: PUNPCKLQDQ(Vo,Wq);
59810593Sgabeblack@google.com                    0x5: PUNPCKHQDQ(Vo,Wq);
59910593Sgabeblack@google.com                    0x6: MOVD(Vo,Edp);
60010593Sgabeblack@google.com                    0x7: MOVDQA(Vo,Wo);
60110593Sgabeblack@google.com                }
60210593Sgabeblack@google.com                default: UD2();
60310593Sgabeblack@google.com            }
60410593Sgabeblack@google.com            0x0E: decode LEGACY_DECODEVAL {
60510593Sgabeblack@google.com                // no prefix
60610593Sgabeblack@google.com                0x0: decode OPCODE_OP_BOTTOM3 {
60710593Sgabeblack@google.com                    0x0: PSHUFW(Pq,Qq,Ib);
60810593Sgabeblack@google.com                    //0x1: group12_pshimw();
60910593Sgabeblack@google.com                    0x1: decode MODRM_REG {
61010593Sgabeblack@google.com                        0x2: PSRLW(PRq,Ib);
61110593Sgabeblack@google.com                        0x4: PSRAW(PRq,Ib);
61210593Sgabeblack@google.com                        0x6: PSLLW(PRq,Ib);
61310593Sgabeblack@google.com                        default: UD2();
61410593Sgabeblack@google.com                    }
61510593Sgabeblack@google.com                    //0x2: group13_pshimd();
61610593Sgabeblack@google.com                    0x2: decode MODRM_REG {
61710593Sgabeblack@google.com                        0x2: PSRLD(PRq,Ib);
61810593Sgabeblack@google.com                        0x4: PSRAD(PRq,Ib);
61910593Sgabeblack@google.com                        0x6: PSLLD(PRq,Ib);
62010593Sgabeblack@google.com                        default: UD2();
62110593Sgabeblack@google.com                    }
62210593Sgabeblack@google.com                    //0x3: group14_pshimq();
62310593Sgabeblack@google.com                    0x3: decode MODRM_REG {
62410593Sgabeblack@google.com                        0x2: PSRLQ(PRq,Ib);
62510593Sgabeblack@google.com                        0x6: PSLLQ(PRq,Ib);
62610593Sgabeblack@google.com                        default: Inst::UD2();
62710593Sgabeblack@google.com                    }
62810593Sgabeblack@google.com                    0x4: Inst::PCMPEQB(Pq,Qq);
62910593Sgabeblack@google.com                    0x5: Inst::PCMPEQW(Pq,Qq);
63010593Sgabeblack@google.com                    0x6: Inst::PCMPEQD(Pq,Qq);
63110593Sgabeblack@google.com                    0x7: Inst::EMMS();
63210593Sgabeblack@google.com                }
63310593Sgabeblack@google.com                // repe (0xF3)
63410593Sgabeblack@google.com                0x4: decode OPCODE_OP_BOTTOM3 {
63510593Sgabeblack@google.com                    0x0: PSHUFHW(Vo,Wo,Ib);
63610593Sgabeblack@google.com                    default: UD2();
63710593Sgabeblack@google.com                }
63810593Sgabeblack@google.com                // operand size (0x66)
63910593Sgabeblack@google.com                0x1: decode OPCODE_OP_BOTTOM3 {
64010593Sgabeblack@google.com                    0x0: PSHUFD(Vo,Wo,Ib);
64110593Sgabeblack@google.com                    //0x1: group12_pshimw();
64210593Sgabeblack@google.com                    0x1: decode MODRM_REG {
64310593Sgabeblack@google.com                        0x2: PSRLW(VRo,Ib);
64410593Sgabeblack@google.com                        0x4: PSRAW(VRo,Ib);
64510593Sgabeblack@google.com                        0x6: PSLLW(VRo,Ib);
64610593Sgabeblack@google.com                    }
64710593Sgabeblack@google.com                    //0x2: group13_pshimd();
64810593Sgabeblack@google.com                    0x2: decode MODRM_REG {
64910593Sgabeblack@google.com                        0x2: PSRLD(VRo,Ib);
65010593Sgabeblack@google.com                        0x4: PSRAD(VRo,Ib);
65110593Sgabeblack@google.com                        0x6: PSLLD(VRo,Ib);
65210593Sgabeblack@google.com                        default: UD2();
65310593Sgabeblack@google.com                    }
65410593Sgabeblack@google.com                    //0x3: group14_pshimq();
65510593Sgabeblack@google.com                    0x3: decode MODRM_REG {
65610593Sgabeblack@google.com                        0x2: PSRLQ(VRo,Ib);
65710593Sgabeblack@google.com                        0x3: PSRLDQ(VRo,Ib);
65810593Sgabeblack@google.com                        0x6: PSLLQ(VRo,Ib);
65910593Sgabeblack@google.com                        0x7: PSLLDQ(VRo,Ib);
66010593Sgabeblack@google.com                        default: UD2();
66110593Sgabeblack@google.com                    }
66210593Sgabeblack@google.com                    0x4: PCMPEQB(Vo,Wo);
66310593Sgabeblack@google.com                    0x5: PCMPEQW(Vo,Wo);
66410593Sgabeblack@google.com                    0x6: PCMPEQD(Vo,Wo);
66510593Sgabeblack@google.com                    default: UD2();
66610593Sgabeblack@google.com                }
66710593Sgabeblack@google.com                // repne (0xF2)
66810593Sgabeblack@google.com                0x8: decode OPCODE_OP_BOTTOM3 {
66910593Sgabeblack@google.com                    0x0: PSHUFLW(Vo,Wo,Ib);
67010593Sgabeblack@google.com                    default: UD2();
67110593Sgabeblack@google.com                }
67210593Sgabeblack@google.com                default: UD2();
67310593Sgabeblack@google.com            }
67410593Sgabeblack@google.com            0x0F: decode LEGACY_DECODEVAL {
67510593Sgabeblack@google.com                // no prefix
67610593Sgabeblack@google.com                0x0: decode OPCODE_OP_BOTTOM3 {
67710593Sgabeblack@google.com                    0x0: WarnUnimpl::vmread_Edp_Gdp();
67810593Sgabeblack@google.com                    0x1: WarnUnimpl::vmwrite_Gdp_Edp();
67910593Sgabeblack@google.com                    0x6: MOVD(Edp,Pdp);
68010593Sgabeblack@google.com                    0x7: MOVQ(Qq,Pq);
68110593Sgabeblack@google.com                    default: UD2();
68210593Sgabeblack@google.com                }
68310593Sgabeblack@google.com                // repe (0xF3)
68410593Sgabeblack@google.com                0x4: decode OPCODE_OP_BOTTOM3 {
68510593Sgabeblack@google.com                    0x6: MOVQ(Vq,Wq);
68610593Sgabeblack@google.com                    0x7: MOVDQU(Wo,Vo);
68710593Sgabeblack@google.com                    default: UD2();
68810593Sgabeblack@google.com                }
68910593Sgabeblack@google.com                // operand size (0x66)
69010593Sgabeblack@google.com                0x1: decode OPCODE_OP_BOTTOM3 {
69110593Sgabeblack@google.com                    0x4: HADDPD(Vo,Wo);
69210593Sgabeblack@google.com                    0x5: WarnUnimpl::hsubpd_Vo_Wo();
69310593Sgabeblack@google.com                    0x6: MOVD(Edp,Vd);
69410593Sgabeblack@google.com                    0x7: MOVDQA(Wo,Vo);
69510593Sgabeblack@google.com                    default: UD2();
69610593Sgabeblack@google.com                }
69710593Sgabeblack@google.com                // repne (0xF2)
69810593Sgabeblack@google.com                0x8: decode OPCODE_OP_BOTTOM3 {
69910593Sgabeblack@google.com                    0x4: HADDPS(Vo,Wo);
70010593Sgabeblack@google.com                    0x5: WarnUnimpl::hsubps_Vo_Wo();
70110593Sgabeblack@google.com                    default: UD2();
70210593Sgabeblack@google.com                }
70310593Sgabeblack@google.com                default: UD2();
70410593Sgabeblack@google.com            }
70510593Sgabeblack@google.com            0x10: decode OPCODE_OP_BOTTOM3 {
70610593Sgabeblack@google.com                0x0: JO(Jz);
70710593Sgabeblack@google.com                0x1: JNO(Jz);
70810593Sgabeblack@google.com                0x2: JB(Jz);
70910593Sgabeblack@google.com                0x3: JNB(Jz);
71010593Sgabeblack@google.com                0x4: JZ(Jz);
71110593Sgabeblack@google.com                0x5: JNZ(Jz);
71210593Sgabeblack@google.com                0x6: JBE(Jz);
71310593Sgabeblack@google.com                0x7: JNBE(Jz);
71410593Sgabeblack@google.com            }
71510593Sgabeblack@google.com            0x11: decode OPCODE_OP_BOTTOM3 {
71610593Sgabeblack@google.com                0x0: JS(Jz);
71710593Sgabeblack@google.com                0x1: JNS(Jz);
71810593Sgabeblack@google.com                0x2: JP(Jz);
71910593Sgabeblack@google.com                0x3: JNP(Jz);
72010593Sgabeblack@google.com                0x4: JL(Jz);
72110593Sgabeblack@google.com                0x5: JNL(Jz);
72210593Sgabeblack@google.com                0x6: JLE(Jz);
72310593Sgabeblack@google.com                0x7: JNLE(Jz);
72410593Sgabeblack@google.com            }
72510593Sgabeblack@google.com            0x12: decode OPCODE_OP_BOTTOM3 {
72610593Sgabeblack@google.com                0x0: SETO(Eb);
72710593Sgabeblack@google.com                0x1: SETNO(Eb);
72810593Sgabeblack@google.com                0x2: SETB(Eb);
72910593Sgabeblack@google.com                0x3: SETNB(Eb);
73010593Sgabeblack@google.com                0x4: SETZ(Eb);
73110593Sgabeblack@google.com                0x5: SETNZ(Eb);
73210593Sgabeblack@google.com                0x6: SETBE(Eb);
73310593Sgabeblack@google.com                0x7: SETNBE(Eb);
73410593Sgabeblack@google.com            }
73510593Sgabeblack@google.com            0x13: decode OPCODE_OP_BOTTOM3 {
73610593Sgabeblack@google.com                0x0: SETS(Eb);
73710593Sgabeblack@google.com                0x1: SETNS(Eb);
73810593Sgabeblack@google.com                0x2: SETP(Eb);
73910593Sgabeblack@google.com                0x3: SETNP(Eb);
74010593Sgabeblack@google.com                0x4: SETL(Eb);
74110593Sgabeblack@google.com                0x5: SETNL(Eb);
74210593Sgabeblack@google.com                0x6: SETLE(Eb);
74310593Sgabeblack@google.com                0x7: SETNLE(Eb);
74410593Sgabeblack@google.com            }
74510593Sgabeblack@google.com        }
74610593Sgabeblack@google.com        0x14: decode OPCODE_OP_BOTTOM3 {
74710593Sgabeblack@google.com            0x0: push_fs();
74810593Sgabeblack@google.com            0x1: pop_fs();
74910593Sgabeblack@google.com            0x2: CPUIDInst::CPUID({{
75010593Sgabeblack@google.com                CpuidResult result;
75110593Sgabeblack@google.com                bool success = doCpuid(xc->tcBase(), bits(Rax, 31, 0),
75210593Sgabeblack@google.com                    bits(Rcx, 31, 0), result);
75310593Sgabeblack@google.com                if (success) {
75410593Sgabeblack@google.com                    Rax = result.rax;
75510593Sgabeblack@google.com                    Rbx = result.rbx;
75610593Sgabeblack@google.com                    Rcx = result.rcx;
75710593Sgabeblack@google.com                    Rdx = result.rdx;
75810593Sgabeblack@google.com                } else {
75910593Sgabeblack@google.com                    Rax = Rax;
76010593Sgabeblack@google.com                    Rbx = Rbx;
76110593Sgabeblack@google.com                    Rcx = Rcx;
76210593Sgabeblack@google.com                    Rdx = Rdx;
76310593Sgabeblack@google.com                }
76410593Sgabeblack@google.com                }});
76510593Sgabeblack@google.com            0x3: Inst::BT(Ev,Gv);
76610593Sgabeblack@google.com            0x4: Inst::SHLD(Ev,Gv,Ib);
76710593Sgabeblack@google.com            0x5: Inst::SHLD(Ev,Gv);
76810593Sgabeblack@google.com            default: Inst::UD2();
76910593Sgabeblack@google.com        }
77010593Sgabeblack@google.com        0x15: decode OPCODE_OP_BOTTOM3 {
77110593Sgabeblack@google.com            0x0: push_gs();
77210593Sgabeblack@google.com            0x1: pop_gs();
77310593Sgabeblack@google.com            0x2: rsm_smm();
77410593Sgabeblack@google.com            0x3: Inst::BTS(Ev,Gv);
77510593Sgabeblack@google.com            0x4: Inst::SHRD(Ev,Gv,Ib);
77610593Sgabeblack@google.com            0x5: Inst::SHRD(Ev,Gv);
77710593Sgabeblack@google.com            //0x6: group15();
77810593Sgabeblack@google.com            0x6: decode MODRM_MOD {
77910593Sgabeblack@google.com                0x3: decode MODRM_REG {
78010593Sgabeblack@google.com                    0x5: BasicOperate::LFENCE(
78110593Sgabeblack@google.com                                 {{/*Nothing*/}}, IsReadBarrier);
78210593Sgabeblack@google.com                    0x6: BasicOperate::MFENCE(
78310593Sgabeblack@google.com                                 {{/*Nothing*/}}, IsMemBarrier);
78410593Sgabeblack@google.com                    0x7: BasicOperate::SFENCE(
78510593Sgabeblack@google.com                                 {{/*Nothing*/}}, IsWriteBarrier);
78610593Sgabeblack@google.com                    default: Inst::UD2();
78710593Sgabeblack@google.com                }
78810593Sgabeblack@google.com                default: decode MODRM_REG {
78910593Sgabeblack@google.com                    0x0: decode OPSIZE {
79010593Sgabeblack@google.com                        4: Inst::FXSAVE(M);
79110593Sgabeblack@google.com                        8: Inst::FXSAVE64(M);
79210593Sgabeblack@google.com                        default: fxsave();
79310593Sgabeblack@google.com                    }
79410593Sgabeblack@google.com                    0x1: decode OPSIZE {
79510593Sgabeblack@google.com                        4: Inst::FXRSTOR(M);
79610593Sgabeblack@google.com                        8: Inst::FXRSTOR64(M);
79710593Sgabeblack@google.com                        default: fxrstor();
79810593Sgabeblack@google.com                    }
79910593Sgabeblack@google.com                    0x2: Inst::LDMXCSR(Md);
80010593Sgabeblack@google.com                    0x3: Inst::STMXCSR(Md);
80110593Sgabeblack@google.com                    0x4: xsave();
80210593Sgabeblack@google.com                    0x5: xrstor();
80310593Sgabeblack@google.com                    0x6: Inst::UD2();
80410593Sgabeblack@google.com                    0x7: clflush();
80510593Sgabeblack@google.com                }
80610593Sgabeblack@google.com            }
80710593Sgabeblack@google.com            0x7: Inst::IMUL(Gv,Ev);
80810593Sgabeblack@google.com        }
80910593Sgabeblack@google.com        format Inst {
81010593Sgabeblack@google.com            0x16: decode OPCODE_OP_BOTTOM3 {
81110593Sgabeblack@google.com                0x0: CMPXCHG(Eb,Gb);
81210593Sgabeblack@google.com                0x1: CMPXCHG(Ev,Gv);
81310593Sgabeblack@google.com                0x2: WarnUnimpl::lss_Gz_Mp();
81410593Sgabeblack@google.com                0x3: BTR(Ev,Gv);
81510593Sgabeblack@google.com                0x4: WarnUnimpl::lfs_Gz_Mp();
81610593Sgabeblack@google.com                0x5: WarnUnimpl::lgs_Gz_Mp();
81710593Sgabeblack@google.com                //The size of the second operand in these instructions
81810593Sgabeblack@google.com                //should really be "b" or "w", but it's set to v in order
81910593Sgabeblack@google.com                //to have a consistent register size. This shouldn't
82010593Sgabeblack@google.com                //affect behavior.
82110593Sgabeblack@google.com                0x6: MOVZX_B(Gv,Ev);
82210593Sgabeblack@google.com                0x7: MOVZX_W(Gv,Ev);
82310593Sgabeblack@google.com            }
82410593Sgabeblack@google.com            0x17: decode OPCODE_OP_BOTTOM3 {
82510593Sgabeblack@google.com                0x0: decode LEGACY_REP {
82610593Sgabeblack@google.com                    0x0: WarnUnimpl::jmpe_Jz();
82710593Sgabeblack@google.com                    0x1: WarnUnimpl::popcnt_Gv_Ev();
82810593Sgabeblack@google.com                }
82910593Sgabeblack@google.com                //0x1: group10_UD2();
83010593Sgabeblack@google.com                0x1: UD2();
83110593Sgabeblack@google.com                //0x2: group8_Ev_Ib();
83210593Sgabeblack@google.com                0x2: decode MODRM_REG {
83310593Sgabeblack@google.com                    0x4: BT(Ev,Ib);
83410593Sgabeblack@google.com                    0x5: BTS(Ev,Ib);
83510593Sgabeblack@google.com                    0x6: BTR(Ev,Ib);
83610593Sgabeblack@google.com                    0x7: BTC(Ev,Ib);
83710593Sgabeblack@google.com                    default: UD2();
83810593Sgabeblack@google.com                }
83910593Sgabeblack@google.com                0x3: BTC(Ev,Gv);
84010593Sgabeblack@google.com                0x4: BSF(Gv,Ev);
84110593Sgabeblack@google.com                0x5: BSR(Gv,Ev);
84210593Sgabeblack@google.com                //The size of the second operand in these instructions
84310593Sgabeblack@google.com                //should really be "b" or "w", but it's set to v in order
84410593Sgabeblack@google.com                //to have a consistent register size. This shouldn't
84510593Sgabeblack@google.com                //affect behavior.
84610593Sgabeblack@google.com                0x6: MOVSX_B(Gv,Ev);
84710593Sgabeblack@google.com                0x7: MOVSX_W(Gv,Ev);
84810593Sgabeblack@google.com            }
84910593Sgabeblack@google.com            0x18: decode OPCODE_OP_BOTTOM3 {
85010593Sgabeblack@google.com                0x0: XADD(Eb,Gb);
85110593Sgabeblack@google.com                0x1: XADD(Ev,Gv);
85210593Sgabeblack@google.com                //0x7: group9();
85310593Sgabeblack@google.com                0x7: decode MODRM_REG {
85410593Sgabeblack@google.com                    //Also CMPXCHG16B
85510593Sgabeblack@google.com                    0x1: CMPXCHG8B(Mdp);
85610593Sgabeblack@google.com                    0x6: decode LEGACY_OP {
85710593Sgabeblack@google.com                        0x1: WarnUnimpl::vmclear_Mq();
85810593Sgabeblack@google.com                        default: decode LEGACY_REP {
85910593Sgabeblack@google.com                            0x1: WarnUnimpl::vmxon_Mq();
86010593Sgabeblack@google.com                            0x0: WarnUnimpl::vmptrld_Mq();
86110593Sgabeblack@google.com                        }
86210593Sgabeblack@google.com                    }
86310593Sgabeblack@google.com                    0x7: WarnUnimpl::vmptrst_Mq();
86410593Sgabeblack@google.com                    default: UD2();
86510593Sgabeblack@google.com                }
86610593Sgabeblack@google.com                default: decode LEGACY_DECODEVAL {
8676576Sgblack@eecs.umich.edu                    // no prefix
8686576Sgblack@eecs.umich.edu                    0x0: decode OPCODE_OP_BOTTOM3 {
86910593Sgabeblack@google.com                        0x2: CMPPS(Vo,Wo,Ib);
87010593Sgabeblack@google.com                        0x3: MOVNTI(Mdp,Gdp);
87110593Sgabeblack@google.com                        0x4: PINSRW(Pq,Ew,Ib);
87210593Sgabeblack@google.com                        0x5: PEXTRW(Gd,PRq,Ib);
87310593Sgabeblack@google.com                        0x6: SHUFPS(Vps,Wps,Ib);
8745020Sgblack@eecs.umich.edu                    }
8756576Sgblack@eecs.umich.edu                    // repe (0xF3)
8766576Sgblack@eecs.umich.edu                    0x4: decode OPCODE_OP_BOTTOM3 {
87710593Sgabeblack@google.com                        0x2: CMPSS(Vd,Wd,Ib);
8786576Sgblack@eecs.umich.edu                        default: UD2();
8795020Sgblack@eecs.umich.edu                    }
8806576Sgblack@eecs.umich.edu                    // operand size (0x66)
8816576Sgblack@eecs.umich.edu                    0x1: decode OPCODE_OP_BOTTOM3 {
88210593Sgabeblack@google.com                        0x2: CMPPD(Vo,Wo,Ib);
88310593Sgabeblack@google.com                        0x4: PINSRW(Vdw,Ew,Ib);
88410593Sgabeblack@google.com                        0x5: PEXTRW(Gd,VRdq,Ib);
88510593Sgabeblack@google.com                        0x6: SHUFPD(Vpd,Wpd,Ib);
88610593Sgabeblack@google.com                        default: UD2();
8876576Sgblack@eecs.umich.edu                    }
8886576Sgblack@eecs.umich.edu                    // repne (0xF2)
8896576Sgblack@eecs.umich.edu                    0x8: decode OPCODE_OP_BOTTOM3 {
89010593Sgabeblack@google.com                        0x2: CMPSD(Vq,Wq,Ib);
8916611Sgblack@eecs.umich.edu                        default: UD2();
8926611Sgblack@eecs.umich.edu                    }
8936611Sgblack@eecs.umich.edu                    default: UD2();
8945020Sgblack@eecs.umich.edu                }
8954276Sgblack@eecs.umich.edu            }
89610593Sgabeblack@google.com            0x19: decode OPSIZE {
89710593Sgabeblack@google.com                4: BSWAP_D(Bd);
89810593Sgabeblack@google.com                8: BSWAP_Q(Bq);
8996611Sgblack@eecs.umich.edu                default: UD2();
9004276Sgblack@eecs.umich.edu            }
90110593Sgabeblack@google.com            0x1A: decode LEGACY_DECODEVAL {
90210593Sgabeblack@google.com                // no prefix
90310593Sgabeblack@google.com                0x0: decode OPCODE_OP_BOTTOM3 {
90410593Sgabeblack@google.com                    0x1: PSRLW(Pq,Qq);
90510593Sgabeblack@google.com                    0x2: PSRLD(Pq,Qq);
90610593Sgabeblack@google.com                    0x3: PSRLQ(Pq,Qq);
90710593Sgabeblack@google.com                    0x4: PADDQ(Pq,Qq);
90810593Sgabeblack@google.com                    0x5: PMULLW(Pq,Qq);
90910593Sgabeblack@google.com                    0x7: PMOVMSKB(Gd,PRq);
9105059Sgblack@eecs.umich.edu                    default: UD2();
9115020Sgblack@eecs.umich.edu                }
91210593Sgabeblack@google.com                // repe (0xF3)
91310593Sgabeblack@google.com                0x4: decode OPCODE_OP_BOTTOM3 {
91410593Sgabeblack@google.com                    0x6: MOVQ2DQ(Vo,PRq);
9156576Sgblack@eecs.umich.edu                    default: UD2();
9165020Sgblack@eecs.umich.edu                }
91710593Sgabeblack@google.com                // operand size (0x66)
91810593Sgabeblack@google.com                0x1: decode OPCODE_OP_BOTTOM3 {
91910632Smaxime.cscs@gmail.com                    0x0: ADDSUBPD(Vo,Wo);
92010593Sgabeblack@google.com                    0x1: PSRLW(Vo,Wo);
92110593Sgabeblack@google.com                    0x2: PSRLD(Vo,Wo);
92210593Sgabeblack@google.com                    0x3: PSRLQ(Vo,Wo);
92310593Sgabeblack@google.com                    0x4: PADDQ(Vo,Wo);
92410593Sgabeblack@google.com                    0x5: PMULLW(Vo,Wo);
92510593Sgabeblack@google.com                    0x6: MOVQ(Wq,Vq);
92610593Sgabeblack@google.com                    0x7: PMOVMSKB(Gd,VRo);
92710593Sgabeblack@google.com                }
92810593Sgabeblack@google.com                // repne (0xF2)
92910593Sgabeblack@google.com                0x8: decode OPCODE_OP_BOTTOM3 {
93010593Sgabeblack@google.com                    0x0: WarnUnimpl::addsubps_Vo_Wo();
93110593Sgabeblack@google.com                    0x6: MOVDQ2Q(Pq,VRq);
9326576Sgblack@eecs.umich.edu                    default: UD2();
9335020Sgblack@eecs.umich.edu                }
93410593Sgabeblack@google.com                default: UD2();
93510593Sgabeblack@google.com            }
93610593Sgabeblack@google.com            0x1B: decode LEGACY_DECODEVAL {
93710593Sgabeblack@google.com                // no prefix
93810593Sgabeblack@google.com                0x0: decode OPCODE_OP_BOTTOM3 {
93910593Sgabeblack@google.com                    0x0: PSUBUSB(Pq,Qq);
94010593Sgabeblack@google.com                    0x1: PSUBUSW(Pq,Qq);
94110593Sgabeblack@google.com                    0x2: PMINUB(Pq,Qq);
94210593Sgabeblack@google.com                    0x3: PAND(Pq,Qq);
94310593Sgabeblack@google.com                    0x4: PADDUSB(Pq,Qq);
94410593Sgabeblack@google.com                    0x5: PADDUSW(Pq,Qq);
94510593Sgabeblack@google.com                    0x6: PMAXUB(Pq,Qq);
94610593Sgabeblack@google.com                    0x7: PANDN(Pq,Qq);
94710593Sgabeblack@google.com                }
94810593Sgabeblack@google.com                // operand size (0x66)
94910593Sgabeblack@google.com                0x1: decode OPCODE_OP_BOTTOM3 {
95010593Sgabeblack@google.com                    0x0: PSUBUSB(Vo,Wo);
95110593Sgabeblack@google.com                    0x1: PSUBUSW(Vo,Wo);
95210593Sgabeblack@google.com                    0x2: PMINUB(Vo,Wo);
95310593Sgabeblack@google.com                    0x3: PAND(Vo,Wo);
95410593Sgabeblack@google.com                    0x4: PADDUSB(Vo,Wo);
95510593Sgabeblack@google.com                    0x5: PADDUSW(Vo,Wo);
95610593Sgabeblack@google.com                    0x6: PMAXUB(Vo,Wo);
95710593Sgabeblack@google.com                    0x7: PANDN(Vo,Wo);
95810593Sgabeblack@google.com                }
95910593Sgabeblack@google.com                default: UD2();
96010593Sgabeblack@google.com            }
96110593Sgabeblack@google.com            0x1C: decode LEGACY_DECODEVAL {
96210593Sgabeblack@google.com                // no prefix
96310593Sgabeblack@google.com                0x0: decode OPCODE_OP_BOTTOM3 {
96410593Sgabeblack@google.com                    0x0: PAVGB(Pq,Qq);
96510593Sgabeblack@google.com                    0x1: PSRAW(Pq,Qq);
96610593Sgabeblack@google.com                    0x2: PSRAD(Pq,Qq);
96710593Sgabeblack@google.com                    0x3: PAVGW(Pq,Qq);
96810593Sgabeblack@google.com                    0x4: PMULHUW(Pq,Qq);
96910593Sgabeblack@google.com                    0x5: PMULHW(Pq,Qq);
97010593Sgabeblack@google.com                    0x7: WarnUnimpl::movntq_Mq_Pq();
9716576Sgblack@eecs.umich.edu                    default: UD2();
9725020Sgblack@eecs.umich.edu                }
97310593Sgabeblack@google.com                // repe (0xF3)
97410593Sgabeblack@google.com                0x4: decode OPCODE_OP_BOTTOM3 {
97510593Sgabeblack@google.com                    0x6: CVTDQ2PD(Vo,Wq);
9766584Sgblack@eecs.umich.edu                    default: UD2();
9775020Sgblack@eecs.umich.edu                }
97810593Sgabeblack@google.com                // operand size (0x66)
97910593Sgabeblack@google.com                0x1: decode OPCODE_OP_BOTTOM3 {
98010593Sgabeblack@google.com                    0x0: PAVGB(Vo,Wo);
98110593Sgabeblack@google.com                    0x1: PSRAW(Vo,Wo);
98210593Sgabeblack@google.com                    0x2: PSRAD(Vo,Wo);
98310593Sgabeblack@google.com                    0x3: PAVGW(Vo,Wo);
98410593Sgabeblack@google.com                    0x4: PMULHUW(Vo,Wo);
98510593Sgabeblack@google.com                    0x5: PMULHW(Vo,Wo);
98610593Sgabeblack@google.com                    0x6: CVTTPD2DQ(Vo,Wo);
98710593Sgabeblack@google.com                    0x7: WarnUnimpl::movntdq_Mo_Vo();
98810593Sgabeblack@google.com                }
98910593Sgabeblack@google.com                // repne (0xF2)
99010593Sgabeblack@google.com                0x8: decode OPCODE_OP_BOTTOM3 {
99110593Sgabeblack@google.com                    0x6: CVTPD2DQ(Vo,Wo);
9926584Sgblack@eecs.umich.edu                    default: UD2();
9935020Sgblack@eecs.umich.edu                }
99410593Sgabeblack@google.com                default: UD2();
99510593Sgabeblack@google.com            }
99610593Sgabeblack@google.com            0x1D: decode LEGACY_DECODEVAL {
99710593Sgabeblack@google.com                // no prefix
99810593Sgabeblack@google.com                0x0: decode OPCODE_OP_BOTTOM3 {
99910593Sgabeblack@google.com                    0x0: PSUBSB(Pq,Qq);
100010593Sgabeblack@google.com                    0x1: PSUBSW(Pq,Qq);
100110593Sgabeblack@google.com                    0x2: PMINSW(Pq,Qq);
100210593Sgabeblack@google.com                    0x3: POR(Pq,Qq);
100310593Sgabeblack@google.com                    0x4: PADDSB(Pq,Qq);
100410593Sgabeblack@google.com                    0x5: PADDSW(Pq,Qq);
100510593Sgabeblack@google.com                    0x6: PMAXSW(Pq,Qq);
100610593Sgabeblack@google.com                    0x7: PXOR(Pq,Qq);
10074727Sgblack@eecs.umich.edu                }
100810593Sgabeblack@google.com                // operand size (0x66)
100910593Sgabeblack@google.com                0x1: decode OPCODE_OP_BOTTOM3 {
101010593Sgabeblack@google.com                    0x0: PSUBSB(Vo,Wo);
101110593Sgabeblack@google.com                    0x1: PSUBSW(Vo,Wo);
101210593Sgabeblack@google.com                    0x2: PMINSW(Vo,Wo);
101310593Sgabeblack@google.com                    0x3: POR(Vo,Wo);
101410593Sgabeblack@google.com                    0x4: PADDSB(Vo,Wo);
101510593Sgabeblack@google.com                    0x5: PADDSW(Vo,Wo);
101610593Sgabeblack@google.com                    0x6: PMAXSW(Vo,Wo);
101710593Sgabeblack@google.com                    0x7: PXOR(Vo,Wo);
10184727Sgblack@eecs.umich.edu                }
101910593Sgabeblack@google.com                default: UD2();
10204276Sgblack@eecs.umich.edu            }
102110593Sgabeblack@google.com            0x1E: decode LEGACY_DECODEVAL {
102210593Sgabeblack@google.com                // no prefix
102310593Sgabeblack@google.com                0x0: decode OPCODE_OP_BOTTOM3 {
102410593Sgabeblack@google.com                    0x1: PSLLW(Pq,Qq);
102510593Sgabeblack@google.com                    0x2: PSLLD(Pq,Qq);
102610593Sgabeblack@google.com                    0x3: PSLLQ(Pq,Qq);
102710593Sgabeblack@google.com                    0x4: PMULUDQ(Pq,Qq);
102810593Sgabeblack@google.com                    0x5: PMADDWD(Pq,Qq);
102910593Sgabeblack@google.com                    0x6: PSADBW(Pq,Qq);
103010593Sgabeblack@google.com                    0x7: MASKMOVQ(Pq,PRq);
10316576Sgblack@eecs.umich.edu                    default: UD2();
10325020Sgblack@eecs.umich.edu                }
103310593Sgabeblack@google.com                // operand size (0x66)
103410593Sgabeblack@google.com                0x1: decode OPCODE_OP_BOTTOM3 {
103510593Sgabeblack@google.com                    0x1: PSLLW(Vo,Wo);
103610593Sgabeblack@google.com                    0x2: PSLLD(Vo,Wo);
103710593Sgabeblack@google.com                    0x3: PSLLQ(Vo,Wo);
103810593Sgabeblack@google.com                    0x4: PMULUDQ(Vo,Wo);
103910593Sgabeblack@google.com                    0x5: PMADDWD(Vo,Wo);
104010593Sgabeblack@google.com                    0x6: PSADBW(Vo,Wo);
104110593Sgabeblack@google.com                    0x7: MASKMOVDQU(Vo,VRo);
10426593Sgblack@eecs.umich.edu                    default: UD2();
10435020Sgblack@eecs.umich.edu                }
104410593Sgabeblack@google.com                // repne (0xF2)
104510593Sgabeblack@google.com                0x8: decode OPCODE_OP_BOTTOM3 {
104610593Sgabeblack@google.com                    0x0: WarnUnimpl::lddqu_Vo_Mo();
10476576Sgblack@eecs.umich.edu                    default: UD2();
10485020Sgblack@eecs.umich.edu                }
104910593Sgabeblack@google.com                default: UD2();
105010593Sgabeblack@google.com            }
105110593Sgabeblack@google.com            0x1F: decode LEGACY_DECODEVAL {
105210593Sgabeblack@google.com                // no prefix
105310593Sgabeblack@google.com                0x0: decode OPCODE_OP_BOTTOM3 {
105410593Sgabeblack@google.com                    0x0: PSUBB(Pq,Qq);
105510593Sgabeblack@google.com                    0x1: PSUBW(Pq,Qq);
105610593Sgabeblack@google.com                    0x2: PSUBD(Pq,Qq);
105710593Sgabeblack@google.com                    0x3: PSUBQ(Pq,Qq);
105810593Sgabeblack@google.com                    0x4: PADDB(Pq,Qq);
105910593Sgabeblack@google.com                    0x5: PADDW(Pq,Qq);
106010593Sgabeblack@google.com                    0x6: PADDD(Pq,Qq);
106110593Sgabeblack@google.com                    0x7: UD2();
10625022Sgblack@eecs.umich.edu                }
106310593Sgabeblack@google.com                // operand size (0x66)
106410593Sgabeblack@google.com                0x1: decode OPCODE_OP_BOTTOM3 {
106510593Sgabeblack@google.com                    0x0: PSUBB(Vo,Wo);
106610593Sgabeblack@google.com                    0x1: PSUBW(Vo,Wo);
106710593Sgabeblack@google.com                    0x2: PSUBD(Vo,Wo);
106810593Sgabeblack@google.com                    0x3: PSUBQ(Vo,Wo);
106910593Sgabeblack@google.com                    0x4: PADDB(Vo,Wo);
107010593Sgabeblack@google.com                    0x5: PADDW(Vo,Wo);
107110593Sgabeblack@google.com                    0x6: PADDD(Vo,Wo);
107210593Sgabeblack@google.com                    0x7: UD2();
10735020Sgblack@eecs.umich.edu                }
107410593Sgabeblack@google.com                default: UD2();
10754276Sgblack@eecs.umich.edu            }
10764276Sgblack@eecs.umich.edu        }
107710593Sgabeblack@google.com        default: FailUnimpl::twoByteOps();
10784276Sgblack@eecs.umich.edu    }
10794276Sgblack@eecs.umich.edu}
1080