decoder.isa revision 2470
112953Sgabeblack@google.com// -*- mode:c++ -*-
212953Sgabeblack@google.com
312953Sgabeblack@google.com// Copyright (c) 2003-2006 The Regents of The University of Michigan
412953Sgabeblack@google.com// All rights reserved.
512953Sgabeblack@google.com//
612953Sgabeblack@google.com// Redistribution and use in source and binary forms, with or without
712953Sgabeblack@google.com// modification, are permitted provided that the following conditions are
812953Sgabeblack@google.com// met: redistributions of source code must retain the above copyright
912953Sgabeblack@google.com// notice, this list of conditions and the following disclaimer;
1012953Sgabeblack@google.com// redistributions in binary form must reproduce the above copyright
1112953Sgabeblack@google.com// notice, this list of conditions and the following disclaimer in the
1212953Sgabeblack@google.com// documentation and/or other materials provided with the distribution;
1312953Sgabeblack@google.com// neither the name of the copyright holders nor the names of its
1412953Sgabeblack@google.com// contributors may be used to endorse or promote products derived from
1512953Sgabeblack@google.com// this software without specific prior written permission.
1612953Sgabeblack@google.com//
1712953Sgabeblack@google.com// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1812953Sgabeblack@google.com// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1912953Sgabeblack@google.com// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2012953Sgabeblack@google.com// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2112953Sgabeblack@google.com// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2212953Sgabeblack@google.com// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2312953Sgabeblack@google.com// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2412953Sgabeblack@google.com// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2512953Sgabeblack@google.com// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2612953Sgabeblack@google.com// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2712953Sgabeblack@google.com// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2812953Sgabeblack@google.com
2912953Sgabeblack@google.comdecode OPCODE default Unknown::unknown() {
3012953Sgabeblack@google.com
3112953Sgabeblack@google.com    format LoadAddress {
3212953Sgabeblack@google.com        0x08: lda({{ Ra = Rb + disp; }});
3313063Sgabeblack@google.com        0x09: ldah({{ Ra = Rb + (disp << 16); }});
3413063Sgabeblack@google.com    }
3513063Sgabeblack@google.com
3612957Sgabeblack@google.com    format LoadOrNop {
3712957Sgabeblack@google.com        0x0a: ldbu({{ Ra.uq = Mem.ub; }});
3812961Sgabeblack@google.com        0x0c: ldwu({{ Ra.uq = Mem.uw; }});
3913063Sgabeblack@google.com        0x0b: ldq_u({{ Ra = Mem.uq; }}, ea_code = {{ EA = (Rb + disp) & ~7; }});
4012954Sgabeblack@google.com        0x23: ldt({{ Fa = Mem.df; }});
4112954Sgabeblack@google.com        0x2a: ldl_l({{ Ra.sl = Mem.sl; }}, mem_flags = LOCKED);
4212953Sgabeblack@google.com        0x2b: ldq_l({{ Ra.uq = Mem.uq; }}, mem_flags = LOCKED);
4312953Sgabeblack@google.com        0x20: MiscPrefetch::copy_load({{ EA = Ra; }},
4413063Sgabeblack@google.com                                      {{ fault = xc->copySrcTranslate(EA); }},
4512953Sgabeblack@google.com                                      inst_flags = [IsMemRef, IsLoad, IsCopy]);
4612961Sgabeblack@google.com    }
4712961Sgabeblack@google.com
4812953Sgabeblack@google.com    format LoadOrPrefetch {
4912953Sgabeblack@google.com        0x28: ldl({{ Ra.sl = Mem.sl; }});
5012953Sgabeblack@google.com        0x29: ldq({{ Ra.uq = Mem.uq; }}, pf_flags = EVICT_NEXT);
5112953Sgabeblack@google.com        // IsFloating flag on lds gets the prefetch to disassemble
5212954Sgabeblack@google.com        // using f31 instead of r31... funcitonally it's unnecessary
5312954Sgabeblack@google.com        0x22: lds({{ Fa.uq = s_to_t(Mem.ul); }},
5412954Sgabeblack@google.com                  pf_flags = PF_EXCLUSIVE, inst_flags = IsFloating);
5512954Sgabeblack@google.com    }
5612954Sgabeblack@google.com
5712954Sgabeblack@google.com    format Store {
5812954Sgabeblack@google.com        0x0e: stb({{ Mem.ub = Ra<7:0>; }});
5912954Sgabeblack@google.com        0x0d: stw({{ Mem.uw = Ra<15:0>; }});
6012954Sgabeblack@google.com        0x2c: stl({{ Mem.ul = Ra<31:0>; }});
6112954Sgabeblack@google.com        0x2d: stq({{ Mem.uq = Ra.uq; }});
6212954Sgabeblack@google.com        0x0f: stq_u({{ Mem.uq = Ra.uq; }}, {{ EA = (Rb + disp) & ~7; }});
6312954Sgabeblack@google.com        0x26: sts({{ Mem.ul = t_to_s(Fa.uq); }});
6412954Sgabeblack@google.com        0x27: stt({{ Mem.df = Fa; }});
6512954Sgabeblack@google.com        0x24: MiscPrefetch::copy_store({{ EA = Rb; }},
6612954Sgabeblack@google.com                                       {{ fault = xc->copy(EA); }},
6712954Sgabeblack@google.com                                       inst_flags = [IsMemRef, IsStore, IsCopy]);
6812954Sgabeblack@google.com    }
6912954Sgabeblack@google.com
7012954Sgabeblack@google.com    format StoreCond {
7112957Sgabeblack@google.com        0x2e: stl_c({{ Mem.ul = Ra<31:0>; }},
7212954Sgabeblack@google.com                    {{
7312954Sgabeblack@google.com                        uint64_t tmp = write_result;
7412954Sgabeblack@google.com                        // see stq_c
7512954Sgabeblack@google.com                        Ra = (tmp == 0 || tmp == 1) ? tmp : Ra;
7612954Sgabeblack@google.com                    }}, mem_flags = LOCKED);
7712954Sgabeblack@google.com        0x2f: stq_c({{ Mem.uq = Ra; }},
7812954Sgabeblack@google.com                    {{
7912954Sgabeblack@google.com                        uint64_t tmp = write_result;
8012954Sgabeblack@google.com                        // If the write operation returns 0 or 1, then
8112954Sgabeblack@google.com                        // this was a conventional store conditional,
8212954Sgabeblack@google.com                        // and the value indicates the success/failure
8312954Sgabeblack@google.com                        // of the operation.  If another value is
8412954Sgabeblack@google.com                        // returned, then this was a Turbolaser
8512954Sgabeblack@google.com                        // mailbox access, and we don't update the
8612954Sgabeblack@google.com                        // result register at all.
8712954Sgabeblack@google.com                        Ra = (tmp == 0 || tmp == 1) ? tmp : Ra;
8812954Sgabeblack@google.com                    }}, mem_flags = LOCKED);
8913063Sgabeblack@google.com    }
9012954Sgabeblack@google.com
9112954Sgabeblack@google.com    format IntegerOperate {
9212954Sgabeblack@google.com
9312954Sgabeblack@google.com        0x10: decode INTFUNC {	// integer arithmetic operations
9412954Sgabeblack@google.com
9512954Sgabeblack@google.com            0x00: addl({{ Rc.sl = Ra.sl + Rb_or_imm.sl; }});
9612954Sgabeblack@google.com            0x40: addlv({{
9712954Sgabeblack@google.com                uint32_t tmp  = Ra.sl + Rb_or_imm.sl;
9812954Sgabeblack@google.com                // signed overflow occurs when operands have same sign
9913063Sgabeblack@google.com                // and sign of result does not match.
10013063Sgabeblack@google.com                if (Ra.sl<31:> == Rb_or_imm.sl<31:> && tmp<31:> != Ra.sl<31:>)
10112954Sgabeblack@google.com                    fault = new IntegerOverflowFault;
10212954Sgabeblack@google.com                Rc.sl = tmp;
10313063Sgabeblack@google.com            }});
10413063Sgabeblack@google.com            0x02: s4addl({{ Rc.sl = (Ra.sl << 2) + Rb_or_imm.sl; }});
10512954Sgabeblack@google.com            0x12: s8addl({{ Rc.sl = (Ra.sl << 3) + Rb_or_imm.sl; }});
10612954Sgabeblack@google.com
10712954Sgabeblack@google.com            0x20: addq({{ Rc = Ra + Rb_or_imm; }});
10812954Sgabeblack@google.com            0x60: addqv({{
10913063Sgabeblack@google.com                uint64_t tmp = Ra + Rb_or_imm;
11013063Sgabeblack@google.com                // signed overflow occurs when operands have same sign
11113063Sgabeblack@google.com                // and sign of result does not match.
11213063Sgabeblack@google.com                if (Ra<63:> == Rb_or_imm<63:> && tmp<63:> != Ra<63:>)
11313063Sgabeblack@google.com                    fault = new IntegerOverflowFault;
11412961Sgabeblack@google.com                Rc = tmp;
11512961Sgabeblack@google.com            }});
11612961Sgabeblack@google.com            0x22: s4addq({{ Rc = (Ra << 2) + Rb_or_imm; }});
11712961Sgabeblack@google.com            0x32: s8addq({{ Rc = (Ra << 3) + Rb_or_imm; }});
11812961Sgabeblack@google.com
11912961Sgabeblack@google.com            0x09: subl({{ Rc.sl = Ra.sl - Rb_or_imm.sl; }});
12012961Sgabeblack@google.com            0x49: sublv({{
12112961Sgabeblack@google.com                uint32_t tmp  = Ra.sl - Rb_or_imm.sl;
12212961Sgabeblack@google.com                // signed overflow detection is same as for add,
12312961Sgabeblack@google.com                // except we need to look at the *complemented*
12412961Sgabeblack@google.com                // sign bit of the subtrahend (Rb), i.e., if the initial
12512961Sgabeblack@google.com                // signs are the *same* then no overflow can occur
12612961Sgabeblack@google.com                if (Ra.sl<31:> != Rb_or_imm.sl<31:> && tmp<31:> != Ra.sl<31:>)
12712961Sgabeblack@google.com                    fault = new IntegerOverflowFault;
12812961Sgabeblack@google.com                Rc.sl = tmp;
12912961Sgabeblack@google.com            }});
13012961Sgabeblack@google.com            0x0b: s4subl({{ Rc.sl = (Ra.sl << 2) - Rb_or_imm.sl; }});
13112961Sgabeblack@google.com            0x1b: s8subl({{ Rc.sl = (Ra.sl << 3) - Rb_or_imm.sl; }});
13212961Sgabeblack@google.com
13312961Sgabeblack@google.com            0x29: subq({{ Rc = Ra - Rb_or_imm; }});
13412961Sgabeblack@google.com            0x69: subqv({{
13513058Sgabeblack@google.com                uint64_t tmp  = Ra - Rb_or_imm;
13613058Sgabeblack@google.com                // signed overflow detection is same as for add,
13713058Sgabeblack@google.com                // except we need to look at the *complemented*
13813058Sgabeblack@google.com                // sign bit of the subtrahend (Rb), i.e., if the initial
13913058Sgabeblack@google.com                // signs are the *same* then no overflow can occur
14013058Sgabeblack@google.com                if (Ra<63:> != Rb_or_imm<63:> && tmp<63:> != Ra<63:>)
14113058Sgabeblack@google.com                    fault = new IntegerOverflowFault;
14213058Sgabeblack@google.com                Rc = tmp;
14312954Sgabeblack@google.com            }});
14412953Sgabeblack@google.com            0x2b: s4subq({{ Rc = (Ra << 2) - Rb_or_imm; }});
14512953Sgabeblack@google.com            0x3b: s8subq({{ Rc = (Ra << 3) - Rb_or_imm; }});
14612953Sgabeblack@google.com
14712953Sgabeblack@google.com            0x2d: cmpeq({{ Rc = (Ra == Rb_or_imm); }});
14813063Sgabeblack@google.com            0x6d: cmple({{ Rc = (Ra.sq <= Rb_or_imm.sq); }});
14913063Sgabeblack@google.com            0x4d: cmplt({{ Rc = (Ra.sq <  Rb_or_imm.sq); }});
15013063Sgabeblack@google.com            0x3d: cmpule({{ Rc = (Ra.uq <= Rb_or_imm.uq); }});
15113063Sgabeblack@google.com            0x1d: cmpult({{ Rc = (Ra.uq <  Rb_or_imm.uq); }});
15213063Sgabeblack@google.com
15313063Sgabeblack@google.com            0x0f: cmpbge({{
15413063Sgabeblack@google.com                int hi = 7;
15513063Sgabeblack@google.com                int lo = 0;
15613063Sgabeblack@google.com                uint64_t tmp = 0;
15713063Sgabeblack@google.com                for (int i = 0; i < 8; ++i) {
15813063Sgabeblack@google.com                    tmp |= (Ra.uq<hi:lo> >= Rb_or_imm.uq<hi:lo>) << i;
15913063Sgabeblack@google.com                    hi += 8;
16013063Sgabeblack@google.com                    lo += 8;
16112953Sgabeblack@google.com                }
16212953Sgabeblack@google.com                Rc = tmp;
16312954Sgabeblack@google.com            }});
16412954Sgabeblack@google.com        }
16512953Sgabeblack@google.com
16612953Sgabeblack@google.com        0x11: decode INTFUNC {	// integer logical operations
16712953Sgabeblack@google.com
16813067Sgabeblack@google.com            0x00: and({{ Rc = Ra & Rb_or_imm; }});
16912953Sgabeblack@google.com            0x08: bic({{ Rc = Ra & ~Rb_or_imm; }});
17012957Sgabeblack@google.com            0x20: bis({{ Rc = Ra | Rb_or_imm; }});
17112957Sgabeblack@google.com            0x28: ornot({{ Rc = Ra | ~Rb_or_imm; }});
17212957Sgabeblack@google.com            0x40: xor({{ Rc = Ra ^ Rb_or_imm; }});
17312957Sgabeblack@google.com            0x48: eqv({{ Rc = Ra ^ ~Rb_or_imm; }});
17412957Sgabeblack@google.com
17512953Sgabeblack@google.com            // conditional moves
17612953Sgabeblack@google.com            0x14: cmovlbs({{ Rc = ((Ra & 1) == 1) ? Rb_or_imm : Rc; }});
17712953Sgabeblack@google.com            0x16: cmovlbc({{ Rc = ((Ra & 1) == 0) ? Rb_or_imm : Rc; }});
17812953Sgabeblack@google.com            0x24: cmoveq({{ Rc = (Ra == 0) ? Rb_or_imm : Rc; }});
17912953Sgabeblack@google.com            0x26: cmovne({{ Rc = (Ra != 0) ? Rb_or_imm : Rc; }});
18012954Sgabeblack@google.com            0x44: cmovlt({{ Rc = (Ra.sq <  0) ? Rb_or_imm : Rc; }});
18112954Sgabeblack@google.com            0x46: cmovge({{ Rc = (Ra.sq >= 0) ? Rb_or_imm : Rc; }});
18212954Sgabeblack@google.com            0x64: cmovle({{ Rc = (Ra.sq <= 0) ? Rb_or_imm : Rc; }});
18312954Sgabeblack@google.com            0x66: cmovgt({{ Rc = (Ra.sq >  0) ? Rb_or_imm : Rc; }});
18412953Sgabeblack@google.com
18512953Sgabeblack@google.com            // For AMASK, RA must be R31.
18612953Sgabeblack@google.com            0x61: decode RA {
18712953Sgabeblack@google.com                31: amask({{ Rc = Rb_or_imm & ~ULL(0x17); }});
18812953Sgabeblack@google.com            }
18912953Sgabeblack@google.com
19012953Sgabeblack@google.com            // For IMPLVER, RA must be R31 and the B operand
19112953Sgabeblack@google.com            // must be the immediate value 1.
19212953Sgabeblack@google.com            0x6c: decode RA {
19312953Sgabeblack@google.com                31: decode IMM {
19412953Sgabeblack@google.com                    1: decode INTIMM {
19512953Sgabeblack@google.com                        // return EV5 for FULL_SYSTEM and EV6 otherwise
19612953Sgabeblack@google.com                        1: implver({{
19712954Sgabeblack@google.com#if FULL_SYSTEM
19812954Sgabeblack@google.com                             Rc = 1;
19912954Sgabeblack@google.com#else
20012962Sgabeblack@google.com                             Rc = 2;
20112962Sgabeblack@google.com#endif
20212962Sgabeblack@google.com                        }});
20313063Sgabeblack@google.com                    }
20413063Sgabeblack@google.com                }
20513063Sgabeblack@google.com            }
20613063Sgabeblack@google.com
20713063Sgabeblack@google.com#if FULL_SYSTEM
20813063Sgabeblack@google.com            // The mysterious 11.25...
20913063Sgabeblack@google.com            0x25: WarnUnimpl::eleven25();
21012962Sgabeblack@google.com#endif
21112962Sgabeblack@google.com        }
21213063Sgabeblack@google.com
21312962Sgabeblack@google.com        0x12: decode INTFUNC {
21413063Sgabeblack@google.com            0x39: sll({{ Rc = Ra << Rb_or_imm<5:0>; }});
21513063Sgabeblack@google.com            0x34: srl({{ Rc = Ra.uq >> Rb_or_imm<5:0>; }});
21612985Sgabeblack@google.com            0x3c: sra({{ Rc = Ra.sq >> Rb_or_imm<5:0>; }});
21713063Sgabeblack@google.com
21813063Sgabeblack@google.com            0x02: mskbl({{ Rc = Ra & ~(mask( 8) << (Rb_or_imm<2:0> * 8)); }});
21913063Sgabeblack@google.com            0x12: mskwl({{ Rc = Ra & ~(mask(16) << (Rb_or_imm<2:0> * 8)); }});
22013063Sgabeblack@google.com            0x22: mskll({{ Rc = Ra & ~(mask(32) << (Rb_or_imm<2:0> * 8)); }});
22113063Sgabeblack@google.com            0x32: mskql({{ Rc = Ra & ~(mask(64) << (Rb_or_imm<2:0> * 8)); }});
22213063Sgabeblack@google.com
22313063Sgabeblack@google.com            0x52: mskwh({{
22413063Sgabeblack@google.com                int bv = Rb_or_imm<2:0>;
22513063Sgabeblack@google.com                Rc =  bv ? (Ra & ~(mask(16) >> (64 - 8 * bv))) : Ra;
22613063Sgabeblack@google.com            }});
22713063Sgabeblack@google.com            0x62: msklh({{
22813069Sgabeblack@google.com                int bv = Rb_or_imm<2:0>;
22913063Sgabeblack@google.com                Rc =  bv ? (Ra & ~(mask(32) >> (64 - 8 * bv))) : Ra;
23013063Sgabeblack@google.com            }});
23112962Sgabeblack@google.com            0x72: mskqh({{
23212962Sgabeblack@google.com                int bv = Rb_or_imm<2:0>;
23312962Sgabeblack@google.com                Rc =  bv ? (Ra & ~(mask(64) >> (64 - 8 * bv))) : Ra;
23412962Sgabeblack@google.com            }});
23513063Sgabeblack@google.com
23612962Sgabeblack@google.com            0x06: extbl({{ Rc = (Ra.uq >> (Rb_or_imm<2:0> * 8))< 7:0>; }});
23713063Sgabeblack@google.com            0x16: extwl({{ Rc = (Ra.uq >> (Rb_or_imm<2:0> * 8))<15:0>; }});
23813063Sgabeblack@google.com            0x26: extll({{ Rc = (Ra.uq >> (Rb_or_imm<2:0> * 8))<31:0>; }});
23913063Sgabeblack@google.com            0x36: extql({{ Rc = (Ra.uq >> (Rb_or_imm<2:0> * 8)); }});
24013063Sgabeblack@google.com
24113063Sgabeblack@google.com            0x5a: extwh({{
24213063Sgabeblack@google.com                Rc = (Ra << (64 - (Rb_or_imm<2:0> * 8))<5:0>)<15:0>; }});
24312985Sgabeblack@google.com            0x6a: extlh({{
24413063Sgabeblack@google.com                Rc = (Ra << (64 - (Rb_or_imm<2:0> * 8))<5:0>)<31:0>; }});
24513063Sgabeblack@google.com            0x7a: extqh({{
24613063Sgabeblack@google.com                Rc = (Ra << (64 - (Rb_or_imm<2:0> * 8))<5:0>); }});
24713063Sgabeblack@google.com
24813063Sgabeblack@google.com            0x0b: insbl({{ Rc = Ra< 7:0> << (Rb_or_imm<2:0> * 8); }});
24913063Sgabeblack@google.com            0x1b: inswl({{ Rc = Ra<15:0> << (Rb_or_imm<2:0> * 8); }});
25013063Sgabeblack@google.com            0x2b: insll({{ Rc = Ra<31:0> << (Rb_or_imm<2:0> * 8); }});
25113063Sgabeblack@google.com            0x3b: insql({{ Rc = Ra       << (Rb_or_imm<2:0> * 8); }});
25213063Sgabeblack@google.com
25313063Sgabeblack@google.com            0x57: inswh({{
25413063Sgabeblack@google.com                int bv = Rb_or_imm<2:0>;
25513069Sgabeblack@google.com                Rc = bv ? (Ra.uq<15:0> >> (64 - 8 * bv)) : 0;
25613063Sgabeblack@google.com            }});
25713063Sgabeblack@google.com            0x67: inslh({{
25812962Sgabeblack@google.com                int bv = Rb_or_imm<2:0>;
25912962Sgabeblack@google.com                Rc = bv ? (Ra.uq<31:0> >> (64 - 8 * bv)) : 0;
26012962Sgabeblack@google.com            }});
26113063Sgabeblack@google.com            0x77: insqh({{
26212962Sgabeblack@google.com                int bv = Rb_or_imm<2:0>;
26313063Sgabeblack@google.com                Rc = bv ? (Ra.uq       >> (64 - 8 * bv)) : 0;
26413063Sgabeblack@google.com            }});
26512962Sgabeblack@google.com
26612962Sgabeblack@google.com            0x30: zap({{
26712962Sgabeblack@google.com                uint64_t zapmask = 0;
26812962Sgabeblack@google.com                for (int i = 0; i < 8; ++i) {
26912962Sgabeblack@google.com                    if (Rb_or_imm<i:>)
27012962Sgabeblack@google.com                        zapmask |= (mask(8) << (i * 8));
27112962Sgabeblack@google.com                }
27212962Sgabeblack@google.com                Rc = Ra & ~zapmask;
27312962Sgabeblack@google.com            }});
27412962Sgabeblack@google.com            0x31: zapnot({{
27512962Sgabeblack@google.com                uint64_t zapmask = 0;
27612962Sgabeblack@google.com                for (int i = 0; i < 8; ++i) {
27712962Sgabeblack@google.com                    if (!Rb_or_imm<i:>)
27813063Sgabeblack@google.com                        zapmask |= (mask(8) << (i * 8));
27912962Sgabeblack@google.com                }
28012962Sgabeblack@google.com                Rc = Ra & ~zapmask;
28112962Sgabeblack@google.com            }});
28212962Sgabeblack@google.com        }
28312962Sgabeblack@google.com
28412962Sgabeblack@google.com        0x13: decode INTFUNC {	// integer multiplies
28513063Sgabeblack@google.com            0x00: mull({{ Rc.sl = Ra.sl * Rb_or_imm.sl; }}, IntMultOp);
28612962Sgabeblack@google.com            0x20: mulq({{ Rc    = Ra    * Rb_or_imm;    }}, IntMultOp);
28712962Sgabeblack@google.com            0x30: umulh({{
28812962Sgabeblack@google.com                uint64_t hi, lo;
28912962Sgabeblack@google.com                mul128(Ra, Rb_or_imm, hi, lo);
29012962Sgabeblack@google.com                Rc = hi;
29112962Sgabeblack@google.com            }}, IntMultOp);
29213063Sgabeblack@google.com            0x40: mullv({{
29312962Sgabeblack@google.com                // 32-bit multiply with trap on overflow
29413063Sgabeblack@google.com                int64_t Rax = Ra.sl;	// sign extended version of Ra.sl
29513063Sgabeblack@google.com                int64_t Rbx = Rb_or_imm.sl;
29613063Sgabeblack@google.com                int64_t tmp = Rax * Rbx;
29712962Sgabeblack@google.com                // To avoid overflow, all the upper 32 bits must match
29812954Sgabeblack@google.com                // the sign bit of the lower 32.  We code this as
29912954Sgabeblack@google.com                // checking the upper 33 bits for all 0s or all 1s.
30012954Sgabeblack@google.com                uint64_t sign_bits = tmp<63:31>;
30112954Sgabeblack@google.com                if (sign_bits != 0 && sign_bits != mask(33))
30212961Sgabeblack@google.com                    fault = new IntegerOverflowFault;
30312961Sgabeblack@google.com                Rc.sl = tmp<31:0>;
30412961Sgabeblack@google.com            }}, IntMultOp);
30513061Sgabeblack@google.com            0x60: mulqv({{
30612961Sgabeblack@google.com                // 64-bit multiply with trap on overflow
30712961Sgabeblack@google.com                uint64_t hi, lo;
30812961Sgabeblack@google.com                mul128(Ra, Rb_or_imm, hi, lo);
30912961Sgabeblack@google.com                // all the upper 64 bits must match the sign bit of
31012961Sgabeblack@google.com                // the lower 64
31112961Sgabeblack@google.com                if (!((hi == 0 && lo<63:> == 0) ||
31212961Sgabeblack@google.com                      (hi == mask(64) && lo<63:> == 1)))
31312953Sgabeblack@google.com                    fault = new IntegerOverflowFault;
31412961Sgabeblack@google.com                Rc = lo;
31512961Sgabeblack@google.com            }}, IntMultOp);
31612961Sgabeblack@google.com        }
31712961Sgabeblack@google.com
31812961Sgabeblack@google.com        0x1c: decode INTFUNC {
31913058Sgabeblack@google.com            0x00: decode RA { 31: sextb({{ Rc.sb = Rb_or_imm< 7:0>; }}); }
32013058Sgabeblack@google.com            0x01: decode RA { 31: sextw({{ Rc.sw = Rb_or_imm<15:0>; }}); }
32112987Sgabeblack@google.com            0x32: ctlz({{
32212961Sgabeblack@google.com                             uint64_t count = 0;
32312954Sgabeblack@google.com                             uint64_t temp = Rb;
32413063Sgabeblack@google.com                             if (temp<63:32>) temp >>= 32; else count += 32;
32513069Sgabeblack@google.com                             if (temp<31:16>) temp >>= 16; else count += 16;
32613069Sgabeblack@google.com                             if (temp<15:8>) temp >>= 8; else count += 8;
32713069Sgabeblack@google.com                             if (temp<7:4>) temp >>= 4; else count += 4;
32813069Sgabeblack@google.com                             if (temp<3:2>) temp >>= 2; else count += 2;
32913069Sgabeblack@google.com                             if (temp<1:1>) temp >>= 1; else count += 1;
33013069Sgabeblack@google.com                             if ((temp<0:0>) != 0x1) count += 1;
33113069Sgabeblack@google.com                             Rc = count;
33213069Sgabeblack@google.com                           }}, IntAluOp);
33313069Sgabeblack@google.com
33413069Sgabeblack@google.com            0x33: cttz({{
33513069Sgabeblack@google.com                             uint64_t count = 0;
33613069Sgabeblack@google.com                             uint64_t temp = Rb;
33713069Sgabeblack@google.com                             if (!(temp<31:0>)) { temp >>= 32; count += 32; }
33813069Sgabeblack@google.com                             if (!(temp<15:0>)) { temp >>= 16; count += 16; }
33913069Sgabeblack@google.com                             if (!(temp<7:0>)) { temp >>= 8; count += 8; }
34013069Sgabeblack@google.com                             if (!(temp<3:0>)) { temp >>= 4; count += 4; }
34113069Sgabeblack@google.com                             if (!(temp<1:0>)) { temp >>= 2; count += 2; }
34213069Sgabeblack@google.com                             if (!(temp<0:0> & ULL(0x1))) count += 1;
34313069Sgabeblack@google.com                             Rc = count;
34413069Sgabeblack@google.com                           }}, IntAluOp);
34513069Sgabeblack@google.com
34613063Sgabeblack@google.com            format FailUnimpl {
34713063Sgabeblack@google.com                0x30: ctpop();
34812954Sgabeblack@google.com                0x31: perr();
34912954Sgabeblack@google.com                0x34: unpkbw();
35012954Sgabeblack@google.com                0x35: unpkbl();
35112954Sgabeblack@google.com                0x36: pkwb();
35212954Sgabeblack@google.com                0x37: pklb();
35312961Sgabeblack@google.com                0x38: minsb8();
35412961Sgabeblack@google.com                0x39: minsw4();
35512961Sgabeblack@google.com                0x3a: minub8();
35612961Sgabeblack@google.com                0x3b: minuw4();
35712961Sgabeblack@google.com                0x3c: maxub8();
35812961Sgabeblack@google.com                0x3d: maxuw4();
35912987Sgabeblack@google.com                0x3e: maxsb8();
36012987Sgabeblack@google.com                0x3f: maxsw4();
36112987Sgabeblack@google.com            }
36213063Sgabeblack@google.com
36313063Sgabeblack@google.com            format BasicOperateWithNopCheck {
36412987Sgabeblack@google.com                0x70: decode RB {
36512987Sgabeblack@google.com                    31: ftoit({{ Rc = Fa.uq; }}, FloatCvtOp);
36612987Sgabeblack@google.com                }
36712987Sgabeblack@google.com                0x78: decode RB {
36812987Sgabeblack@google.com                    31: ftois({{ Rc.sl = t_to_s(Fa.uq); }},
36912961Sgabeblack@google.com                              FloatCvtOp);
37012961Sgabeblack@google.com                }
37112961Sgabeblack@google.com            }
37212961Sgabeblack@google.com        }
37312961Sgabeblack@google.com    }
37412961Sgabeblack@google.com
37512961Sgabeblack@google.com    // Conditional branches.
37612953Sgabeblack@google.com    format CondBranch {
37712953Sgabeblack@google.com        0x39: beq({{ cond = (Ra == 0); }});
37812953Sgabeblack@google.com        0x3d: bne({{ cond = (Ra != 0); }});
37912953Sgabeblack@google.com        0x3e: bge({{ cond = (Ra.sq >= 0); }});
38013067Sgabeblack@google.com        0x3f: bgt({{ cond = (Ra.sq >  0); }});
38112987Sgabeblack@google.com        0x3b: ble({{ cond = (Ra.sq <= 0); }});
38213061Sgabeblack@google.com        0x3a: blt({{ cond = (Ra.sq < 0); }});
38312957Sgabeblack@google.com        0x38: blbc({{ cond = ((Ra & 1) == 0); }});
38412953Sgabeblack@google.com        0x3c: blbs({{ cond = ((Ra & 1) == 1); }});
38512957Sgabeblack@google.com
38612953Sgabeblack@google.com        0x31: fbeq({{ cond = (Fa == 0); }});
38712953Sgabeblack@google.com        0x35: fbne({{ cond = (Fa != 0); }});
38812954Sgabeblack@google.com        0x36: fbge({{ cond = (Fa >= 0); }});
38912985Sgabeblack@google.com        0x37: fbgt({{ cond = (Fa >  0); }});
39012985Sgabeblack@google.com        0x33: fble({{ cond = (Fa <= 0); }});
39112953Sgabeblack@google.com        0x32: fblt({{ cond = (Fa < 0); }});
39212953Sgabeblack@google.com    }
39312953Sgabeblack@google.com
39412953Sgabeblack@google.com    // unconditional branches
39513063Sgabeblack@google.com    format UncondBranch {
39613063Sgabeblack@google.com        0x30: br();
39713063Sgabeblack@google.com        0x34: bsr(IsCall);
39813063Sgabeblack@google.com    }
39913063Sgabeblack@google.com
40013063Sgabeblack@google.com    // indirect branches
40113063Sgabeblack@google.com    0x1a: decode JMPFUNC {
40213063Sgabeblack@google.com        format Jump {
40312953Sgabeblack@google.com            0: jmp();
40412953Sgabeblack@google.com            1: jsr(IsCall);
40512953Sgabeblack@google.com            2: ret(IsReturn);
406            3: jsr_coroutine(IsCall, IsReturn);
407        }
408    }
409
410    // Square root and integer-to-FP moves
411    0x14: decode FP_SHORTFUNC {
412        // Integer to FP register moves must have RB == 31
413        0x4: decode RB {
414            31: decode FP_FULLFUNC {
415                format BasicOperateWithNopCheck {
416                    0x004: itofs({{ Fc.uq = s_to_t(Ra.ul); }}, FloatCvtOp);
417                    0x024: itoft({{ Fc.uq = Ra.uq; }}, FloatCvtOp);
418                    0x014: FailUnimpl::itoff();	// VAX-format conversion
419                }
420            }
421        }
422
423        // Square root instructions must have FA == 31
424        0xb: decode FA {
425            31: decode FP_TYPEFUNC {
426                format FloatingPointOperate {
427#if SS_COMPATIBLE_FP
428                    0x0b: sqrts({{
429                        if (Fb < 0.0)
430                            fault = new ArithmeticFault;
431                        Fc = sqrt(Fb);
432                    }}, FloatSqrtOp);
433#else
434                    0x0b: sqrts({{
435                        if (Fb.sf < 0.0)
436                            fault = new ArithmeticFault;
437                        Fc.sf = sqrt(Fb.sf);
438                    }}, FloatSqrtOp);
439#endif
440                    0x2b: sqrtt({{
441                        if (Fb < 0.0)
442                            fault = new ArithmeticFault;
443                        Fc = sqrt(Fb);
444                    }}, FloatSqrtOp);
445                }
446            }
447        }
448
449        // VAX-format sqrtf and sqrtg are not implemented
450        0xa: FailUnimpl::sqrtfg();
451    }
452
453    // IEEE floating point
454    0x16: decode FP_SHORTFUNC_TOP2 {
455        // The top two bits of the short function code break this
456        // space into four groups: binary ops, compares, reserved, and
457        // conversions.  See Table 4-12 of AHB.  There are different
458        // special cases in these different groups, so we decode on
459        // these top two bits first just to select a decode strategy.
460        // Most of these instructions may have various trapping and
461        // rounding mode flags set; these are decoded in the
462        // FloatingPointDecode template used by the
463        // FloatingPointOperate format.
464
465        // add/sub/mul/div: just decode on the short function code
466        // and source type.  All valid trapping and rounding modes apply.
467        0: decode FP_TRAPMODE {
468            // check for valid trapping modes here
469            0,1,5,7: decode FP_TYPEFUNC {
470                   format FloatingPointOperate {
471#if SS_COMPATIBLE_FP
472                       0x00: adds({{ Fc = Fa + Fb; }});
473                       0x01: subs({{ Fc = Fa - Fb; }});
474                       0x02: muls({{ Fc = Fa * Fb; }}, FloatMultOp);
475                       0x03: divs({{ Fc = Fa / Fb; }}, FloatDivOp);
476#else
477                       0x00: adds({{ Fc.sf = Fa.sf + Fb.sf; }});
478                       0x01: subs({{ Fc.sf = Fa.sf - Fb.sf; }});
479                       0x02: muls({{ Fc.sf = Fa.sf * Fb.sf; }}, FloatMultOp);
480                       0x03: divs({{ Fc.sf = Fa.sf / Fb.sf; }}, FloatDivOp);
481#endif
482
483                       0x20: addt({{ Fc = Fa + Fb; }});
484                       0x21: subt({{ Fc = Fa - Fb; }});
485                       0x22: mult({{ Fc = Fa * Fb; }}, FloatMultOp);
486                       0x23: divt({{ Fc = Fa / Fb; }}, FloatDivOp);
487                   }
488             }
489        }
490
491        // Floating-point compare instructions must have the default
492        // rounding mode, and may use the default trapping mode or
493        // /SU.  Both trapping modes are treated the same by M5; the
494        // only difference on the real hardware (as far a I can tell)
495        // is that without /SU you'd get an imprecise trap if you
496        // tried to compare a NaN with something else (instead of an
497        // "unordered" result).
498        1: decode FP_FULLFUNC {
499            format BasicOperateWithNopCheck {
500                0x0a5, 0x5a5: cmpteq({{ Fc = (Fa == Fb) ? 2.0 : 0.0; }},
501                                     FloatCmpOp);
502                0x0a7, 0x5a7: cmptle({{ Fc = (Fa <= Fb) ? 2.0 : 0.0; }},
503                                     FloatCmpOp);
504                0x0a6, 0x5a6: cmptlt({{ Fc = (Fa <  Fb) ? 2.0 : 0.0; }},
505                                     FloatCmpOp);
506                0x0a4, 0x5a4: cmptun({{ // unordered
507                    Fc = (!(Fa < Fb) && !(Fa == Fb) && !(Fa > Fb)) ? 2.0 : 0.0;
508                }}, FloatCmpOp);
509            }
510        }
511
512        // The FP-to-integer and integer-to-FP conversion insts
513        // require that FA be 31.
514        3: decode FA {
515            31: decode FP_TYPEFUNC {
516                format FloatingPointOperate {
517                    0x2f: decode FP_ROUNDMODE {
518                        format FPFixedRounding {
519                            // "chopped" i.e. round toward zero
520                            0: cvttq({{ Fc.sq = (int64_t)trunc(Fb); }},
521                                     Chopped);
522                            // round to minus infinity
523                            1: cvttq({{ Fc.sq = (int64_t)floor(Fb); }},
524                                     MinusInfinity);
525                        }
526                      default: cvttq({{ Fc.sq = (int64_t)nearbyint(Fb); }});
527                    }
528
529                    // The cvtts opcode is overloaded to be cvtst if the trap
530                    // mode is 2 or 6 (which are not valid otherwise)
531                    0x2c: decode FP_FULLFUNC {
532                        format BasicOperateWithNopCheck {
533                            // trap on denorm version "cvtst/s" is
534                            // simulated same as cvtst
535                            0x2ac, 0x6ac: cvtst({{ Fc = Fb.sf; }});
536                        }
537                      default: cvtts({{ Fc.sf = Fb; }});
538                    }
539
540                    // The trapping mode for integer-to-FP conversions
541                    // must be /SUI or nothing; /U and /SU are not
542                    // allowed.  The full set of rounding modes are
543                    // supported though.
544                    0x3c: decode FP_TRAPMODE {
545                        0,7: cvtqs({{ Fc.sf = Fb.sq; }});
546                    }
547                    0x3e: decode FP_TRAPMODE {
548                        0,7: cvtqt({{ Fc    = Fb.sq; }});
549                    }
550                }
551            }
552        }
553    }
554
555    // misc FP operate
556    0x17: decode FP_FULLFUNC {
557        format BasicOperateWithNopCheck {
558            0x010: cvtlq({{
559                Fc.sl = (Fb.uq<63:62> << 30) | Fb.uq<58:29>;
560            }});
561            0x030: cvtql({{
562                Fc.uq = (Fb.uq<31:30> << 62) | (Fb.uq<29:0> << 29);
563            }});
564
565            // We treat the precise & imprecise trapping versions of
566            // cvtql identically.
567            0x130, 0x530: cvtqlv({{
568                // To avoid overflow, all the upper 32 bits must match
569                // the sign bit of the lower 32.  We code this as
570                // checking the upper 33 bits for all 0s or all 1s.
571                uint64_t sign_bits = Fb.uq<63:31>;
572                if (sign_bits != 0 && sign_bits != mask(33))
573                    fault = new IntegerOverflowFault;
574                Fc.uq = (Fb.uq<31:30> << 62) | (Fb.uq<29:0> << 29);
575            }});
576
577            0x020: cpys({{  // copy sign
578                Fc.uq = (Fa.uq<63:> << 63) | Fb.uq<62:0>;
579            }});
580            0x021: cpysn({{ // copy sign negated
581                Fc.uq = (~Fa.uq<63:> << 63) | Fb.uq<62:0>;
582            }});
583            0x022: cpyse({{ // copy sign and exponent
584                Fc.uq = (Fa.uq<63:52> << 52) | Fb.uq<51:0>;
585            }});
586
587            0x02a: fcmoveq({{ Fc = (Fa == 0) ? Fb : Fc; }});
588            0x02b: fcmovne({{ Fc = (Fa != 0) ? Fb : Fc; }});
589            0x02c: fcmovlt({{ Fc = (Fa <  0) ? Fb : Fc; }});
590            0x02d: fcmovge({{ Fc = (Fa >= 0) ? Fb : Fc; }});
591            0x02e: fcmovle({{ Fc = (Fa <= 0) ? Fb : Fc; }});
592            0x02f: fcmovgt({{ Fc = (Fa >  0) ? Fb : Fc; }});
593
594            0x024: mt_fpcr({{ FPCR = Fa.uq; }});
595            0x025: mf_fpcr({{ Fa.uq = FPCR; }});
596        }
597    }
598
599    // miscellaneous mem-format ops
600    0x18: decode MEMFUNC {
601        format WarnUnimpl {
602            0x8000: fetch();
603            0xa000: fetch_m();
604            0xe800: ecb();
605        }
606
607        format MiscPrefetch {
608            0xf800: wh64({{ EA = Rb & ~ULL(63); }},
609                         {{ xc->writeHint(EA, 64, memAccessFlags); }},
610                         mem_flags = NO_FAULT,
611                         inst_flags = [IsMemRef, IsDataPrefetch,
612                                       IsStore, MemWriteOp]);
613        }
614
615        format BasicOperate {
616            0xc000: rpcc({{
617#if FULL_SYSTEM
618        /* Rb is a fake dependency so here is a fun way to get
619         * the parser to understand that.
620         */
621                Ra = xc->readMiscRegWithEffect(AlphaISA::IPR_CC, fault) + (Rb & 0);
622
623#else
624                Ra = curTick;
625#endif
626            }});
627
628            // All of the barrier instructions below do nothing in
629            // their execute() methods (hence the empty code blocks).
630            // All of their functionality is hard-coded in the
631            // pipeline based on the flags IsSerializing,
632            // IsMemBarrier, and IsWriteBarrier.  In the current
633            // detailed CPU model, the execute() function only gets
634            // called at fetch, so there's no way to generate pipeline
635            // behavior at any other stage.  Once we go to an
636            // exec-in-exec CPU model we should be able to get rid of
637            // these flags and implement this behavior via the
638            // execute() methods.
639
640            // trapb is just a barrier on integer traps, where excb is
641            // a barrier on integer and FP traps.  "EXCB is thus a
642            // superset of TRAPB." (Alpha ARM, Sec 4.11.4) We treat
643            // them the same though.
644            0x0000: trapb({{ }}, IsSerializing, No_OpClass);
645            0x0400: excb({{ }}, IsSerializing, No_OpClass);
646            0x4000: mb({{ }}, IsMemBarrier, MemReadOp);
647            0x4400: wmb({{ }}, IsWriteBarrier, MemWriteOp);
648        }
649
650#if FULL_SYSTEM
651        format BasicOperate {
652            0xe000: rc({{
653                Ra = xc->readIntrFlag();
654                xc->setIntrFlag(0);
655            }}, IsNonSpeculative);
656            0xf000: rs({{
657                Ra = xc->readIntrFlag();
658                xc->setIntrFlag(1);
659            }}, IsNonSpeculative);
660        }
661#else
662        format FailUnimpl {
663            0xe000: rc();
664            0xf000: rs();
665        }
666#endif
667    }
668
669#if FULL_SYSTEM
670    0x00: CallPal::call_pal({{
671        if (!palValid ||
672            (palPriv
673             && xc->readMiscRegWithEffect(AlphaISA::IPR_ICM, fault) != AlphaISA::mode_kernel)) {
674            // invalid pal function code, or attempt to do privileged
675            // PAL call in non-kernel mode
676            fault = new UnimplementedOpcodeFault;
677        }
678        else {
679            // check to see if simulator wants to do something special
680            // on this PAL call (including maybe suppress it)
681            bool dopal = xc->simPalCheck(palFunc);
682
683            if (dopal) {
684                xc->setMiscRegWithEffect(AlphaISA::IPR_EXC_ADDR, NPC);
685                NPC = xc->readMiscRegWithEffect(AlphaISA::IPR_PAL_BASE, fault) + palOffset;
686            }
687        }
688    }}, IsNonSpeculative);
689#else
690    0x00: decode PALFUNC {
691        format EmulatedCallPal {
692            0x00: halt ({{
693                SimExit(curTick, "halt instruction encountered");
694            }}, IsNonSpeculative);
695            0x83: callsys({{
696                xc->syscall();
697            }}, IsNonSpeculative);
698            // Read uniq reg into ABI return value register (r0)
699            0x9e: rduniq({{ R0 = Runiq; }});
700            // Write uniq reg with value from ABI arg register (r16)
701            0x9f: wruniq({{ Runiq = R16; }});
702        }
703    }
704#endif
705
706#if FULL_SYSTEM
707    0x1b: decode PALMODE {
708        0: OpcdecFault::hw_st_quad();
709        1: decode HW_LDST_QUAD {
710            format HwLoad {
711                0: hw_ld({{ EA = (Rb + disp) & ~3; }}, {{ Ra = Mem.ul; }}, L);
712                1: hw_ld({{ EA = (Rb + disp) & ~7; }}, {{ Ra = Mem.uq; }}, Q);
713            }
714        }
715    }
716
717    0x1f: decode PALMODE {
718        0: OpcdecFault::hw_st_cond();
719        format HwStore {
720            1: decode HW_LDST_COND {
721                0: decode HW_LDST_QUAD {
722                    0: hw_st({{ EA = (Rb + disp) & ~3; }},
723                {{ Mem.ul = Ra<31:0>; }}, L);
724                    1: hw_st({{ EA = (Rb + disp) & ~7; }},
725                {{ Mem.uq = Ra.uq; }}, Q);
726                }
727
728                1: FailUnimpl::hw_st_cond();
729            }
730        }
731    }
732
733    0x19: decode PALMODE {
734        0: OpcdecFault::hw_mfpr();
735        format HwMoveIPR {
736            1: hw_mfpr({{
737                Ra = xc->readMiscRegWithEffect(ipr_index, fault);
738            }});
739        }
740    }
741
742    0x1d: decode PALMODE {
743        0: OpcdecFault::hw_mtpr();
744        format HwMoveIPR {
745            1: hw_mtpr({{
746                xc->setMiscRegWithEffect(ipr_index, Ra);
747                if (traceData) { traceData->setData(Ra); }
748            }});
749        }
750    }
751
752    format BasicOperate {
753        0x1e: decode PALMODE {
754            0: OpcdecFault::hw_rei();
755            1:hw_rei({{ xc->hwrei(); }}, IsSerializing);
756        }
757
758        // M5 special opcodes use the reserved 0x01 opcode space
759        0x01: decode M5FUNC {
760            0x00: arm({{
761                AlphaPseudo::arm(xc->xcBase());
762            }}, IsNonSpeculative);
763            0x01: quiesce({{
764                AlphaPseudo::quiesce(xc->xcBase());
765            }}, IsNonSpeculative);
766            0x02: quiesceNs({{
767                AlphaPseudo::quiesceNs(xc->xcBase(), R16);
768            }}, IsNonSpeculative);
769            0x03: quiesceCycles({{
770                AlphaPseudo::quiesceCycles(xc->xcBase(), R16);
771            }}, IsNonSpeculative);
772            0x04: quiesceTime({{
773                R0 = AlphaPseudo::quiesceTime(xc->xcBase());
774            }}, IsNonSpeculative);
775            0x10: ivlb({{
776                AlphaPseudo::ivlb(xc->xcBase());
777            }}, No_OpClass, IsNonSpeculative);
778            0x11: ivle({{
779                AlphaPseudo::ivle(xc->xcBase());
780            }}, No_OpClass, IsNonSpeculative);
781            0x20: m5exit_old({{
782                AlphaPseudo::m5exit_old(xc->xcBase());
783            }}, No_OpClass, IsNonSpeculative);
784            0x21: m5exit({{
785                AlphaPseudo::m5exit(xc->xcBase(), R16);
786            }}, No_OpClass, IsNonSpeculative);
787            0x30: initparam({{ Ra = xc->xcBase()->getCpuPtr()->system->init_param; }});
788            0x40: resetstats({{
789                AlphaPseudo::resetstats(xc->xcBase(), R16, R17);
790            }}, IsNonSpeculative);
791            0x41: dumpstats({{
792                AlphaPseudo::dumpstats(xc->xcBase(), R16, R17);
793            }}, IsNonSpeculative);
794            0x42: dumpresetstats({{
795                AlphaPseudo::dumpresetstats(xc->xcBase(), R16, R17);
796            }}, IsNonSpeculative);
797            0x43: m5checkpoint({{
798                AlphaPseudo::m5checkpoint(xc->xcBase(), R16, R17);
799            }}, IsNonSpeculative);
800            0x50: m5readfile({{
801                R0 = AlphaPseudo::readfile(xc->xcBase(), R16, R17, R18);
802            }}, IsNonSpeculative);
803            0x51: m5break({{
804                AlphaPseudo::debugbreak(xc->xcBase());
805            }}, IsNonSpeculative);
806            0x52: m5switchcpu({{
807                AlphaPseudo::switchcpu(xc->xcBase());
808            }}, IsNonSpeculative);
809            0x53: m5addsymbol({{
810                AlphaPseudo::addsymbol(xc->xcBase(), R16, R17);
811            }}, IsNonSpeculative);
812            0x54: m5panic({{
813                panic("M5 panic instruction called.");
814            }}, IsNonSpeculative);
815
816        }
817    }
818#endif
819}
820