decoder.isa revision 3378
12632Sstever@eecs.umich.edu// Copyright (c) 2006 The Regents of The University of Michigan
22632Sstever@eecs.umich.edu// All rights reserved.
32632Sstever@eecs.umich.edu//
42632Sstever@eecs.umich.edu// Redistribution and use in source and binary forms, with or without
52632Sstever@eecs.umich.edu// modification, are permitted provided that the following conditions are
62632Sstever@eecs.umich.edu// met: redistributions of source code must retain the above copyright
72632Sstever@eecs.umich.edu// notice, this list of conditions and the following disclaimer;
82632Sstever@eecs.umich.edu// redistributions in binary form must reproduce the above copyright
92632Sstever@eecs.umich.edu// notice, this list of conditions and the following disclaimer in the
102632Sstever@eecs.umich.edu// documentation and/or other materials provided with the distribution;
112632Sstever@eecs.umich.edu// neither the name of the copyright holders nor the names of its
122632Sstever@eecs.umich.edu// contributors may be used to endorse or promote products derived from
132632Sstever@eecs.umich.edu// this software without specific prior written permission.
142632Sstever@eecs.umich.edu//
152632Sstever@eecs.umich.edu// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
162632Sstever@eecs.umich.edu// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
172632Sstever@eecs.umich.edu// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
182632Sstever@eecs.umich.edu// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
192632Sstever@eecs.umich.edu// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
202632Sstever@eecs.umich.edu// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
212632Sstever@eecs.umich.edu// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
222632Sstever@eecs.umich.edu// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
232632Sstever@eecs.umich.edu// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
242632Sstever@eecs.umich.edu// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
252632Sstever@eecs.umich.edu// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
262632Sstever@eecs.umich.edu//
272632Sstever@eecs.umich.edu// Authors: Ali Saidi
282632Sstever@eecs.umich.edu//          Gabe Black
292632Sstever@eecs.umich.edu//          Steve Reinhardt
302632Sstever@eecs.umich.edu
312022SN/A////////////////////////////////////////////////////////////////////
322022SN/A//
332022SN/A// The actual decoder specification
342022SN/A//
352022SN/A
362469SN/Adecode OP default Unknown::unknown()
372469SN/A{
382469SN/A    0x0: decode OP2
392469SN/A    {
402516SN/A        //Throw an illegal instruction acception
412516SN/A        0x0: Trap::illtrap({{fault = new IllegalInstruction;}});
422944Sgblack@eecs.umich.edu        format BranchN
432482SN/A        {
443056Sgblack@eecs.umich.edu            0x1: decode COND2
452469SN/A            {
463056Sgblack@eecs.umich.edu                //Branch Always
473056Sgblack@eecs.umich.edu                0x8: decode A
483056Sgblack@eecs.umich.edu                {
493056Sgblack@eecs.umich.edu                    0x0: b(19, {{
502516SN/A                        NNPC = xc->readPC() + disp;
513056Sgblack@eecs.umich.edu                    }});
523056Sgblack@eecs.umich.edu                    0x1: b(19, {{
533056Sgblack@eecs.umich.edu                        NPC = xc->readPC() + disp;
543056Sgblack@eecs.umich.edu                        NNPC = NPC + 4;
553056Sgblack@eecs.umich.edu                    }}, ',a');
563056Sgblack@eecs.umich.edu                }
573056Sgblack@eecs.umich.edu                //Branch Never
583056Sgblack@eecs.umich.edu                0x0: decode A
593056Sgblack@eecs.umich.edu                {
603056Sgblack@eecs.umich.edu                    0x0: bn(19, {{
613056Sgblack@eecs.umich.edu                        NNPC = NNPC;//Don't do anything
623056Sgblack@eecs.umich.edu                    }});
633056Sgblack@eecs.umich.edu                    0x1: bn(19, {{
643056Sgblack@eecs.umich.edu                        NPC = xc->readNextPC() + 4;
653056Sgblack@eecs.umich.edu                        NNPC = NPC + 4;
663056Sgblack@eecs.umich.edu                    }}, ',a');
673056Sgblack@eecs.umich.edu                }
683056Sgblack@eecs.umich.edu                default: decode BPCC
693056Sgblack@eecs.umich.edu                {
703056Sgblack@eecs.umich.edu                    0x0: bpcci(19, {{
713056Sgblack@eecs.umich.edu                        if(passesCondition(Ccr<3:0>, COND2))
723056Sgblack@eecs.umich.edu                            NNPC = xc->readPC() + disp;
733056Sgblack@eecs.umich.edu                        else
743056Sgblack@eecs.umich.edu                            handle_annul
753056Sgblack@eecs.umich.edu                    }});
763056Sgblack@eecs.umich.edu                    0x2: bpccx(19, {{
773056Sgblack@eecs.umich.edu                        if(passesCondition(Ccr<7:4>, COND2))
783056Sgblack@eecs.umich.edu                            NNPC = xc->readPC() + disp;
793056Sgblack@eecs.umich.edu                        else
803056Sgblack@eecs.umich.edu                            handle_annul
813056Sgblack@eecs.umich.edu                    }});
823056Sgblack@eecs.umich.edu                }
832482SN/A            }
842944Sgblack@eecs.umich.edu            0x2: bicc(22, {{
852944Sgblack@eecs.umich.edu                if(passesCondition(Ccr<3:0>, COND2))
862944Sgblack@eecs.umich.edu                    NNPC = xc->readPC() + disp;
872944Sgblack@eecs.umich.edu                else
882944Sgblack@eecs.umich.edu                    handle_annul
892944Sgblack@eecs.umich.edu            }});
902516SN/A        }
912516SN/A        0x3: decode RCOND2
922516SN/A        {
932516SN/A            format BranchSplit
942482SN/A            {
952482SN/A                0x1: bpreq({{
962591SN/A                    if(Rs1.sdw == 0)
972516SN/A                        NNPC = xc->readPC() + disp;
982580SN/A                    else
992580SN/A                        handle_annul
1002482SN/A                }});
1012482SN/A                0x2: bprle({{
1022591SN/A                    if(Rs1.sdw <= 0)
1032516SN/A                        NNPC = xc->readPC() + disp;
1042580SN/A                    else
1052580SN/A                        handle_annul
1062482SN/A                }});
1072482SN/A                0x3: bprl({{
1082591SN/A                    if(Rs1.sdw < 0)
1092516SN/A                        NNPC = xc->readPC() + disp;
1102580SN/A                    else
1112580SN/A                        handle_annul
1122482SN/A                }});
1132482SN/A                0x5: bprne({{
1142591SN/A                    if(Rs1.sdw != 0)
1152516SN/A                        NNPC = xc->readPC() + disp;
1162580SN/A                    else
1172580SN/A                        handle_annul
1182482SN/A                }});
1192482SN/A                0x6: bprg({{
1202591SN/A                    if(Rs1.sdw > 0)
1212516SN/A                        NNPC = xc->readPC() + disp;
1222580SN/A                    else
1232580SN/A                        handle_annul
1242482SN/A                }});
1252482SN/A                0x7: bprge({{
1262591SN/A                    if(Rs1.sdw >= 0)
1272516SN/A                        NNPC = xc->readPC() + disp;
1282580SN/A                    else
1292580SN/A                        handle_annul
1302482SN/A                }});
1312469SN/A            }
1322482SN/A        }
1332516SN/A        //SETHI (or NOP if rd == 0 and imm == 0)
1343042Sgblack@eecs.umich.edu        0x4: SetHi::sethi({{Rd.udw = imm;}});
1352516SN/A        0x5: Trap::fbpfcc({{fault = new FpDisabled;}});
1362516SN/A        0x6: Trap::fbfcc({{fault = new FpDisabled;}});
1372469SN/A    }
1382944Sgblack@eecs.umich.edu    0x1: BranchN::call(30, {{
1392516SN/A            R15 = xc->readPC();
1402516SN/A            NNPC = R15 + disp;
1412469SN/A    }});
1422469SN/A    0x2: decode OP3 {
1432482SN/A        format IntOp {
1442482SN/A            0x00: add({{Rd = Rs1.sdw + Rs2_or_imm13;}});
1452974Sgblack@eecs.umich.edu            0x01: and({{Rd = Rs1.sdw & Rs2_or_imm13;}});
1462974Sgblack@eecs.umich.edu            0x02: or({{Rd = Rs1.sdw | Rs2_or_imm13;}});
1472974Sgblack@eecs.umich.edu            0x03: xor({{Rd = Rs1.sdw ^ Rs2_or_imm13;}});
1482526SN/A            0x04: sub({{Rd = Rs1.sdw - Rs2_or_imm13;}});
1492974Sgblack@eecs.umich.edu            0x05: andn({{Rd = Rs1.sdw & ~Rs2_or_imm13;}});
1502974Sgblack@eecs.umich.edu            0x06: orn({{Rd = Rs1.sdw | ~Rs2_or_imm13;}});
1512974Sgblack@eecs.umich.edu            0x07: xnor({{Rd = ~(Rs1.sdw ^ Rs2_or_imm13);}});
1522646Ssaidi@eecs.umich.edu            0x08: addc({{Rd = Rs1.sdw + Rs2_or_imm13 + Ccr<0:0>;}});
1532974Sgblack@eecs.umich.edu            0x09: mulx({{Rd = Rs1.sdw * Rs2_or_imm13;}});
1542469SN/A            0x0A: umul({{
1552516SN/A                Rd = Rs1.udw<31:0> * Rs2_or_imm13<31:0>;
1562646Ssaidi@eecs.umich.edu                Y = Rd<63:32>;
1572482SN/A            }});
1582469SN/A            0x0B: smul({{
1592516SN/A                Rd.sdw = Rs1.sdw<31:0> * Rs2_or_imm13<31:0>;
1602646Ssaidi@eecs.umich.edu                Y = Rd.sdw;
1612482SN/A            }});
1622954Sgblack@eecs.umich.edu            0x0C: subc({{Rd.sdw = Rs1.sdw + (~Rs2_or_imm13) + 1 - Ccr<0:0>}});
1632469SN/A            0x0D: udivx({{
1642516SN/A                if(Rs2_or_imm13 == 0) fault = new DivisionByZero;
1652516SN/A                else Rd.udw = Rs1.udw / Rs2_or_imm13;
1662482SN/A            }});
1672469SN/A            0x0E: udiv({{
1682516SN/A                if(Rs2_or_imm13 == 0) fault = new DivisionByZero;
1692482SN/A                else
1702482SN/A                {
1712646Ssaidi@eecs.umich.edu                    Rd.udw = ((Y << 32) | Rs1.udw<31:0>) / Rs2_or_imm13;
1722482SN/A                    if(Rd.udw >> 32 != 0)
1732482SN/A                        Rd.udw = 0xFFFFFFFF;
1742482SN/A                }
1752482SN/A            }});
1762482SN/A            0x0F: sdiv({{
1772615SN/A                if(Rs2_or_imm13.sdw == 0)
1782469SN/A                    fault = new DivisionByZero;
1792469SN/A                else
1802482SN/A                {
1812646Ssaidi@eecs.umich.edu                    Rd.udw = ((int64_t)((Y << 32) | Rs1.sdw<31:0>)) / Rs2_or_imm13.sdw;
1822482SN/A                    if(Rd.udw<63:31> != 0)
1832482SN/A                        Rd.udw = 0x7FFFFFFF;
1842482SN/A                    else if(Rd.udw<63:> && Rd.udw<62:31> != 0xFFFFFFFF)
1852588SN/A                        Rd.udw = 0xFFFFFFFF80000000ULL;
1862482SN/A                }
1872526SN/A            }});
1882469SN/A        }
1892482SN/A        format IntOpCc {
1902469SN/A            0x10: addcc({{
1912516SN/A                int64_t resTemp, val2 = Rs2_or_imm13;
1922469SN/A                Rd = resTemp = Rs1 + val2;}},
1932580SN/A                {{(Rs1<31:0> + val2<31:0>)<32:>}},
1942469SN/A                {{Rs1<31:> == val2<31:> && val2<31:> != resTemp<31:>}},
1952580SN/A                {{(Rs1<63:1> + val2<63:1> + (Rs1 & val2)<0:>)<63:>}},
1962469SN/A                {{Rs1<63:> == val2<63:> && val2<63:> != resTemp<63:>}}
1972526SN/A            );
1982482SN/A            0x11: IntOpCcRes::andcc({{Rd = Rs1 & Rs2_or_imm13;}});
1992482SN/A            0x12: IntOpCcRes::orcc({{Rd = Rs1 | Rs2_or_imm13;}});
2002482SN/A            0x13: IntOpCcRes::xorcc({{Rd = Rs1 ^ Rs2_or_imm13;}});
2012469SN/A            0x14: subcc({{
2022580SN/A                int64_t val2 = Rs2_or_imm13;
2032580SN/A                Rd = Rs1 - val2;}},
2042580SN/A                {{(~(Rs1<31:0> + (~val2)<31:0> + 1))<32:>}},
2052580SN/A                {{(Rs1<31:> != val2<31:>) && (Rs1<31:> != Rd<31:>)}},
2062580SN/A                {{(~(Rs1<63:1> + (~val2)<63:1> +
2072580SN/A                    (Rs1 | ~val2)<0:>))<63:>}},
2082580SN/A                {{Rs1<63:> != val2<63:> && Rs1<63:> != Rd<63:>}}
2092526SN/A            );
2102482SN/A            0x15: IntOpCcRes::andncc({{Rd = Rs1 & ~Rs2_or_imm13;}});
2112482SN/A            0x16: IntOpCcRes::orncc({{Rd = Rs1 | ~Rs2_or_imm13;}});
2122482SN/A            0x17: IntOpCcRes::xnorcc({{Rd = ~(Rs1 ^ Rs2_or_imm13);}});
2132469SN/A            0x18: addccc({{
2142516SN/A                int64_t resTemp, val2 = Rs2_or_imm13;
2152646Ssaidi@eecs.umich.edu                int64_t carryin = Ccr<0:0>;
2162469SN/A                Rd = resTemp = Rs1 + val2 + carryin;}},
2172580SN/A                {{(Rs1<31:0> + val2<31:0> + carryin)<32:>}},
2182469SN/A                {{Rs1<31:> == val2<31:> && val2<31:> != resTemp<31:>}},
2192580SN/A                {{(Rs1<63:1> + val2<63:1> +
2202580SN/A                    ((Rs1 & val2) | (carryin & (Rs1 | val2)))<0:>)<63:>}},
2212469SN/A                {{Rs1<63:> == val2<63:> && val2<63:> != resTemp<63:>}}
2222526SN/A            );
2232469SN/A            0x1A: umulcc({{
2242615SN/A                uint64_t resTemp;
2252615SN/A                Rd = resTemp = Rs1.udw<31:0> * Rs2_or_imm13.udw<31:0>;
2262646Ssaidi@eecs.umich.edu                Y = resTemp<63:32>;}},
2272526SN/A                {{0}},{{0}},{{0}},{{0}});
2282469SN/A            0x1B: smulcc({{
2292615SN/A                int64_t resTemp;
2302615SN/A                Rd = resTemp = Rs1.sdw<31:0> * Rs2_or_imm13.sdw<31:0>;
2312646Ssaidi@eecs.umich.edu                Y = resTemp<63:32>;}},
2322526SN/A                {{0}},{{0}},{{0}},{{0}});
2332469SN/A            0x1C: subccc({{
2342516SN/A                int64_t resTemp, val2 = Rs2_or_imm13;
2352646Ssaidi@eecs.umich.edu                int64_t carryin = Ccr<0:0>;
2362954Sgblack@eecs.umich.edu                Rd = resTemp = Rs1 + ~val2 + 1 - carryin;}},
2372580SN/A                {{(~((Rs1<31:0> + (~(val2 + carryin))<31:0> + 1))<32:>)}},
2382469SN/A                {{Rs1<31:> != val2<31:> && Rs1<31:> != resTemp<31:>}},
2392580SN/A                {{(~((Rs1<63:1> + (~(val2 + carryin))<63:1>) + (Rs1<0:> + (~(val2+carryin))<0:> + 1)<63:1>))<63:>}},
2402469SN/A                {{Rs1<63:> != val2<63:> && Rs1<63:> != resTemp<63:>}}
2412526SN/A            );
2422469SN/A            0x1D: udivxcc({{
2432615SN/A                if(Rs2_or_imm13.udw == 0) fault = new DivisionByZero;
2442615SN/A                else Rd = Rs1.udw / Rs2_or_imm13.udw;}}
2452526SN/A                ,{{0}},{{0}},{{0}},{{0}});
2462469SN/A            0x1E: udivcc({{
2472615SN/A                uint32_t resTemp, val2 = Rs2_or_imm13.udw;
2482989Ssaidi@eecs.umich.edu                int32_t overflow = 0;
2492469SN/A                if(val2 == 0) fault = new DivisionByZero;
2502469SN/A                else
2512224SN/A                {
2522646Ssaidi@eecs.umich.edu                    resTemp = (uint64_t)((Y << 32) | Rs1.udw<31:0>) / val2;
2532516SN/A                    overflow = (resTemp<63:32> != 0);
2542516SN/A                    if(overflow) Rd = resTemp = 0xFFFFFFFF;
2552516SN/A                    else Rd = resTemp;
2562469SN/A                } }},
2572469SN/A                {{0}},
2582469SN/A                {{overflow}},
2592469SN/A                {{0}},
2602469SN/A                {{0}}
2612526SN/A            );
2622469SN/A            0x1F: sdivcc({{
2632996Sgblack@eecs.umich.edu                int64_t val2 = Rs2_or_imm13.sdw<31:0>;
2642996Sgblack@eecs.umich.edu                bool overflow = false, underflow = false;
2652469SN/A                if(val2 == 0) fault = new DivisionByZero;
2662469SN/A                else
2672469SN/A                {
2682996Sgblack@eecs.umich.edu                    Rd = (int64_t)((Y << 32) | Rs1.sdw<31:0>) / val2;
2692996Sgblack@eecs.umich.edu                    overflow = (Rd<63:31> != 0);
2702996Sgblack@eecs.umich.edu                    underflow = (Rd<63:> && Rd<62:31> != 0xFFFFFFFF);
2712996Sgblack@eecs.umich.edu                    if(overflow) Rd = 0x7FFFFFFF;
2722996Sgblack@eecs.umich.edu                    else if(underflow) Rd = 0xFFFFFFFF80000000ULL;
2732469SN/A                } }},
2742469SN/A                {{0}},
2752469SN/A                {{overflow || underflow}},
2762469SN/A                {{0}},
2772469SN/A                {{0}}
2782526SN/A            );
2792469SN/A            0x20: taddcc({{
2802516SN/A                int64_t resTemp, val2 = Rs2_or_imm13;
2812469SN/A                Rd = resTemp = Rs1 + val2;
2822469SN/A                int32_t overflow = Rs1<1:0> || val2<1:0> || (Rs1<31:> == val2<31:> && val2<31:> != resTemp<31:>);}},
2832469SN/A                {{((Rs1 & 0xFFFFFFFF + val2 & 0xFFFFFFFF) >> 31)}},
2842469SN/A                {{overflow}},
2852469SN/A                {{((Rs1 >> 1) + (val2 >> 1) + (Rs1 & val2 & 0x1))<63:>}},
2862469SN/A                {{Rs1<63:> == val2<63:> && val2<63:> != resTemp<63:>}}
2872526SN/A            );
2882469SN/A            0x21: tsubcc({{
2892516SN/A                int64_t resTemp, val2 = Rs2_or_imm13;
2902469SN/A                Rd = resTemp = Rs1 + val2;
2912469SN/A                int32_t overflow = Rs1<1:0> || val2<1:0> || (Rs1<31:> == val2<31:> && val2<31:> != resTemp<31:>);}},
2922516SN/A                {{(Rs1 & 0xFFFFFFFF + val2 & 0xFFFFFFFF) >> 31}},
2932469SN/A                {{overflow}},
2942469SN/A                {{((Rs1 >> 1) + (val2 >> 1) + (Rs1 & val2 & 0x1))<63:>}},
2952469SN/A                {{Rs1<63:> == val2<63:> && val2<63:> != resTemp<63:>}}
2962526SN/A            );
2972469SN/A            0x22: taddcctv({{
2982996Sgblack@eecs.umich.edu                int64_t val2 = Rs2_or_imm13;
2992996Sgblack@eecs.umich.edu                Rd = Rs1 + val2;
3002954Sgblack@eecs.umich.edu                int32_t overflow = Rs1<1:0> || val2<1:0> ||
3012954Sgblack@eecs.umich.edu                        (Rs1<31:> == val2<31:> && val2<31:> != Rd<31:>);
3022469SN/A                if(overflow) fault = new TagOverflow;}},
3032469SN/A                {{((Rs1 & 0xFFFFFFFF + val2 & 0xFFFFFFFF) >> 31)}},
3042469SN/A                {{overflow}},
3052469SN/A                {{((Rs1 >> 1) + (val2 >> 1) + (Rs1 & val2 & 0x1))<63:>}},
3062996Sgblack@eecs.umich.edu                {{Rs1<63:> == val2<63:> && val2<63:> != Rd<63:>}}
3072526SN/A            );
3082469SN/A            0x23: tsubcctv({{
3092516SN/A                int64_t resTemp, val2 = Rs2_or_imm13;
3102469SN/A                Rd = resTemp = Rs1 + val2;
3112469SN/A                int32_t overflow = Rs1<1:0> || val2<1:0> || (Rs1<31:> == val2<31:> && val2<31:> != resTemp<31:>);
3122469SN/A                if(overflow) fault = new TagOverflow;}},
3132469SN/A                {{((Rs1 & 0xFFFFFFFF + val2 & 0xFFFFFFFF) >> 31)}},
3142469SN/A                {{overflow}},
3152469SN/A                {{((Rs1 >> 1) + (val2 >> 1) + (Rs1 & val2 & 0x1))<63:>}},
3162469SN/A                {{Rs1<63:> == val2<63:> && val2<63:> != resTemp<63:>}}
3172526SN/A            );
3182469SN/A            0x24: mulscc({{
3192516SN/A                int64_t resTemp, multiplicand = Rs2_or_imm13;
3202469SN/A                int32_t multiplier = Rs1<31:0>;
3212469SN/A                int32_t savedLSB = Rs1<0:>;
3222516SN/A                multiplier = multiplier<31:1> |
3232646Ssaidi@eecs.umich.edu                    ((Ccr<3:3>
3242646Ssaidi@eecs.umich.edu                    ^ Ccr<1:1>) << 32);
3252646Ssaidi@eecs.umich.edu                if(!Y<0:>)
3262469SN/A                    multiplicand = 0;
3272469SN/A                Rd = resTemp = multiplicand + multiplier;
3282646Ssaidi@eecs.umich.edu                Y = Y<31:1> | (savedLSB << 31);}},
3292469SN/A                {{((multiplicand & 0xFFFFFFFF + multiplier & 0xFFFFFFFF) >> 31)}},
3302469SN/A                {{multiplicand<31:> == multiplier<31:> && multiplier<31:> != resTemp<31:>}},
3312469SN/A                {{((multiplicand >> 1) + (multiplier >> 1) + (multiplicand & multiplier & 0x1))<63:>}},
3322469SN/A                {{multiplicand<63:> == multiplier<63:> && multiplier<63:> != resTemp<63:>}}
3332526SN/A            );
3342526SN/A        }
3352526SN/A        format IntOp
3362526SN/A        {
3372526SN/A            0x25: decode X {
3382526SN/A                0x0: sll({{Rd = Rs1 << (I ? SHCNT32 : Rs2<4:0>);}});
3392526SN/A                0x1: sllx({{Rd = Rs1 << (I ? SHCNT64 : Rs2<5:0>);}});
3402469SN/A            }
3412526SN/A            0x26: decode X {
3422526SN/A                0x0: srl({{Rd = Rs1.uw >> (I ? SHCNT32 : Rs2<4:0>);}});
3432526SN/A                0x1: srlx({{Rd = Rs1.udw >> (I ? SHCNT64 : Rs2<5:0>);}});
3442526SN/A            }
3452526SN/A            0x27: decode X {
3462526SN/A                0x0: sra({{Rd = Rs1.sw >> (I ? SHCNT32 : Rs2<4:0>);}});
3472526SN/A                0x1: srax({{Rd = Rs1.sdw >> (I ? SHCNT64 : Rs2<5:0>);}});
3482526SN/A            }
3492646Ssaidi@eecs.umich.edu            // XXX might want a format rdipr thing here
3502954Sgblack@eecs.umich.edu            0x28: decode RS1 {
3512954Sgblack@eecs.umich.edu                0xF: decode I {
3522954Sgblack@eecs.umich.edu                    0x0: Nop::stbar({{/*stuff*/}});
3532954Sgblack@eecs.umich.edu                    0x1: Nop::membar({{/*stuff*/}});
3542954Sgblack@eecs.umich.edu                }
3552954Sgblack@eecs.umich.edu                default: rdasr({{
3562646Ssaidi@eecs.umich.edu                Rd = xc->readMiscRegWithEffect(RS1 + AsrStart, fault);
3572954Sgblack@eecs.umich.edu                }});
3582954Sgblack@eecs.umich.edu            }
3592938Sgblack@eecs.umich.edu            0x29: HPriv::rdhpr({{
3602646Ssaidi@eecs.umich.edu                // XXX Need to protect with format that traps non-priv/priv
3612646Ssaidi@eecs.umich.edu                // access
3622646Ssaidi@eecs.umich.edu                Rd = xc->readMiscRegWithEffect(RS1 + HprStart, fault);
3632646Ssaidi@eecs.umich.edu            }});
3642938Sgblack@eecs.umich.edu            0x2A: Priv::rdpr({{
3652646Ssaidi@eecs.umich.edu                // XXX Need to protect with format that traps non-priv
3662646Ssaidi@eecs.umich.edu                // access
3672646Ssaidi@eecs.umich.edu                Rd = xc->readMiscRegWithEffect(RS1 + PrStart, fault);
3682646Ssaidi@eecs.umich.edu            }});
3692526SN/A            0x2B: BasicOperate::flushw({{
3702526SN/A                if(NWindows - 2 - Cansave == 0)
3712526SN/A                {
3722526SN/A                    if(Otherwin)
3732646Ssaidi@eecs.umich.edu                        fault = new SpillNOther(Wstate<5:3>);
3742526SN/A                    else
3752646Ssaidi@eecs.umich.edu                        fault = new SpillNNormal(Wstate<2:0>);
3762526SN/A                }
3772526SN/A            }});
3782526SN/A            0x2C: decode MOVCC3
3792469SN/A            {
3802526SN/A                0x0: Trap::movccfcc({{fault = new FpDisabled;}});
3812526SN/A                0x1: decode CC
3822526SN/A                {
3832526SN/A                    0x0: movcci({{
3842646Ssaidi@eecs.umich.edu                        if(passesCondition(Ccr<3:0>, COND4))
3852591SN/A                            Rd = Rs2_or_imm11;
3862591SN/A                        else
3872591SN/A                            Rd = Rd;
3882526SN/A                    }});
3892526SN/A                    0x2: movccx({{
3902646Ssaidi@eecs.umich.edu                        if(passesCondition(Ccr<7:4>, COND4))
3912591SN/A                            Rd = Rs2_or_imm11;
3922591SN/A                        else
3932591SN/A                            Rd = Rd;
3942526SN/A                    }});
3952224SN/A                }
3962526SN/A            }
3972526SN/A            0x2D: sdivx({{
3982615SN/A                if(Rs2_or_imm13.sdw == 0) fault = new DivisionByZero;
3992615SN/A                else Rd.sdw = Rs1.sdw / Rs2_or_imm13.sdw;
4002526SN/A            }});
4012526SN/A            0x2E: decode RS1 {
4022526SN/A                0x0: IntOp::popc({{
4032526SN/A                    int64_t count = 0;
4042526SN/A                    uint64_t temp = Rs2_or_imm13;
4052526SN/A                    //Count the 1s in the front 4bits until none are left
4062526SN/A                    uint8_t oneBits[] = {0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4};
4072526SN/A                    while(temp)
4082469SN/A                    {
4092526SN/A                            count += oneBits[temp & 0xF];
4102526SN/A                            temp = temp >> 4;
4112516SN/A                    }
4122591SN/A                    Rd = count;
4132516SN/A                }});
4142526SN/A            }
4152526SN/A            0x2F: decode RCOND3
4162526SN/A            {
4172615SN/A                0x1: movreq({{Rd = (Rs1.sdw == 0) ? Rs2_or_imm10 : Rd;}});
4182615SN/A                0x2: movrle({{Rd = (Rs1.sdw <= 0) ? Rs2_or_imm10 : Rd;}});
4192615SN/A                0x3: movrl({{Rd = (Rs1.sdw < 0) ? Rs2_or_imm10 : Rd;}});
4202615SN/A                0x5: movrne({{Rd = (Rs1.sdw != 0) ? Rs2_or_imm10 : Rd;}});
4212615SN/A                0x6: movrg({{Rd = (Rs1.sdw > 0) ? Rs2_or_imm10 : Rd;}});
4222615SN/A                0x7: movrge({{Rd = (Rs1.sdw >= 0) ? Rs2_or_imm10 : Rd;}});
4232526SN/A            }
4242646Ssaidi@eecs.umich.edu            0x30: wrasr({{
4252646Ssaidi@eecs.umich.edu                xc->setMiscRegWithEffect(RD + AsrStart, Rs1 ^ Rs2_or_imm13);
4262646Ssaidi@eecs.umich.edu            }});
4272526SN/A            0x31: decode FCN {
4282526SN/A                0x0: BasicOperate::saved({{/*Boogy Boogy*/}});
4292526SN/A                0x1: BasicOperate::restored({{/*Boogy Boogy*/}});
4302526SN/A            }
4312938Sgblack@eecs.umich.edu            0x32: Priv::wrpr({{
4322646Ssaidi@eecs.umich.edu                // XXX Need to protect with format that traps non-priv
4332646Ssaidi@eecs.umich.edu                // access
4342938Sgblack@eecs.umich.edu                fault = xc->setMiscRegWithEffect(RD + PrStart, Rs1 ^ Rs2_or_imm13);
4352646Ssaidi@eecs.umich.edu            }});
4362938Sgblack@eecs.umich.edu            0x33: HPriv::wrhpr({{
4372646Ssaidi@eecs.umich.edu                // XXX Need to protect with format that traps non-priv/priv
4382646Ssaidi@eecs.umich.edu                // access
4392938Sgblack@eecs.umich.edu                fault = xc->setMiscRegWithEffect(RD + HprStart, Rs1 ^ Rs2_or_imm13);
4402646Ssaidi@eecs.umich.edu            }});
4412954Sgblack@eecs.umich.edu            0x34: decode OPF{
4422963Sgblack@eecs.umich.edu                format BasicOperate{
4432963Sgblack@eecs.umich.edu                    0x01: fmovs({{
4443279Sgblack@eecs.umich.edu                        Frds.uw = Frs2s.uw;
4452963Sgblack@eecs.umich.edu                        //fsr.ftt = fsr.cexc = 0
4462963Sgblack@eecs.umich.edu                        Fsr &= ~(7 << 14);
4472963Sgblack@eecs.umich.edu                        Fsr &= ~(0x1F);
4482963Sgblack@eecs.umich.edu                    }});
4492963Sgblack@eecs.umich.edu                    0x02: fmovd({{
4503057Sgblack@eecs.umich.edu                        Frd.udw = Frs2.udw;
4512963Sgblack@eecs.umich.edu                        //fsr.ftt = fsr.cexc = 0
4522963Sgblack@eecs.umich.edu                        Fsr &= ~(7 << 14);
4532963Sgblack@eecs.umich.edu                        Fsr &= ~(0x1F);
4542963Sgblack@eecs.umich.edu                    }});
4552963Sgblack@eecs.umich.edu                    0x03: Trap::fmovq({{fault = new FpDisabled;}});
4562963Sgblack@eecs.umich.edu                    0x05: fnegs({{
4573279Sgblack@eecs.umich.edu                        Frds.uw = Frs2s.uw ^ (1UL << 31);
4582963Sgblack@eecs.umich.edu                        //fsr.ftt = fsr.cexc = 0
4592963Sgblack@eecs.umich.edu                        Fsr &= ~(7 << 14);
4602963Sgblack@eecs.umich.edu                        Fsr &= ~(0x1F);
4612963Sgblack@eecs.umich.edu                    }});
4622963Sgblack@eecs.umich.edu                    0x06: fnegd({{
4633057Sgblack@eecs.umich.edu                        Frd.udw = Frs2.udw ^ (1ULL << 63);
4642963Sgblack@eecs.umich.edu                        //fsr.ftt = fsr.cexc = 0
4652963Sgblack@eecs.umich.edu                        Fsr &= ~(7 << 14);
4662963Sgblack@eecs.umich.edu                        Fsr &= ~(0x1F);
4672963Sgblack@eecs.umich.edu                    }});
4682963Sgblack@eecs.umich.edu                    0x07: Trap::fnegq({{fault = new FpDisabled;}});
4692963Sgblack@eecs.umich.edu                    0x09: fabss({{
4703279Sgblack@eecs.umich.edu                        Frds.uw = ((1UL << 31) - 1) & Frs2s.uw;
4712963Sgblack@eecs.umich.edu                        //fsr.ftt = fsr.cexc = 0
4722963Sgblack@eecs.umich.edu                        Fsr &= ~(7 << 14);
4732963Sgblack@eecs.umich.edu                        Fsr &= ~(0x1F);
4742963Sgblack@eecs.umich.edu                    }});
4752963Sgblack@eecs.umich.edu                    0x0A: fabsd({{
4763057Sgblack@eecs.umich.edu                        Frd.udw = ((1ULL << 63) - 1) & Frs2.udw;
4772963Sgblack@eecs.umich.edu                        //fsr.ftt = fsr.cexc = 0
4782963Sgblack@eecs.umich.edu                        Fsr &= ~(7 << 14);
4792963Sgblack@eecs.umich.edu                        Fsr &= ~(0x1F);
4802963Sgblack@eecs.umich.edu                    }});
4812963Sgblack@eecs.umich.edu                    0x0B: Trap::fabsq({{fault = new FpDisabled;}});
4823279Sgblack@eecs.umich.edu                    0x29: fsqrts({{Frds.sf = sqrt(Frs2s.sf);}});
4832963Sgblack@eecs.umich.edu                    0x2A: fsqrtd({{Frd.df = sqrt(Frs2.df);}});
4842963Sgblack@eecs.umich.edu                    0x2B: Trap::fsqrtq({{fault = new FpDisabled;}});
4853279Sgblack@eecs.umich.edu                    0x41: fadds({{Frds.sf = Frs1s.sf + Frs2s.sf;}});
4862963Sgblack@eecs.umich.edu                    0x42: faddd({{Frd.df = Frs1.df + Frs2.df;}});
4872963Sgblack@eecs.umich.edu                    0x43: Trap::faddq({{fault = new FpDisabled;}});
4883279Sgblack@eecs.umich.edu                    0x45: fsubs({{Frds.sf = Frs1s.sf - Frs2s.sf;}});
4892963Sgblack@eecs.umich.edu                    0x46: fsubd({{Frd.df = Frs1.df - Frs2.df;}});
4902963Sgblack@eecs.umich.edu                    0x47: Trap::fsubq({{fault = new FpDisabled;}});
4913279Sgblack@eecs.umich.edu                    0x49: fmuls({{Frds.sf = Frs1s.sf * Frs2s.sf;}});
4922963Sgblack@eecs.umich.edu                    0x4A: fmuld({{Frd.df = Frs1.df * Frs2.df;}});
4932963Sgblack@eecs.umich.edu                    0x4B: Trap::fmulq({{fault = new FpDisabled;}});
4943279Sgblack@eecs.umich.edu                    0x4D: fdivs({{Frds.sf = Frs1s.sf / Frs2s.sf;}});
4952963Sgblack@eecs.umich.edu                    0x4E: fdivd({{Frd.df = Frs1.df / Frs2.df;}});
4962963Sgblack@eecs.umich.edu                    0x4F: Trap::fdivq({{fault = new FpDisabled;}});
4973279Sgblack@eecs.umich.edu                    0x69: fsmuld({{Frd.df = Frs1s.sf * Frs2s.sf;}});
4982963Sgblack@eecs.umich.edu                    0x6E: Trap::fdmulq({{fault = new FpDisabled;}});
4992963Sgblack@eecs.umich.edu                    0x81: fstox({{
5003279Sgblack@eecs.umich.edu                            Frd.df = (double)static_cast<int64_t>(Frs2s.sf);
5012963Sgblack@eecs.umich.edu                    }});
5022963Sgblack@eecs.umich.edu                    0x82: fdtox({{
5032963Sgblack@eecs.umich.edu                            Frd.df = (double)static_cast<int64_t>(Frs2.df);
5042963Sgblack@eecs.umich.edu                    }});
5052963Sgblack@eecs.umich.edu                    0x83: Trap::fqtox({{fault = new FpDisabled;}});
5062963Sgblack@eecs.umich.edu                    0x84: fxtos({{
5073279Sgblack@eecs.umich.edu                            Frds.sf = static_cast<float>((int64_t)Frs2.df);
5082963Sgblack@eecs.umich.edu                    }});
5092963Sgblack@eecs.umich.edu                    0x88: fxtod({{
5102963Sgblack@eecs.umich.edu                            Frd.df = static_cast<double>((int64_t)Frs2.df);
5112963Sgblack@eecs.umich.edu                    }});
5122963Sgblack@eecs.umich.edu                    0x8C: Trap::fxtoq({{fault = new FpDisabled;}});
5132963Sgblack@eecs.umich.edu                    0xC4: fitos({{
5143279Sgblack@eecs.umich.edu                            Frds.sf = static_cast<float>((int32_t)Frs2s.sf);
5152963Sgblack@eecs.umich.edu                    }});
5163279Sgblack@eecs.umich.edu                    0xC6: fdtos({{Frds.sf = Frs2.df;}});
5172963Sgblack@eecs.umich.edu                    0xC7: Trap::fqtos({{fault = new FpDisabled;}});
5182963Sgblack@eecs.umich.edu                    0xC8: fitod({{
5193279Sgblack@eecs.umich.edu                            Frd.df = static_cast<double>((int32_t)Frs2s.sf);
5202963Sgblack@eecs.umich.edu                    }});
5213279Sgblack@eecs.umich.edu                    0xC9: fstod({{Frd.df = Frs2s.sf;}});
5222963Sgblack@eecs.umich.edu                    0xCB: Trap::fqtod({{fault = new FpDisabled;}});
5232963Sgblack@eecs.umich.edu                    0xCC: Trap::fitoq({{fault = new FpDisabled;}});
5242963Sgblack@eecs.umich.edu                    0xCD: Trap::fstoq({{fault = new FpDisabled;}});
5252963Sgblack@eecs.umich.edu                    0xCE: Trap::fdtoq({{fault = new FpDisabled;}});
5262963Sgblack@eecs.umich.edu                    0xD1: fstoi({{
5273279Sgblack@eecs.umich.edu                            Frds.sf = (float)static_cast<int32_t>(Frs2s.sf);
5282963Sgblack@eecs.umich.edu                    }});
5292963Sgblack@eecs.umich.edu                    0xD2: fdtoi({{
5303279Sgblack@eecs.umich.edu                            Frds.sf = (float)static_cast<int32_t>(Frs2.df);
5312963Sgblack@eecs.umich.edu                    }});
5322963Sgblack@eecs.umich.edu                    0xD3: Trap::fqtoi({{fault = new FpDisabled;}});
5332963Sgblack@eecs.umich.edu                    default: Trap::fpop1({{fault = new FpDisabled;}});
5342963Sgblack@eecs.umich.edu                }
5352954Sgblack@eecs.umich.edu            }
5362526SN/A            0x35: Trap::fpop2({{fault = new FpDisabled;}});
5372954Sgblack@eecs.umich.edu            //This used to be just impdep1, but now it's a whole bunch
5382954Sgblack@eecs.umich.edu            //of instructions
5392954Sgblack@eecs.umich.edu            0x36: decode OPF{
5402954Sgblack@eecs.umich.edu                0x00: Trap::edge8({{fault = new IllegalInstruction;}});
5412954Sgblack@eecs.umich.edu                0x01: Trap::edge8n({{fault = new IllegalInstruction;}});
5422954Sgblack@eecs.umich.edu                0x02: Trap::edge8l({{fault = new IllegalInstruction;}});
5432954Sgblack@eecs.umich.edu                0x03: Trap::edge8ln({{fault = new IllegalInstruction;}});
5442954Sgblack@eecs.umich.edu                0x04: Trap::edge16({{fault = new IllegalInstruction;}});
5452954Sgblack@eecs.umich.edu                0x05: Trap::edge16n({{fault = new IllegalInstruction;}});
5462954Sgblack@eecs.umich.edu                0x06: Trap::edge16l({{fault = new IllegalInstruction;}});
5472954Sgblack@eecs.umich.edu                0x07: Trap::edge16ln({{fault = new IllegalInstruction;}});
5482954Sgblack@eecs.umich.edu                0x08: Trap::edge32({{fault = new IllegalInstruction;}});
5492954Sgblack@eecs.umich.edu                0x09: Trap::edge32n({{fault = new IllegalInstruction;}});
5502954Sgblack@eecs.umich.edu                0x0A: Trap::edge32l({{fault = new IllegalInstruction;}});
5512954Sgblack@eecs.umich.edu                0x0B: Trap::edge32ln({{fault = new IllegalInstruction;}});
5522954Sgblack@eecs.umich.edu                0x10: Trap::array8({{fault = new IllegalInstruction;}});
5532954Sgblack@eecs.umich.edu                0x12: Trap::array16({{fault = new IllegalInstruction;}});
5542954Sgblack@eecs.umich.edu                0x14: Trap::array32({{fault = new IllegalInstruction;}});
5553042Sgblack@eecs.umich.edu                0x18: BasicOperate::alignaddr({{
5562963Sgblack@eecs.umich.edu                    uint64_t sum = Rs1 + Rs2;
5573042Sgblack@eecs.umich.edu                    Rd = sum & ~7;
5582963Sgblack@eecs.umich.edu                    Gsr = (Gsr & ~7) | (sum & 7);
5592963Sgblack@eecs.umich.edu                }});
5602954Sgblack@eecs.umich.edu                0x19: Trap::bmask({{fault = new IllegalInstruction;}});
5612963Sgblack@eecs.umich.edu                0x1A: BasicOperate::alignaddresslittle({{
5622963Sgblack@eecs.umich.edu                    uint64_t sum = Rs1 + Rs2;
5633042Sgblack@eecs.umich.edu                    Rd = sum & ~7;
5642963Sgblack@eecs.umich.edu                    Gsr = (Gsr & ~7) | ((~sum + 1) & 7);
5652963Sgblack@eecs.umich.edu                }});
5662954Sgblack@eecs.umich.edu                0x20: Trap::fcmple16({{fault = new IllegalInstruction;}});
5672954Sgblack@eecs.umich.edu                0x22: Trap::fcmpne16({{fault = new IllegalInstruction;}});
5682954Sgblack@eecs.umich.edu                0x24: Trap::fcmple32({{fault = new IllegalInstruction;}});
5692954Sgblack@eecs.umich.edu                0x26: Trap::fcmpne32({{fault = new IllegalInstruction;}});
5702954Sgblack@eecs.umich.edu                0x28: Trap::fcmpgt16({{fault = new IllegalInstruction;}});
5712954Sgblack@eecs.umich.edu                0x2A: Trap::fcmpeq16({{fault = new IllegalInstruction;}});
5722954Sgblack@eecs.umich.edu                0x2C: Trap::fcmpgt32({{fault = new IllegalInstruction;}});
5732954Sgblack@eecs.umich.edu                0x2E: Trap::fcmpeq32({{fault = new IllegalInstruction;}});
5742954Sgblack@eecs.umich.edu                0x31: Trap::fmul8x16({{fault = new IllegalInstruction;}});
5752954Sgblack@eecs.umich.edu                0x33: Trap::fmul8x16au({{fault = new IllegalInstruction;}});
5762954Sgblack@eecs.umich.edu                0x35: Trap::fmul8x16al({{fault = new IllegalInstruction;}});
5772954Sgblack@eecs.umich.edu                0x36: Trap::fmul8sux16({{fault = new IllegalInstruction;}});
5782954Sgblack@eecs.umich.edu                0x37: Trap::fmul8ulx16({{fault = new IllegalInstruction;}});
5792954Sgblack@eecs.umich.edu                0x38: Trap::fmuld8sux16({{fault = new IllegalInstruction;}});
5802954Sgblack@eecs.umich.edu                0x39: Trap::fmuld8ulx16({{fault = new IllegalInstruction;}});
5812954Sgblack@eecs.umich.edu                0x3A: Trap::fpack32({{fault = new IllegalInstruction;}});
5822954Sgblack@eecs.umich.edu                0x3B: Trap::fpack16({{fault = new IllegalInstruction;}});
5832954Sgblack@eecs.umich.edu                0x3D: Trap::fpackfix({{fault = new IllegalInstruction;}});
5842954Sgblack@eecs.umich.edu                0x3E: Trap::pdist({{fault = new IllegalInstruction;}});
5852963Sgblack@eecs.umich.edu                0x48: BasicOperate::faligndata({{
5863057Sgblack@eecs.umich.edu                        uint64_t msbX = Frs1.udw;
5873057Sgblack@eecs.umich.edu                        uint64_t lsbX = Frs2.udw;
5883057Sgblack@eecs.umich.edu                        //Some special cases need to be split out, first
5893057Sgblack@eecs.umich.edu                        //because they're the most likely to be used, and
5903057Sgblack@eecs.umich.edu                        //second because otherwise, we end up shifting by
5913057Sgblack@eecs.umich.edu                        //greater than the width of the type being shifted,
5923057Sgblack@eecs.umich.edu                        //namely 64, which produces undefined results according
5933057Sgblack@eecs.umich.edu                        //to the C standard.
5943057Sgblack@eecs.umich.edu                        switch(Gsr<2:0>)
5953057Sgblack@eecs.umich.edu                        {
5963057Sgblack@eecs.umich.edu                            case 0:
5973057Sgblack@eecs.umich.edu                                Frd.udw = msbX;
5983057Sgblack@eecs.umich.edu                                break;
5993057Sgblack@eecs.umich.edu                            case 8:
6003057Sgblack@eecs.umich.edu                                Frd.udw = lsbX;
6013057Sgblack@eecs.umich.edu                                break;
6023057Sgblack@eecs.umich.edu                            default:
6033057Sgblack@eecs.umich.edu                                uint64_t msbShift = Gsr<2:0> * 8;
6043057Sgblack@eecs.umich.edu                                uint64_t lsbShift = (8 - Gsr<2:0>) * 8;
6053057Sgblack@eecs.umich.edu                                uint64_t msbMask = ((uint64_t)(-1)) >> msbShift;
6063057Sgblack@eecs.umich.edu                                uint64_t lsbMask = ((uint64_t)(-1)) << lsbShift;
6073057Sgblack@eecs.umich.edu                                Frd.udw = ((msbX & msbMask) << msbShift) |
6083057Sgblack@eecs.umich.edu                                        ((lsbX & lsbMask) >> lsbShift);
6093057Sgblack@eecs.umich.edu                        }
6102963Sgblack@eecs.umich.edu                }});
6112954Sgblack@eecs.umich.edu                0x4B: Trap::fpmerge({{fault = new IllegalInstruction;}});
6122954Sgblack@eecs.umich.edu                0x4C: Trap::bshuffle({{fault = new IllegalInstruction;}});
6132954Sgblack@eecs.umich.edu                0x4D: Trap::fexpand({{fault = new IllegalInstruction;}});
6142954Sgblack@eecs.umich.edu                0x50: Trap::fpadd16({{fault = new IllegalInstruction;}});
6152954Sgblack@eecs.umich.edu                0x51: Trap::fpadd16s({{fault = new IllegalInstruction;}});
6162954Sgblack@eecs.umich.edu                0x52: Trap::fpadd32({{fault = new IllegalInstruction;}});
6172954Sgblack@eecs.umich.edu                0x53: Trap::fpadd32s({{fault = new IllegalInstruction;}});
6182954Sgblack@eecs.umich.edu                0x54: Trap::fpsub16({{fault = new IllegalInstruction;}});
6192954Sgblack@eecs.umich.edu                0x55: Trap::fpsub16s({{fault = new IllegalInstruction;}});
6202954Sgblack@eecs.umich.edu                0x56: Trap::fpsub32({{fault = new IllegalInstruction;}});
6212954Sgblack@eecs.umich.edu                0x57: Trap::fpsub32s({{fault = new IllegalInstruction;}});
6222963Sgblack@eecs.umich.edu                0x60: BasicOperate::fzero({{Frd.df = 0;}});
6233279Sgblack@eecs.umich.edu                0x61: BasicOperate::fzeros({{Frds.sf = 0;}});
6242954Sgblack@eecs.umich.edu                0x62: Trap::fnor({{fault = new IllegalInstruction;}});
6252954Sgblack@eecs.umich.edu                0x63: Trap::fnors({{fault = new IllegalInstruction;}});
6262954Sgblack@eecs.umich.edu                0x64: Trap::fandnot2({{fault = new IllegalInstruction;}});
6272954Sgblack@eecs.umich.edu                0x65: Trap::fandnot2s({{fault = new IllegalInstruction;}});
6282963Sgblack@eecs.umich.edu                0x66: BasicOperate::fnot2({{
6292963Sgblack@eecs.umich.edu                        Frd.df = (double)(~((uint64_t)Frs2.df));
6302963Sgblack@eecs.umich.edu                }});
6312963Sgblack@eecs.umich.edu                0x67: BasicOperate::fnot2s({{
6323279Sgblack@eecs.umich.edu                        Frds.sf = (float)(~((uint32_t)Frs2s.sf));
6332963Sgblack@eecs.umich.edu                }});
6342954Sgblack@eecs.umich.edu                0x68: Trap::fandnot1({{fault = new IllegalInstruction;}});
6352954Sgblack@eecs.umich.edu                0x69: Trap::fandnot1s({{fault = new IllegalInstruction;}});
6362963Sgblack@eecs.umich.edu                0x6A: BasicOperate::fnot1({{
6372963Sgblack@eecs.umich.edu                        Frd.df = (double)(~((uint64_t)Frs1.df));
6382963Sgblack@eecs.umich.edu                }});
6392963Sgblack@eecs.umich.edu                0x6B: BasicOperate::fnot1s({{
6403279Sgblack@eecs.umich.edu                        Frds.sf = (float)(~((uint32_t)Frs1s.sf));
6412963Sgblack@eecs.umich.edu                }});
6422954Sgblack@eecs.umich.edu                0x6C: Trap::fxor({{fault = new IllegalInstruction;}});
6432954Sgblack@eecs.umich.edu                0x6D: Trap::fxors({{fault = new IllegalInstruction;}});
6442954Sgblack@eecs.umich.edu                0x6E: Trap::fnand({{fault = new IllegalInstruction;}});
6452954Sgblack@eecs.umich.edu                0x6F: Trap::fnands({{fault = new IllegalInstruction;}});
6462954Sgblack@eecs.umich.edu                0x70: Trap::fand({{fault = new IllegalInstruction;}});
6472954Sgblack@eecs.umich.edu                0x71: Trap::fands({{fault = new IllegalInstruction;}});
6482954Sgblack@eecs.umich.edu                0x72: Trap::fxnor({{fault = new IllegalInstruction;}});
6492954Sgblack@eecs.umich.edu                0x73: Trap::fxnors({{fault = new IllegalInstruction;}});
6503057Sgblack@eecs.umich.edu                0x74: BasicOperate::fsrc1({{Frd.udw = Frs1.udw;}});
6513057Sgblack@eecs.umich.edu                0x75: BasicOperate::fsrc1s({{Frd.uw = Frs1.uw;}});
6522954Sgblack@eecs.umich.edu                0x76: Trap::fornot2({{fault = new IllegalInstruction;}});
6532954Sgblack@eecs.umich.edu                0x77: Trap::fornot2s({{fault = new IllegalInstruction;}});
6543057Sgblack@eecs.umich.edu                0x78: BasicOperate::fsrc2({{Frd.udw = Frs2.udw;}});
6553057Sgblack@eecs.umich.edu                0x79: BasicOperate::fsrc2s({{Frd.uw = Frs2.uw;}});
6562954Sgblack@eecs.umich.edu                0x7A: Trap::fornot1({{fault = new IllegalInstruction;}});
6572954Sgblack@eecs.umich.edu                0x7B: Trap::fornot1s({{fault = new IllegalInstruction;}});
6582954Sgblack@eecs.umich.edu                0x7C: Trap::for({{fault = new IllegalInstruction;}});
6592954Sgblack@eecs.umich.edu                0x7D: Trap::fors({{fault = new IllegalInstruction;}});
6602954Sgblack@eecs.umich.edu                0x7E: Trap::fone({{fault = new IllegalInstruction;}});
6612954Sgblack@eecs.umich.edu                0x7F: Trap::fones({{fault = new IllegalInstruction;}});
6622954Sgblack@eecs.umich.edu                0x80: Trap::shutdown({{fault = new IllegalInstruction;}});
6632954Sgblack@eecs.umich.edu                0x81: Trap::siam({{fault = new IllegalInstruction;}});
6642954Sgblack@eecs.umich.edu            }
6652954Sgblack@eecs.umich.edu            0x37: Trap::impdep2({{fault = new IllegalInstruction;}});
6662526SN/A            0x38: Branch::jmpl({{
6672526SN/A                Addr target = Rs1 + Rs2_or_imm13;
6682526SN/A                if(target & 0x3)
6692526SN/A                    fault = new MemAddressNotAligned;
6702526SN/A                else
6712526SN/A                {
6722526SN/A                    Rd = xc->readPC();
6732526SN/A                    NNPC = target;
6742526SN/A                }
6752526SN/A            }});
6762526SN/A            0x39: Branch::return({{
6772561SN/A                //If both MemAddressNotAligned and
6782561SN/A                //a fill trap happen, it's not clear
6792561SN/A                //which one should be returned.
6802526SN/A                Addr target = Rs1 + Rs2_or_imm13;
6812526SN/A                if(target & 0x3)
6822526SN/A                    fault = new MemAddressNotAligned;
6832526SN/A                else
6842526SN/A                    NNPC = target;
6852561SN/A                if(fault == NoFault)
6862561SN/A                {
6872561SN/A                    //CWP should be set directly so that it always happens
6882561SN/A                    //Also, this will allow writing to the new window and
6892561SN/A                    //reading from the old one
6902561SN/A                    Cwp = (Cwp - 1 + NWindows) % NWindows;
6912561SN/A                    if(Canrestore == 0)
6922561SN/A                    {
6932561SN/A                        if(Otherwin)
6942646Ssaidi@eecs.umich.edu                            fault = new FillNOther(Wstate<5:3>);
6952561SN/A                        else
6962646Ssaidi@eecs.umich.edu                            fault = new FillNNormal(Wstate<2:0>);
6972561SN/A                    }
6982561SN/A                    else
6992561SN/A                    {
7002561SN/A                        Rd = Rs1 + Rs2_or_imm13;
7012561SN/A                        Cansave = Cansave + 1;
7022561SN/A                        Canrestore = Canrestore - 1;
7032561SN/A                    }
7042561SN/A                    //This is here to make sure the CWP is written
7052561SN/A                    //no matter what. This ensures that the results
7062561SN/A                    //are written in the new window as well.
7072561SN/A                    xc->setMiscRegWithEffect(MISCREG_CWP, Cwp);
7082561SN/A                }
7092526SN/A            }});
7102526SN/A            0x3A: decode CC
7112526SN/A            {
7122526SN/A                0x0: Trap::tcci({{
7132646Ssaidi@eecs.umich.edu                    if(passesCondition(Ccr<3:0>, COND2))
7142561SN/A                    {
7153039Sstever@eecs.umich.edu#if FULL_SYSTEM
7162561SN/A                        int lTrapNum = I ? (Rs1 + SW_TRAP) : (Rs1 + Rs2);
7172561SN/A                        DPRINTF(Sparc, "The trap number is %d\n", lTrapNum);
7182561SN/A                        fault = new TrapInstruction(lTrapNum);
7192526SN/A#else
7202561SN/A                        DPRINTF(Sparc, "The syscall number is %d\n", R1);
7212561SN/A                        xc->syscall(R1);
7222561SN/A#endif
7232561SN/A                    }
7242526SN/A                }});
7252526SN/A                0x2: Trap::tccx({{
7262646Ssaidi@eecs.umich.edu                    if(passesCondition(Ccr<7:4>, COND2))
7272561SN/A                    {
7283039Sstever@eecs.umich.edu#if FULL_SYSTEM
7292561SN/A                        int lTrapNum = I ? (Rs1 + SW_TRAP) : (Rs1 + Rs2);
7302561SN/A                        DPRINTF(Sparc, "The trap number is %d\n", lTrapNum);
7312561SN/A                        fault = new TrapInstruction(lTrapNum);
7322526SN/A#else
7332561SN/A                        DPRINTF(Sparc, "The syscall number is %d\n", R1);
7342561SN/A                        xc->syscall(R1);
7352561SN/A#endif
7362526SN/A                    }
7372526SN/A                }});
7382526SN/A            }
7392526SN/A            0x3B: Nop::flush({{/*Instruction memory flush*/}});
7402526SN/A            0x3C: save({{
7412526SN/A                //CWP should be set directly so that it always happens
7422526SN/A                //Also, this will allow writing to the new window and
7432526SN/A                //reading from the old one
7442526SN/A                if(Cansave == 0)
7452526SN/A                {
7462526SN/A                    if(Otherwin)
7472646Ssaidi@eecs.umich.edu                        fault = new SpillNOther(Wstate<5:3>);
7482526SN/A                    else
7492646Ssaidi@eecs.umich.edu                        fault = new SpillNNormal(Wstate<2:0>);
7502526SN/A                    Cwp = (Cwp + 2) % NWindows;
7512526SN/A                }
7522526SN/A                else if(Cleanwin - Canrestore == 0)
7532526SN/A                {
7542526SN/A                    Cwp = (Cwp + 1) % NWindows;
7552526SN/A                    fault = new CleanWindow;
7562526SN/A                }
7572526SN/A                else
7582526SN/A                {
7592526SN/A                    Cwp = (Cwp + 1) % NWindows;
7602526SN/A                    Rd = Rs1 + Rs2_or_imm13;
7612561SN/A                    Cansave = Cansave - 1;
7622561SN/A                    Canrestore = Canrestore + 1;
7632526SN/A                }
7642526SN/A                //This is here to make sure the CWP is written
7652526SN/A                //no matter what. This ensures that the results
7662526SN/A                //are written in the new window as well.
7672526SN/A                xc->setMiscRegWithEffect(MISCREG_CWP, Cwp);
7682526SN/A            }});
7692526SN/A            0x3D: restore({{
7702526SN/A                //CWP should be set directly so that it always happens
7712526SN/A                //Also, this will allow writing to the new window and
7722526SN/A                //reading from the old one
7732526SN/A                Cwp = (Cwp - 1 + NWindows) % NWindows;
7742526SN/A                if(Canrestore == 0)
7752526SN/A                {
7762526SN/A                    if(Otherwin)
7772646Ssaidi@eecs.umich.edu                        fault = new FillNOther(Wstate<5:3>);
7782526SN/A                    else
7792646Ssaidi@eecs.umich.edu                        fault = new FillNNormal(Wstate<2:0>);
7802526SN/A                }
7812526SN/A                else
7822526SN/A                {
7832526SN/A                    Rd = Rs1 + Rs2_or_imm13;
7842561SN/A                    Cansave = Cansave + 1;
7852561SN/A                    Canrestore = Canrestore - 1;
7862526SN/A                }
7872526SN/A                //This is here to make sure the CWP is written
7882526SN/A                //no matter what. This ensures that the results
7892526SN/A                //are written in the new window as well.
7902526SN/A                xc->setMiscRegWithEffect(MISCREG_CWP, Cwp);
7912526SN/A            }});
7922526SN/A            0x3E: decode FCN {
7932526SN/A                0x0: Priv::done({{
7942526SN/A                    if(Tl == 0)
7952526SN/A                        return new IllegalInstruction;
7962646Ssaidi@eecs.umich.edu
7972646Ssaidi@eecs.umich.edu                    Cwp = Tstate<4:0>;
7982646Ssaidi@eecs.umich.edu                    Pstate = Tstate<20:8>;
7992646Ssaidi@eecs.umich.edu                    Asi = Tstate<31:24>;
8002646Ssaidi@eecs.umich.edu                    Ccr = Tstate<39:32>;
8012646Ssaidi@eecs.umich.edu                    Gl = Tstate<42:40>;
8022646Ssaidi@eecs.umich.edu                    NPC = Tnpc;
8032646Ssaidi@eecs.umich.edu                    NNPC = Tnpc + 4;
8042526SN/A                    Tl = Tl - 1;
8052526SN/A                }});
8062938Sgblack@eecs.umich.edu                0x1: Priv::retry({{
8072526SN/A                    if(Tl == 0)
8082526SN/A                        return new IllegalInstruction;
8092646Ssaidi@eecs.umich.edu                    Cwp = Tstate<4:0>;
8102646Ssaidi@eecs.umich.edu                    Pstate = Tstate<20:8>;
8112646Ssaidi@eecs.umich.edu                    Asi = Tstate<31:24>;
8122646Ssaidi@eecs.umich.edu                    Ccr = Tstate<39:32>;
8132646Ssaidi@eecs.umich.edu                    Gl = Tstate<42:40>;
8142646Ssaidi@eecs.umich.edu                    NPC = Tpc;
8152646Ssaidi@eecs.umich.edu                    NNPC = Tnpc + 4;
8162526SN/A                    Tl = Tl - 1;
8172526SN/A                }});
8182526SN/A            }
8192526SN/A        }
8202469SN/A    }
8212469SN/A    0x3: decode OP3 {
8222526SN/A        format Load {
8233272Sgblack@eecs.umich.edu            0x00: lduw({{Rd = Mem.uw;}});
8243272Sgblack@eecs.umich.edu            0x01: ldub({{Rd = Mem.ub;}});
8253272Sgblack@eecs.umich.edu            0x02: lduh({{Rd = Mem.uhw;}});
8262526SN/A            0x03: ldd({{
8273272Sgblack@eecs.umich.edu                uint64_t val = Mem.udw;
8282526SN/A                RdLow = val<31:0>;
8292526SN/A                RdHigh = val<63:32>;
8303272Sgblack@eecs.umich.edu            }});
8312526SN/A        }
8322526SN/A        format Store {
8333272Sgblack@eecs.umich.edu            0x04: stw({{Mem.uw = Rd.sw;}});
8343272Sgblack@eecs.umich.edu            0x05: stb({{Mem.ub = Rd.sb;}});
8353272Sgblack@eecs.umich.edu            0x06: sth({{Mem.uhw = Rd.shw;}});
8363272Sgblack@eecs.umich.edu            0x07: std({{Mem.udw = RdLow<31:0> | (RdHigh<31:0> << 32);}});
8372526SN/A        }
8382526SN/A        format Load {
8393272Sgblack@eecs.umich.edu            0x08: ldsw({{Rd = (int32_t)Mem.sw;}});
8403272Sgblack@eecs.umich.edu            0x09: ldsb({{Rd = (int8_t)Mem.sb;}});
8413272Sgblack@eecs.umich.edu            0x0A: ldsh({{Rd = (int16_t)Mem.shw;}});
8423272Sgblack@eecs.umich.edu            0x0B: ldx({{Rd = (int64_t)Mem.sdw;}});
8432526SN/A            0x0D: ldstub({{
8443272Sgblack@eecs.umich.edu                Rd = Mem.ub;
8453272Sgblack@eecs.umich.edu                Mem.ub = 0xFF;
8463272Sgblack@eecs.umich.edu            }});
8472526SN/A        }
8483272Sgblack@eecs.umich.edu        0x0E: Store::stx({{Mem.udw = Rd}});
8492526SN/A        0x0F: LoadStore::swap({{
8502526SN/A            uint32_t temp = Rd;
8513272Sgblack@eecs.umich.edu            Rd = Mem.uw;
8523272Sgblack@eecs.umich.edu            Mem.uw = temp;
8533272Sgblack@eecs.umich.edu        }});
8542526SN/A        format Load {
8553272Sgblack@eecs.umich.edu            0x10: lduwa({{Rd = Mem.uw;}});
8563272Sgblack@eecs.umich.edu            0x11: lduba({{Rd = Mem.ub;}});
8573272Sgblack@eecs.umich.edu            0x12: lduha({{Rd = Mem.uhw;}});
8582526SN/A            0x13: ldda({{
8593272Sgblack@eecs.umich.edu                uint64_t val = Mem.udw;
8602526SN/A                RdLow = val<31:0>;
8612526SN/A                RdHigh = val<63:32>;
8623272Sgblack@eecs.umich.edu            }});
8632526SN/A        }
8642526SN/A        format Store {
8653272Sgblack@eecs.umich.edu            0x14: stwa({{Mem.uw = Rd;}});
8663272Sgblack@eecs.umich.edu            0x15: stba({{Mem.ub = Rd;}});
8673272Sgblack@eecs.umich.edu            0x16: stha({{Mem.uhw = Rd;}});
8683272Sgblack@eecs.umich.edu            0x17: stda({{Mem.udw = RdLow<31:0> | RdHigh<31:0> << 32;}});
8692526SN/A        }
8702526SN/A        format Load {
8713272Sgblack@eecs.umich.edu            0x18: ldswa({{Rd = (int32_t)Mem.sw;}});
8723272Sgblack@eecs.umich.edu            0x19: ldsba({{Rd = (int8_t)Mem.sb;}});
8733272Sgblack@eecs.umich.edu            0x1A: ldsha({{Rd = (int16_t)Mem.shw;}});
8743272Sgblack@eecs.umich.edu            0x1B: ldxa({{Rd = (int64_t)Mem.sdw;}});
8752526SN/A        }
8762526SN/A        0x1D: LoadStore::ldstuba({{
8773272Sgblack@eecs.umich.edu            Rd = Mem.ub;
8783272Sgblack@eecs.umich.edu            Mem.ub = 0xFF;
8793272Sgblack@eecs.umich.edu        }});
8803272Sgblack@eecs.umich.edu        0x1E: Store::stxa({{Mem.udw = Rd}});
8812526SN/A        0x1F: LoadStore::swapa({{
8822526SN/A            uint32_t temp = Rd;
8833272Sgblack@eecs.umich.edu            Rd = Mem.uw;
8843272Sgblack@eecs.umich.edu            Mem.uw = temp;
8853272Sgblack@eecs.umich.edu        }});
8862526SN/A        format Trap {
8873272Sgblack@eecs.umich.edu            0x20: Load::ldf({{Frd.uw = Mem.uw;}});
8882526SN/A            0x21: decode X {
8893272Sgblack@eecs.umich.edu                0x0: Load::ldfsr({{Fsr = Mem.uw | Fsr<63:32>;}});
8903272Sgblack@eecs.umich.edu                0x1: Load::ldxfsr({{Fsr = Mem.udw;}});
8912469SN/A            }
8922526SN/A            0x22: ldqf({{fault = new FpDisabled;}});
8933272Sgblack@eecs.umich.edu            0x23: Load::lddf({{Frd.udw = Mem.udw;}});
8943272Sgblack@eecs.umich.edu            0x24: Store::stf({{Mem.uw = Frd.uw;}});
8952526SN/A            0x25: decode X {
8963272Sgblack@eecs.umich.edu                0x0: Store::stfsr({{Mem.uw = Fsr<31:0>;}});
8973272Sgblack@eecs.umich.edu                0x1: Store::stxfsr({{Mem.udw = Fsr;}});
8982526SN/A            }
8992526SN/A            0x26: stqf({{fault = new FpDisabled;}});
9003272Sgblack@eecs.umich.edu            0x27: Store::stdf({{Mem.udw = Frd.udw;}});
9012526SN/A            0x2D: Nop::prefetch({{ }});
9023272Sgblack@eecs.umich.edu            0x30: Load::ldfa({{Frd.uw = Mem.uw;}});
9032526SN/A            0x32: ldqfa({{fault = new FpDisabled;}});
9043272Sgblack@eecs.umich.edu            format LoadAlt {
9053272Sgblack@eecs.umich.edu                0x33: decode EXT_ASI {
9063272Sgblack@eecs.umich.edu                    //ASI_NUCLEUS
9073272Sgblack@eecs.umich.edu                    0x04: FailUnimpl::lddfa_n();
9083272Sgblack@eecs.umich.edu                    //ASI_NUCLEUS_LITTLE
9093272Sgblack@eecs.umich.edu                    0x0C: FailUnimpl::lddfa_nl();
9103272Sgblack@eecs.umich.edu                    //ASI_AS_IF_USER_PRIMARY
9113272Sgblack@eecs.umich.edu                    0x10: FailUnimpl::lddfa_aiup();
9123272Sgblack@eecs.umich.edu                    //ASI_AS_IF_USER_PRIMARY_LITTLE
9133272Sgblack@eecs.umich.edu                    0x18: FailUnimpl::lddfa_aiupl();
9143272Sgblack@eecs.umich.edu                    //ASI_AS_IF_USER_SECONDARY
9153272Sgblack@eecs.umich.edu                    0x11: FailUnimpl::lddfa_aius();
9163272Sgblack@eecs.umich.edu                    //ASI_AS_IF_USER_SECONDARY_LITTLE
9173272Sgblack@eecs.umich.edu                    0x19: FailUnimpl::lddfa_aiusl();
9183272Sgblack@eecs.umich.edu                    //ASI_REAL
9193272Sgblack@eecs.umich.edu                    0x14: FailUnimpl::lddfa_real();
9203272Sgblack@eecs.umich.edu                    //ASI_REAL_LITTLE
9213272Sgblack@eecs.umich.edu                    0x1C: FailUnimpl::lddfa_real_l();
9223272Sgblack@eecs.umich.edu                    //ASI_REAL_IO
9233272Sgblack@eecs.umich.edu                    0x15: FailUnimpl::lddfa_real_io();
9243272Sgblack@eecs.umich.edu                    //ASI_REAL_IO_LITTLE
9253272Sgblack@eecs.umich.edu                    0x1D: FailUnimpl::lddfa_real_io_l();
9263272Sgblack@eecs.umich.edu                    //ASI_PRIMARY
9273272Sgblack@eecs.umich.edu                    0x80: FailUnimpl::lddfa_p();
9283272Sgblack@eecs.umich.edu                    //ASI_PRIMARY_LITTLE
9293272Sgblack@eecs.umich.edu                    0x88: FailUnimpl::lddfa_pl();
9303272Sgblack@eecs.umich.edu                    //ASI_SECONDARY
9313272Sgblack@eecs.umich.edu                    0x81: FailUnimpl::lddfa_s();
9323272Sgblack@eecs.umich.edu                    //ASI_SECONDARY_LITTLE
9333272Sgblack@eecs.umich.edu                    0x89: FailUnimpl::lddfa_sl();
9343272Sgblack@eecs.umich.edu                    //ASI_PRIMARY_NO_FAULT
9353272Sgblack@eecs.umich.edu                    0x82: FailUnimpl::lddfa_pnf();
9363272Sgblack@eecs.umich.edu                    //ASI_PRIMARY_NO_FAULT_LITTLE
9373272Sgblack@eecs.umich.edu                    0x8A: FailUnimpl::lddfa_pnfl();
9383272Sgblack@eecs.umich.edu                    //ASI_SECONDARY_NO_FAULT
9393272Sgblack@eecs.umich.edu                    0x83: FailUnimpl::lddfa_snf();
9403272Sgblack@eecs.umich.edu                    //ASI_SECONDARY_NO_FAULT_LITTLE
9413272Sgblack@eecs.umich.edu                    0x8B: FailUnimpl::lddfa_snfl();
9423272Sgblack@eecs.umich.edu
9433272Sgblack@eecs.umich.edu                    format BlockLoad {
9443272Sgblack@eecs.umich.edu                        // LDBLOCKF
9453272Sgblack@eecs.umich.edu                        //ASI_BLOCK_AS_IF_USER_PRIMARY
9463272Sgblack@eecs.umich.edu                        0x16: FailUnimpl::ldblockf_aiup();
9473272Sgblack@eecs.umich.edu                        //ASI_BLOCK_AS_IF_USER_SECONDARY
9483272Sgblack@eecs.umich.edu                        0x17: FailUnimpl::ldblockf_aius();
9493272Sgblack@eecs.umich.edu                        //ASI_BLOCK_AS_IF_USER_PRIMARY_LITTLE
9503272Sgblack@eecs.umich.edu                        0x1E: FailUnimpl::ldblockf_aiupl();
9513272Sgblack@eecs.umich.edu                        //ASI_BLOCK_AS_IF_USER_SECONDARY_LITTLE
9523272Sgblack@eecs.umich.edu                        0x1F: FailUnimpl::ldblockf_aiusl();
9533272Sgblack@eecs.umich.edu                        //ASI_BLOCK_PRIMARY
9543378Sgblack@eecs.umich.edu                        0xF0: ldblockf_p({{Frd_N.udw = Mem.udw;}});
9553272Sgblack@eecs.umich.edu                        //ASI_BLOCK_SECONDARY
9563272Sgblack@eecs.umich.edu                        0xF1: FailUnimpl::ldblockf_s();
9573272Sgblack@eecs.umich.edu                        //ASI_BLOCK_PRIMARY_LITTLE
9583272Sgblack@eecs.umich.edu                        0xF8: FailUnimpl::ldblockf_pl();
9593272Sgblack@eecs.umich.edu                        //ASI_BLOCK_SECONDARY_LITTLE
9603272Sgblack@eecs.umich.edu                        0xF9: FailUnimpl::ldblockf_sl();
9613272Sgblack@eecs.umich.edu                    }
9623272Sgblack@eecs.umich.edu
9633272Sgblack@eecs.umich.edu                    //LDSHORTF
9643272Sgblack@eecs.umich.edu                    //ASI_FL8_PRIMARY
9653272Sgblack@eecs.umich.edu                    0xD0: FailUnimpl::ldshortf_8p();
9663272Sgblack@eecs.umich.edu                    //ASI_FL8_SECONDARY
9673272Sgblack@eecs.umich.edu                    0xD1: FailUnimpl::ldshortf_8s();
9683272Sgblack@eecs.umich.edu                    //ASI_FL8_PRIMARY_LITTLE
9693272Sgblack@eecs.umich.edu                    0xD8: FailUnimpl::ldshortf_8pl();
9703272Sgblack@eecs.umich.edu                    //ASI_FL8_SECONDARY_LITTLE
9713272Sgblack@eecs.umich.edu                    0xD9: FailUnimpl::ldshortf_8sl();
9723272Sgblack@eecs.umich.edu                    //ASI_FL16_PRIMARY
9733272Sgblack@eecs.umich.edu                    0xD2: FailUnimpl::ldshortf_16p();
9743272Sgblack@eecs.umich.edu                    //ASI_FL16_SECONDARY
9753272Sgblack@eecs.umich.edu                    0xD3: FailUnimpl::ldshortf_16s();
9763272Sgblack@eecs.umich.edu                    //ASI_FL16_PRIMARY_LITTLE
9773272Sgblack@eecs.umich.edu                    0xDA: FailUnimpl::ldshortf_16pl();
9783272Sgblack@eecs.umich.edu                    //ASI_FL16_SECONDARY_LITTLE
9793272Sgblack@eecs.umich.edu                    0xDB: FailUnimpl::ldshortf_16sl();
9803272Sgblack@eecs.umich.edu                    //Not an ASI which is legal with lddfa
9813378Sgblack@eecs.umich.edu                    default: Trap::lddfa_bad_asi(
9823378Sgblack@eecs.umich.edu                        {{fault = new DataAccessException;}});
9833272Sgblack@eecs.umich.edu                }
9843272Sgblack@eecs.umich.edu            }
9853272Sgblack@eecs.umich.edu            0x34: Store::stfa({{Mem.uw = Frd.uw;}});
9862954Sgblack@eecs.umich.edu            0x36: stqfa({{fault = new FpDisabled;}});
9873378Sgblack@eecs.umich.edu            format StoreAlt {
9883378Sgblack@eecs.umich.edu                0x37: decode EXT_ASI {
9893378Sgblack@eecs.umich.edu                    //ASI_NUCLEUS
9903378Sgblack@eecs.umich.edu                    0x04: FailUnimpl::stdfa_n();
9913378Sgblack@eecs.umich.edu                    //ASI_NUCLEUS_LITTLE
9923378Sgblack@eecs.umich.edu                    0x0C: FailUnimpl::stdfa_nl();
9933378Sgblack@eecs.umich.edu                    //ASI_AS_IF_USER_PRIMARY
9943378Sgblack@eecs.umich.edu                    0x10: FailUnimpl::stdfa_aiup();
9953378Sgblack@eecs.umich.edu                    //ASI_AS_IF_USER_PRIMARY_LITTLE
9963378Sgblack@eecs.umich.edu                    0x18: FailUnimpl::stdfa_aiupl();
9973378Sgblack@eecs.umich.edu                    //ASI_AS_IF_USER_SECONDARY
9983378Sgblack@eecs.umich.edu                    0x11: FailUnimpl::stdfa_aius();
9993378Sgblack@eecs.umich.edu                    //ASI_AS_IF_USER_SECONDARY_LITTLE
10003378Sgblack@eecs.umich.edu                    0x19: FailUnimpl::stdfa_aiusl();
10013378Sgblack@eecs.umich.edu                    //ASI_REAL
10023378Sgblack@eecs.umich.edu                    0x14: FailUnimpl::stdfa_real();
10033378Sgblack@eecs.umich.edu                    //ASI_REAL_LITTLE
10043378Sgblack@eecs.umich.edu                    0x1C: FailUnimpl::stdfa_real_l();
10053378Sgblack@eecs.umich.edu                    //ASI_REAL_IO
10063378Sgblack@eecs.umich.edu                    0x15: FailUnimpl::stdfa_real_io();
10073378Sgblack@eecs.umich.edu                    //ASI_REAL_IO_LITTLE
10083378Sgblack@eecs.umich.edu                    0x1D: FailUnimpl::stdfa_real_io_l();
10093378Sgblack@eecs.umich.edu                    //ASI_PRIMARY
10103378Sgblack@eecs.umich.edu                    0x80: FailUnimpl::stdfa_p();
10113378Sgblack@eecs.umich.edu                    //ASI_PRIMARY_LITTLE
10123378Sgblack@eecs.umich.edu                    0x88: FailUnimpl::stdfa_pl();
10133378Sgblack@eecs.umich.edu                    //ASI_SECONDARY
10143378Sgblack@eecs.umich.edu                    0x81: FailUnimpl::stdfa_s();
10153378Sgblack@eecs.umich.edu                    //ASI_SECONDARY_LITTLE
10163378Sgblack@eecs.umich.edu                    0x89: FailUnimpl::stdfa_sl();
10173378Sgblack@eecs.umich.edu                    //ASI_PRIMARY_NO_FAULT
10183378Sgblack@eecs.umich.edu                    0x82: FailUnimpl::stdfa_pnf();
10193378Sgblack@eecs.umich.edu                    //ASI_PRIMARY_NO_FAULT_LITTLE
10203378Sgblack@eecs.umich.edu                    0x8A: FailUnimpl::stdfa_pnfl();
10213378Sgblack@eecs.umich.edu                    //ASI_SECONDARY_NO_FAULT
10223378Sgblack@eecs.umich.edu                    0x83: FailUnimpl::stdfa_snf();
10233378Sgblack@eecs.umich.edu                    //ASI_SECONDARY_NO_FAULT_LITTLE
10243378Sgblack@eecs.umich.edu                    0x8B: FailUnimpl::stdfa_snfl();
10253378Sgblack@eecs.umich.edu
10263378Sgblack@eecs.umich.edu                    format BlockStore {
10273378Sgblack@eecs.umich.edu                        // STBLOCKF
10283378Sgblack@eecs.umich.edu                        //ASI_BLOCK_AS_IF_USER_PRIMARY
10293378Sgblack@eecs.umich.edu                        0x16: FailUnimpl::stblockf_aiup();
10303378Sgblack@eecs.umich.edu                        //ASI_BLOCK_AS_IF_USER_SECONDARY
10313378Sgblack@eecs.umich.edu                        0x17: FailUnimpl::stblockf_aius();
10323378Sgblack@eecs.umich.edu                        //ASI_BLOCK_AS_IF_USER_PRIMARY_LITTLE
10333378Sgblack@eecs.umich.edu                        0x1E: FailUnimpl::stblockf_aiupl();
10343378Sgblack@eecs.umich.edu                        //ASI_BLOCK_AS_IF_USER_SECONDARY_LITTLE
10353378Sgblack@eecs.umich.edu                        0x1F: FailUnimpl::stblockf_aiusl();
10363378Sgblack@eecs.umich.edu                        //ASI_BLOCK_PRIMARY
10373378Sgblack@eecs.umich.edu                        0xF0: stblockf_p({{Mem.udw = Frd_N.udw;}});
10383378Sgblack@eecs.umich.edu                        //ASI_BLOCK_SECONDARY
10393378Sgblack@eecs.umich.edu                        0xF1: FailUnimpl::stblockf_s();
10403378Sgblack@eecs.umich.edu                        //ASI_BLOCK_PRIMARY_LITTLE
10413378Sgblack@eecs.umich.edu                        0xF8: FailUnimpl::stblockf_pl();
10423378Sgblack@eecs.umich.edu                        //ASI_BLOCK_SECONDARY_LITTLE
10433378Sgblack@eecs.umich.edu                        0xF9: FailUnimpl::stblockf_sl();
10443378Sgblack@eecs.umich.edu                    }
10453378Sgblack@eecs.umich.edu
10463378Sgblack@eecs.umich.edu                    //STSHORTF
10473378Sgblack@eecs.umich.edu                    //ASI_FL8_PRIMARY
10483378Sgblack@eecs.umich.edu                    0xD0: FailUnimpl::stshortf_8p();
10493378Sgblack@eecs.umich.edu                    //ASI_FL8_SECONDARY
10503378Sgblack@eecs.umich.edu                    0xD1: FailUnimpl::stshortf_8s();
10513378Sgblack@eecs.umich.edu                    //ASI_FL8_PRIMARY_LITTLE
10523378Sgblack@eecs.umich.edu                    0xD8: FailUnimpl::stshortf_8pl();
10533378Sgblack@eecs.umich.edu                    //ASI_FL8_SECONDARY_LITTLE
10543378Sgblack@eecs.umich.edu                    0xD9: FailUnimpl::stshortf_8sl();
10553378Sgblack@eecs.umich.edu                    //ASI_FL16_PRIMARY
10563378Sgblack@eecs.umich.edu                    0xD2: FailUnimpl::stshortf_16p();
10573378Sgblack@eecs.umich.edu                    //ASI_FL16_SECONDARY
10583378Sgblack@eecs.umich.edu                    0xD3: FailUnimpl::stshortf_16s();
10593378Sgblack@eecs.umich.edu                    //ASI_FL16_PRIMARY_LITTLE
10603378Sgblack@eecs.umich.edu                    0xDA: FailUnimpl::stshortf_16pl();
10613378Sgblack@eecs.umich.edu                    //ASI_FL16_SECONDARY_LITTLE
10623378Sgblack@eecs.umich.edu                    0xDB: FailUnimpl::stshortf_16sl();
10633378Sgblack@eecs.umich.edu                    //Not an ASI which is legal with lddfa
10643378Sgblack@eecs.umich.edu                    default: Trap::stdfa_bad_asi(
10653378Sgblack@eecs.umich.edu                        {{fault = new DataAccessException;}});
10663378Sgblack@eecs.umich.edu                }
10673378Sgblack@eecs.umich.edu            }
10682526SN/A            0x3C: Cas::casa({{
10692526SN/A                uint64_t val = Mem.uw;
10702526SN/A                if(Rs2.uw == val)
10712526SN/A                        Mem.uw = Rd.uw;
10722526SN/A                Rd.uw = val;
10732526SN/A            }});
10742526SN/A            0x3D: Nop::prefetcha({{ }});
10752526SN/A            0x3E: Cas::casxa({{
10762526SN/A                uint64_t val = Mem.udw;
10772526SN/A                if(Rs2 == val)
10782526SN/A                        Mem.udw = Rd;
10792526SN/A                Rd = val;
10802526SN/A            }});
10812526SN/A        }
10822469SN/A    }
10832022SN/A}
1084