decoder.isa revision 3468
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({{ 3563468Sgblack@eecs.umich.edu Rd = xc->readMiscRegWithEffect(RS1 + AsrStart); 3572954Sgblack@eecs.umich.edu }}); 3582954Sgblack@eecs.umich.edu } 3592938Sgblack@eecs.umich.edu 0x29: HPriv::rdhpr({{ 3603468Sgblack@eecs.umich.edu Rd = xc->readMiscRegWithEffect(RS1 + HprStart); 3612646Ssaidi@eecs.umich.edu }}); 3622938Sgblack@eecs.umich.edu 0x2A: Priv::rdpr({{ 3633468Sgblack@eecs.umich.edu Rd = xc->readMiscRegWithEffect(RS1 + PrStart); 3642646Ssaidi@eecs.umich.edu }}); 3652526SN/A 0x2B: BasicOperate::flushw({{ 3662526SN/A if(NWindows - 2 - Cansave == 0) 3672526SN/A { 3682526SN/A if(Otherwin) 3692646Ssaidi@eecs.umich.edu fault = new SpillNOther(Wstate<5:3>); 3702526SN/A else 3712646Ssaidi@eecs.umich.edu fault = new SpillNNormal(Wstate<2:0>); 3722526SN/A } 3732526SN/A }}); 3742526SN/A 0x2C: decode MOVCC3 3752469SN/A { 3762526SN/A 0x0: Trap::movccfcc({{fault = new FpDisabled;}}); 3772526SN/A 0x1: decode CC 3782526SN/A { 3792526SN/A 0x0: movcci({{ 3802646Ssaidi@eecs.umich.edu if(passesCondition(Ccr<3:0>, COND4)) 3812591SN/A Rd = Rs2_or_imm11; 3822591SN/A else 3832591SN/A Rd = Rd; 3842526SN/A }}); 3852526SN/A 0x2: movccx({{ 3862646Ssaidi@eecs.umich.edu if(passesCondition(Ccr<7:4>, COND4)) 3872591SN/A Rd = Rs2_or_imm11; 3882591SN/A else 3892591SN/A Rd = Rd; 3902526SN/A }}); 3912224SN/A } 3922526SN/A } 3932526SN/A 0x2D: sdivx({{ 3942615SN/A if(Rs2_or_imm13.sdw == 0) fault = new DivisionByZero; 3952615SN/A else Rd.sdw = Rs1.sdw / Rs2_or_imm13.sdw; 3962526SN/A }}); 3972526SN/A 0x2E: decode RS1 { 3982526SN/A 0x0: IntOp::popc({{ 3992526SN/A int64_t count = 0; 4002526SN/A uint64_t temp = Rs2_or_imm13; 4012526SN/A //Count the 1s in the front 4bits until none are left 4022526SN/A uint8_t oneBits[] = {0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4}; 4032526SN/A while(temp) 4042469SN/A { 4052526SN/A count += oneBits[temp & 0xF]; 4062526SN/A temp = temp >> 4; 4072516SN/A } 4082591SN/A Rd = count; 4092516SN/A }}); 4102526SN/A } 4112526SN/A 0x2F: decode RCOND3 4122526SN/A { 4132615SN/A 0x1: movreq({{Rd = (Rs1.sdw == 0) ? Rs2_or_imm10 : Rd;}}); 4142615SN/A 0x2: movrle({{Rd = (Rs1.sdw <= 0) ? Rs2_or_imm10 : Rd;}}); 4152615SN/A 0x3: movrl({{Rd = (Rs1.sdw < 0) ? Rs2_or_imm10 : Rd;}}); 4162615SN/A 0x5: movrne({{Rd = (Rs1.sdw != 0) ? Rs2_or_imm10 : Rd;}}); 4172615SN/A 0x6: movrg({{Rd = (Rs1.sdw > 0) ? Rs2_or_imm10 : Rd;}}); 4182615SN/A 0x7: movrge({{Rd = (Rs1.sdw >= 0) ? Rs2_or_imm10 : Rd;}}); 4192526SN/A } 4202646Ssaidi@eecs.umich.edu 0x30: wrasr({{ 4212646Ssaidi@eecs.umich.edu xc->setMiscRegWithEffect(RD + AsrStart, Rs1 ^ Rs2_or_imm13); 4222646Ssaidi@eecs.umich.edu }}); 4232526SN/A 0x31: decode FCN { 4243417Sgblack@eecs.umich.edu 0x0: Priv::saved({{ 4253417Sgblack@eecs.umich.edu assert(Cansave < NWindows - 2); 4263417Sgblack@eecs.umich.edu assert(Otherwin || Canrestore); 4273417Sgblack@eecs.umich.edu Cansave = Cansave + 1; 4283417Sgblack@eecs.umich.edu if(Otherwin == 0) 4293417Sgblack@eecs.umich.edu Canrestore = Canrestore - 1; 4303417Sgblack@eecs.umich.edu else 4313417Sgblack@eecs.umich.edu Otherwin = Otherwin - 1; 4323417Sgblack@eecs.umich.edu }}); 4333417Sgblack@eecs.umich.edu 0x1: BasicOperate::restored({{ 4343417Sgblack@eecs.umich.edu assert(Cansave || Otherwin); 4353417Sgblack@eecs.umich.edu assert(Canrestore < NWindows - 2); 4363417Sgblack@eecs.umich.edu Canrestore = Canrestore + 1; 4373417Sgblack@eecs.umich.edu if(Otherwin == 0) 4383417Sgblack@eecs.umich.edu Cansave = Cansave - 1; 4393417Sgblack@eecs.umich.edu else 4403417Sgblack@eecs.umich.edu Otherwin = Otherwin - 1; 4413417Sgblack@eecs.umich.edu }}); 4422526SN/A } 4432938Sgblack@eecs.umich.edu 0x32: Priv::wrpr({{ 4442646Ssaidi@eecs.umich.edu // XXX Need to protect with format that traps non-priv 4452646Ssaidi@eecs.umich.edu // access 4463423Sgblack@eecs.umich.edu xc->setMiscRegWithEffect(RD + PrStart, Rs1 ^ Rs2_or_imm13); 4472646Ssaidi@eecs.umich.edu }}); 4482938Sgblack@eecs.umich.edu 0x33: HPriv::wrhpr({{ 4492646Ssaidi@eecs.umich.edu // XXX Need to protect with format that traps non-priv/priv 4502646Ssaidi@eecs.umich.edu // access 4513423Sgblack@eecs.umich.edu xc->setMiscRegWithEffect(RD + HprStart, Rs1 ^ Rs2_or_imm13); 4522646Ssaidi@eecs.umich.edu }}); 4532954Sgblack@eecs.umich.edu 0x34: decode OPF{ 4542963Sgblack@eecs.umich.edu format BasicOperate{ 4552963Sgblack@eecs.umich.edu 0x01: fmovs({{ 4563279Sgblack@eecs.umich.edu Frds.uw = Frs2s.uw; 4572963Sgblack@eecs.umich.edu //fsr.ftt = fsr.cexc = 0 4582963Sgblack@eecs.umich.edu Fsr &= ~(7 << 14); 4592963Sgblack@eecs.umich.edu Fsr &= ~(0x1F); 4602963Sgblack@eecs.umich.edu }}); 4612963Sgblack@eecs.umich.edu 0x02: fmovd({{ 4623057Sgblack@eecs.umich.edu Frd.udw = Frs2.udw; 4632963Sgblack@eecs.umich.edu //fsr.ftt = fsr.cexc = 0 4642963Sgblack@eecs.umich.edu Fsr &= ~(7 << 14); 4652963Sgblack@eecs.umich.edu Fsr &= ~(0x1F); 4662963Sgblack@eecs.umich.edu }}); 4672963Sgblack@eecs.umich.edu 0x03: Trap::fmovq({{fault = new FpDisabled;}}); 4682963Sgblack@eecs.umich.edu 0x05: fnegs({{ 4693279Sgblack@eecs.umich.edu Frds.uw = Frs2s.uw ^ (1UL << 31); 4702963Sgblack@eecs.umich.edu //fsr.ftt = fsr.cexc = 0 4712963Sgblack@eecs.umich.edu Fsr &= ~(7 << 14); 4722963Sgblack@eecs.umich.edu Fsr &= ~(0x1F); 4732963Sgblack@eecs.umich.edu }}); 4742963Sgblack@eecs.umich.edu 0x06: fnegd({{ 4753057Sgblack@eecs.umich.edu Frd.udw = Frs2.udw ^ (1ULL << 63); 4762963Sgblack@eecs.umich.edu //fsr.ftt = fsr.cexc = 0 4772963Sgblack@eecs.umich.edu Fsr &= ~(7 << 14); 4782963Sgblack@eecs.umich.edu Fsr &= ~(0x1F); 4792963Sgblack@eecs.umich.edu }}); 4802963Sgblack@eecs.umich.edu 0x07: Trap::fnegq({{fault = new FpDisabled;}}); 4812963Sgblack@eecs.umich.edu 0x09: fabss({{ 4823279Sgblack@eecs.umich.edu Frds.uw = ((1UL << 31) - 1) & Frs2s.uw; 4832963Sgblack@eecs.umich.edu //fsr.ftt = fsr.cexc = 0 4842963Sgblack@eecs.umich.edu Fsr &= ~(7 << 14); 4852963Sgblack@eecs.umich.edu Fsr &= ~(0x1F); 4862963Sgblack@eecs.umich.edu }}); 4872963Sgblack@eecs.umich.edu 0x0A: fabsd({{ 4883057Sgblack@eecs.umich.edu Frd.udw = ((1ULL << 63) - 1) & Frs2.udw; 4892963Sgblack@eecs.umich.edu //fsr.ftt = fsr.cexc = 0 4902963Sgblack@eecs.umich.edu Fsr &= ~(7 << 14); 4912963Sgblack@eecs.umich.edu Fsr &= ~(0x1F); 4922963Sgblack@eecs.umich.edu }}); 4932963Sgblack@eecs.umich.edu 0x0B: Trap::fabsq({{fault = new FpDisabled;}}); 4943279Sgblack@eecs.umich.edu 0x29: fsqrts({{Frds.sf = sqrt(Frs2s.sf);}}); 4952963Sgblack@eecs.umich.edu 0x2A: fsqrtd({{Frd.df = sqrt(Frs2.df);}}); 4962963Sgblack@eecs.umich.edu 0x2B: Trap::fsqrtq({{fault = new FpDisabled;}}); 4973279Sgblack@eecs.umich.edu 0x41: fadds({{Frds.sf = Frs1s.sf + Frs2s.sf;}}); 4982963Sgblack@eecs.umich.edu 0x42: faddd({{Frd.df = Frs1.df + Frs2.df;}}); 4992963Sgblack@eecs.umich.edu 0x43: Trap::faddq({{fault = new FpDisabled;}}); 5003279Sgblack@eecs.umich.edu 0x45: fsubs({{Frds.sf = Frs1s.sf - Frs2s.sf;}}); 5012963Sgblack@eecs.umich.edu 0x46: fsubd({{Frd.df = Frs1.df - Frs2.df;}}); 5022963Sgblack@eecs.umich.edu 0x47: Trap::fsubq({{fault = new FpDisabled;}}); 5033279Sgblack@eecs.umich.edu 0x49: fmuls({{Frds.sf = Frs1s.sf * Frs2s.sf;}}); 5042963Sgblack@eecs.umich.edu 0x4A: fmuld({{Frd.df = Frs1.df * Frs2.df;}}); 5052963Sgblack@eecs.umich.edu 0x4B: Trap::fmulq({{fault = new FpDisabled;}}); 5063279Sgblack@eecs.umich.edu 0x4D: fdivs({{Frds.sf = Frs1s.sf / Frs2s.sf;}}); 5072963Sgblack@eecs.umich.edu 0x4E: fdivd({{Frd.df = Frs1.df / Frs2.df;}}); 5082963Sgblack@eecs.umich.edu 0x4F: Trap::fdivq({{fault = new FpDisabled;}}); 5093279Sgblack@eecs.umich.edu 0x69: fsmuld({{Frd.df = Frs1s.sf * Frs2s.sf;}}); 5102963Sgblack@eecs.umich.edu 0x6E: Trap::fdmulq({{fault = new FpDisabled;}}); 5112963Sgblack@eecs.umich.edu 0x81: fstox({{ 5123279Sgblack@eecs.umich.edu Frd.df = (double)static_cast<int64_t>(Frs2s.sf); 5132963Sgblack@eecs.umich.edu }}); 5142963Sgblack@eecs.umich.edu 0x82: fdtox({{ 5152963Sgblack@eecs.umich.edu Frd.df = (double)static_cast<int64_t>(Frs2.df); 5162963Sgblack@eecs.umich.edu }}); 5172963Sgblack@eecs.umich.edu 0x83: Trap::fqtox({{fault = new FpDisabled;}}); 5182963Sgblack@eecs.umich.edu 0x84: fxtos({{ 5193279Sgblack@eecs.umich.edu Frds.sf = static_cast<float>((int64_t)Frs2.df); 5202963Sgblack@eecs.umich.edu }}); 5212963Sgblack@eecs.umich.edu 0x88: fxtod({{ 5222963Sgblack@eecs.umich.edu Frd.df = static_cast<double>((int64_t)Frs2.df); 5232963Sgblack@eecs.umich.edu }}); 5242963Sgblack@eecs.umich.edu 0x8C: Trap::fxtoq({{fault = new FpDisabled;}}); 5252963Sgblack@eecs.umich.edu 0xC4: fitos({{ 5263279Sgblack@eecs.umich.edu Frds.sf = static_cast<float>((int32_t)Frs2s.sf); 5272963Sgblack@eecs.umich.edu }}); 5283279Sgblack@eecs.umich.edu 0xC6: fdtos({{Frds.sf = Frs2.df;}}); 5292963Sgblack@eecs.umich.edu 0xC7: Trap::fqtos({{fault = new FpDisabled;}}); 5302963Sgblack@eecs.umich.edu 0xC8: fitod({{ 5313279Sgblack@eecs.umich.edu Frd.df = static_cast<double>((int32_t)Frs2s.sf); 5322963Sgblack@eecs.umich.edu }}); 5333279Sgblack@eecs.umich.edu 0xC9: fstod({{Frd.df = Frs2s.sf;}}); 5342963Sgblack@eecs.umich.edu 0xCB: Trap::fqtod({{fault = new FpDisabled;}}); 5352963Sgblack@eecs.umich.edu 0xCC: Trap::fitoq({{fault = new FpDisabled;}}); 5362963Sgblack@eecs.umich.edu 0xCD: Trap::fstoq({{fault = new FpDisabled;}}); 5372963Sgblack@eecs.umich.edu 0xCE: Trap::fdtoq({{fault = new FpDisabled;}}); 5382963Sgblack@eecs.umich.edu 0xD1: fstoi({{ 5393279Sgblack@eecs.umich.edu Frds.sf = (float)static_cast<int32_t>(Frs2s.sf); 5402963Sgblack@eecs.umich.edu }}); 5412963Sgblack@eecs.umich.edu 0xD2: fdtoi({{ 5423279Sgblack@eecs.umich.edu Frds.sf = (float)static_cast<int32_t>(Frs2.df); 5432963Sgblack@eecs.umich.edu }}); 5442963Sgblack@eecs.umich.edu 0xD3: Trap::fqtoi({{fault = new FpDisabled;}}); 5452963Sgblack@eecs.umich.edu default: Trap::fpop1({{fault = new FpDisabled;}}); 5462963Sgblack@eecs.umich.edu } 5472954Sgblack@eecs.umich.edu } 5482526SN/A 0x35: Trap::fpop2({{fault = new FpDisabled;}}); 5492954Sgblack@eecs.umich.edu //This used to be just impdep1, but now it's a whole bunch 5502954Sgblack@eecs.umich.edu //of instructions 5512954Sgblack@eecs.umich.edu 0x36: decode OPF{ 5522954Sgblack@eecs.umich.edu 0x00: Trap::edge8({{fault = new IllegalInstruction;}}); 5532954Sgblack@eecs.umich.edu 0x01: Trap::edge8n({{fault = new IllegalInstruction;}}); 5542954Sgblack@eecs.umich.edu 0x02: Trap::edge8l({{fault = new IllegalInstruction;}}); 5552954Sgblack@eecs.umich.edu 0x03: Trap::edge8ln({{fault = new IllegalInstruction;}}); 5562954Sgblack@eecs.umich.edu 0x04: Trap::edge16({{fault = new IllegalInstruction;}}); 5572954Sgblack@eecs.umich.edu 0x05: Trap::edge16n({{fault = new IllegalInstruction;}}); 5582954Sgblack@eecs.umich.edu 0x06: Trap::edge16l({{fault = new IllegalInstruction;}}); 5592954Sgblack@eecs.umich.edu 0x07: Trap::edge16ln({{fault = new IllegalInstruction;}}); 5602954Sgblack@eecs.umich.edu 0x08: Trap::edge32({{fault = new IllegalInstruction;}}); 5612954Sgblack@eecs.umich.edu 0x09: Trap::edge32n({{fault = new IllegalInstruction;}}); 5622954Sgblack@eecs.umich.edu 0x0A: Trap::edge32l({{fault = new IllegalInstruction;}}); 5632954Sgblack@eecs.umich.edu 0x0B: Trap::edge32ln({{fault = new IllegalInstruction;}}); 5642954Sgblack@eecs.umich.edu 0x10: Trap::array8({{fault = new IllegalInstruction;}}); 5652954Sgblack@eecs.umich.edu 0x12: Trap::array16({{fault = new IllegalInstruction;}}); 5662954Sgblack@eecs.umich.edu 0x14: Trap::array32({{fault = new IllegalInstruction;}}); 5673042Sgblack@eecs.umich.edu 0x18: BasicOperate::alignaddr({{ 5682963Sgblack@eecs.umich.edu uint64_t sum = Rs1 + Rs2; 5693042Sgblack@eecs.umich.edu Rd = sum & ~7; 5702963Sgblack@eecs.umich.edu Gsr = (Gsr & ~7) | (sum & 7); 5712963Sgblack@eecs.umich.edu }}); 5722954Sgblack@eecs.umich.edu 0x19: Trap::bmask({{fault = new IllegalInstruction;}}); 5732963Sgblack@eecs.umich.edu 0x1A: BasicOperate::alignaddresslittle({{ 5742963Sgblack@eecs.umich.edu uint64_t sum = Rs1 + Rs2; 5753042Sgblack@eecs.umich.edu Rd = sum & ~7; 5762963Sgblack@eecs.umich.edu Gsr = (Gsr & ~7) | ((~sum + 1) & 7); 5772963Sgblack@eecs.umich.edu }}); 5782954Sgblack@eecs.umich.edu 0x20: Trap::fcmple16({{fault = new IllegalInstruction;}}); 5792954Sgblack@eecs.umich.edu 0x22: Trap::fcmpne16({{fault = new IllegalInstruction;}}); 5802954Sgblack@eecs.umich.edu 0x24: Trap::fcmple32({{fault = new IllegalInstruction;}}); 5812954Sgblack@eecs.umich.edu 0x26: Trap::fcmpne32({{fault = new IllegalInstruction;}}); 5822954Sgblack@eecs.umich.edu 0x28: Trap::fcmpgt16({{fault = new IllegalInstruction;}}); 5832954Sgblack@eecs.umich.edu 0x2A: Trap::fcmpeq16({{fault = new IllegalInstruction;}}); 5842954Sgblack@eecs.umich.edu 0x2C: Trap::fcmpgt32({{fault = new IllegalInstruction;}}); 5852954Sgblack@eecs.umich.edu 0x2E: Trap::fcmpeq32({{fault = new IllegalInstruction;}}); 5862954Sgblack@eecs.umich.edu 0x31: Trap::fmul8x16({{fault = new IllegalInstruction;}}); 5872954Sgblack@eecs.umich.edu 0x33: Trap::fmul8x16au({{fault = new IllegalInstruction;}}); 5882954Sgblack@eecs.umich.edu 0x35: Trap::fmul8x16al({{fault = new IllegalInstruction;}}); 5892954Sgblack@eecs.umich.edu 0x36: Trap::fmul8sux16({{fault = new IllegalInstruction;}}); 5902954Sgblack@eecs.umich.edu 0x37: Trap::fmul8ulx16({{fault = new IllegalInstruction;}}); 5912954Sgblack@eecs.umich.edu 0x38: Trap::fmuld8sux16({{fault = new IllegalInstruction;}}); 5922954Sgblack@eecs.umich.edu 0x39: Trap::fmuld8ulx16({{fault = new IllegalInstruction;}}); 5932954Sgblack@eecs.umich.edu 0x3A: Trap::fpack32({{fault = new IllegalInstruction;}}); 5942954Sgblack@eecs.umich.edu 0x3B: Trap::fpack16({{fault = new IllegalInstruction;}}); 5952954Sgblack@eecs.umich.edu 0x3D: Trap::fpackfix({{fault = new IllegalInstruction;}}); 5962954Sgblack@eecs.umich.edu 0x3E: Trap::pdist({{fault = new IllegalInstruction;}}); 5972963Sgblack@eecs.umich.edu 0x48: BasicOperate::faligndata({{ 5983057Sgblack@eecs.umich.edu uint64_t msbX = Frs1.udw; 5993057Sgblack@eecs.umich.edu uint64_t lsbX = Frs2.udw; 6003057Sgblack@eecs.umich.edu //Some special cases need to be split out, first 6013057Sgblack@eecs.umich.edu //because they're the most likely to be used, and 6023057Sgblack@eecs.umich.edu //second because otherwise, we end up shifting by 6033057Sgblack@eecs.umich.edu //greater than the width of the type being shifted, 6043057Sgblack@eecs.umich.edu //namely 64, which produces undefined results according 6053057Sgblack@eecs.umich.edu //to the C standard. 6063057Sgblack@eecs.umich.edu switch(Gsr<2:0>) 6073057Sgblack@eecs.umich.edu { 6083057Sgblack@eecs.umich.edu case 0: 6093057Sgblack@eecs.umich.edu Frd.udw = msbX; 6103057Sgblack@eecs.umich.edu break; 6113057Sgblack@eecs.umich.edu case 8: 6123057Sgblack@eecs.umich.edu Frd.udw = lsbX; 6133057Sgblack@eecs.umich.edu break; 6143057Sgblack@eecs.umich.edu default: 6153057Sgblack@eecs.umich.edu uint64_t msbShift = Gsr<2:0> * 8; 6163057Sgblack@eecs.umich.edu uint64_t lsbShift = (8 - Gsr<2:0>) * 8; 6173057Sgblack@eecs.umich.edu uint64_t msbMask = ((uint64_t)(-1)) >> msbShift; 6183057Sgblack@eecs.umich.edu uint64_t lsbMask = ((uint64_t)(-1)) << lsbShift; 6193057Sgblack@eecs.umich.edu Frd.udw = ((msbX & msbMask) << msbShift) | 6203057Sgblack@eecs.umich.edu ((lsbX & lsbMask) >> lsbShift); 6213057Sgblack@eecs.umich.edu } 6222963Sgblack@eecs.umich.edu }}); 6232954Sgblack@eecs.umich.edu 0x4B: Trap::fpmerge({{fault = new IllegalInstruction;}}); 6242954Sgblack@eecs.umich.edu 0x4C: Trap::bshuffle({{fault = new IllegalInstruction;}}); 6252954Sgblack@eecs.umich.edu 0x4D: Trap::fexpand({{fault = new IllegalInstruction;}}); 6262954Sgblack@eecs.umich.edu 0x50: Trap::fpadd16({{fault = new IllegalInstruction;}}); 6272954Sgblack@eecs.umich.edu 0x51: Trap::fpadd16s({{fault = new IllegalInstruction;}}); 6282954Sgblack@eecs.umich.edu 0x52: Trap::fpadd32({{fault = new IllegalInstruction;}}); 6292954Sgblack@eecs.umich.edu 0x53: Trap::fpadd32s({{fault = new IllegalInstruction;}}); 6302954Sgblack@eecs.umich.edu 0x54: Trap::fpsub16({{fault = new IllegalInstruction;}}); 6312954Sgblack@eecs.umich.edu 0x55: Trap::fpsub16s({{fault = new IllegalInstruction;}}); 6322954Sgblack@eecs.umich.edu 0x56: Trap::fpsub32({{fault = new IllegalInstruction;}}); 6332954Sgblack@eecs.umich.edu 0x57: Trap::fpsub32s({{fault = new IllegalInstruction;}}); 6342963Sgblack@eecs.umich.edu 0x60: BasicOperate::fzero({{Frd.df = 0;}}); 6353279Sgblack@eecs.umich.edu 0x61: BasicOperate::fzeros({{Frds.sf = 0;}}); 6362954Sgblack@eecs.umich.edu 0x62: Trap::fnor({{fault = new IllegalInstruction;}}); 6372954Sgblack@eecs.umich.edu 0x63: Trap::fnors({{fault = new IllegalInstruction;}}); 6382954Sgblack@eecs.umich.edu 0x64: Trap::fandnot2({{fault = new IllegalInstruction;}}); 6392954Sgblack@eecs.umich.edu 0x65: Trap::fandnot2s({{fault = new IllegalInstruction;}}); 6402963Sgblack@eecs.umich.edu 0x66: BasicOperate::fnot2({{ 6412963Sgblack@eecs.umich.edu Frd.df = (double)(~((uint64_t)Frs2.df)); 6422963Sgblack@eecs.umich.edu }}); 6432963Sgblack@eecs.umich.edu 0x67: BasicOperate::fnot2s({{ 6443279Sgblack@eecs.umich.edu Frds.sf = (float)(~((uint32_t)Frs2s.sf)); 6452963Sgblack@eecs.umich.edu }}); 6462954Sgblack@eecs.umich.edu 0x68: Trap::fandnot1({{fault = new IllegalInstruction;}}); 6472954Sgblack@eecs.umich.edu 0x69: Trap::fandnot1s({{fault = new IllegalInstruction;}}); 6482963Sgblack@eecs.umich.edu 0x6A: BasicOperate::fnot1({{ 6492963Sgblack@eecs.umich.edu Frd.df = (double)(~((uint64_t)Frs1.df)); 6502963Sgblack@eecs.umich.edu }}); 6512963Sgblack@eecs.umich.edu 0x6B: BasicOperate::fnot1s({{ 6523279Sgblack@eecs.umich.edu Frds.sf = (float)(~((uint32_t)Frs1s.sf)); 6532963Sgblack@eecs.umich.edu }}); 6542954Sgblack@eecs.umich.edu 0x6C: Trap::fxor({{fault = new IllegalInstruction;}}); 6552954Sgblack@eecs.umich.edu 0x6D: Trap::fxors({{fault = new IllegalInstruction;}}); 6562954Sgblack@eecs.umich.edu 0x6E: Trap::fnand({{fault = new IllegalInstruction;}}); 6572954Sgblack@eecs.umich.edu 0x6F: Trap::fnands({{fault = new IllegalInstruction;}}); 6582954Sgblack@eecs.umich.edu 0x70: Trap::fand({{fault = new IllegalInstruction;}}); 6592954Sgblack@eecs.umich.edu 0x71: Trap::fands({{fault = new IllegalInstruction;}}); 6602954Sgblack@eecs.umich.edu 0x72: Trap::fxnor({{fault = new IllegalInstruction;}}); 6612954Sgblack@eecs.umich.edu 0x73: Trap::fxnors({{fault = new IllegalInstruction;}}); 6623057Sgblack@eecs.umich.edu 0x74: BasicOperate::fsrc1({{Frd.udw = Frs1.udw;}}); 6633057Sgblack@eecs.umich.edu 0x75: BasicOperate::fsrc1s({{Frd.uw = Frs1.uw;}}); 6642954Sgblack@eecs.umich.edu 0x76: Trap::fornot2({{fault = new IllegalInstruction;}}); 6652954Sgblack@eecs.umich.edu 0x77: Trap::fornot2s({{fault = new IllegalInstruction;}}); 6663057Sgblack@eecs.umich.edu 0x78: BasicOperate::fsrc2({{Frd.udw = Frs2.udw;}}); 6673057Sgblack@eecs.umich.edu 0x79: BasicOperate::fsrc2s({{Frd.uw = Frs2.uw;}}); 6682954Sgblack@eecs.umich.edu 0x7A: Trap::fornot1({{fault = new IllegalInstruction;}}); 6692954Sgblack@eecs.umich.edu 0x7B: Trap::fornot1s({{fault = new IllegalInstruction;}}); 6702954Sgblack@eecs.umich.edu 0x7C: Trap::for({{fault = new IllegalInstruction;}}); 6712954Sgblack@eecs.umich.edu 0x7D: Trap::fors({{fault = new IllegalInstruction;}}); 6722954Sgblack@eecs.umich.edu 0x7E: Trap::fone({{fault = new IllegalInstruction;}}); 6732954Sgblack@eecs.umich.edu 0x7F: Trap::fones({{fault = new IllegalInstruction;}}); 6742954Sgblack@eecs.umich.edu 0x80: Trap::shutdown({{fault = new IllegalInstruction;}}); 6752954Sgblack@eecs.umich.edu 0x81: Trap::siam({{fault = new IllegalInstruction;}}); 6762954Sgblack@eecs.umich.edu } 6772954Sgblack@eecs.umich.edu 0x37: Trap::impdep2({{fault = new IllegalInstruction;}}); 6782526SN/A 0x38: Branch::jmpl({{ 6792526SN/A Addr target = Rs1 + Rs2_or_imm13; 6802526SN/A if(target & 0x3) 6812526SN/A fault = new MemAddressNotAligned; 6822526SN/A else 6832526SN/A { 6842526SN/A Rd = xc->readPC(); 6852526SN/A NNPC = target; 6862526SN/A } 6872526SN/A }}); 6882526SN/A 0x39: Branch::return({{ 6892561SN/A //If both MemAddressNotAligned and 6902561SN/A //a fill trap happen, it's not clear 6912561SN/A //which one should be returned. 6922526SN/A Addr target = Rs1 + Rs2_or_imm13; 6932526SN/A if(target & 0x3) 6942526SN/A fault = new MemAddressNotAligned; 6952526SN/A else 6962526SN/A NNPC = target; 6972561SN/A if(fault == NoFault) 6982561SN/A { 6992561SN/A if(Canrestore == 0) 7002561SN/A { 7012561SN/A if(Otherwin) 7022646Ssaidi@eecs.umich.edu fault = new FillNOther(Wstate<5:3>); 7032561SN/A else 7042646Ssaidi@eecs.umich.edu fault = new FillNNormal(Wstate<2:0>); 7052561SN/A } 7062561SN/A else 7072561SN/A { 7083417Sgblack@eecs.umich.edu //CWP should be set directly so that it always happens 7093417Sgblack@eecs.umich.edu //Also, this will allow writing to the new window and 7103417Sgblack@eecs.umich.edu //reading from the old one 7113417Sgblack@eecs.umich.edu Cwp = (Cwp - 1 + NWindows) % NWindows; 7122561SN/A Cansave = Cansave + 1; 7132561SN/A Canrestore = Canrestore - 1; 7143417Sgblack@eecs.umich.edu //This is here to make sure the CWP is written 7153417Sgblack@eecs.umich.edu //no matter what. This ensures that the results 7163417Sgblack@eecs.umich.edu //are written in the new window as well. 7173417Sgblack@eecs.umich.edu xc->setMiscRegWithEffect(MISCREG_CWP, Cwp); 7182561SN/A } 7192561SN/A } 7202526SN/A }}); 7212526SN/A 0x3A: decode CC 7222526SN/A { 7232526SN/A 0x0: Trap::tcci({{ 7242646Ssaidi@eecs.umich.edu if(passesCondition(Ccr<3:0>, COND2)) 7252561SN/A { 7263039Sstever@eecs.umich.edu#if FULL_SYSTEM 7272561SN/A int lTrapNum = I ? (Rs1 + SW_TRAP) : (Rs1 + Rs2); 7282561SN/A DPRINTF(Sparc, "The trap number is %d\n", lTrapNum); 7292561SN/A fault = new TrapInstruction(lTrapNum); 7302526SN/A#else 7312561SN/A DPRINTF(Sparc, "The syscall number is %d\n", R1); 7322561SN/A xc->syscall(R1); 7332561SN/A#endif 7342561SN/A } 7352526SN/A }}); 7362526SN/A 0x2: Trap::tccx({{ 7372646Ssaidi@eecs.umich.edu if(passesCondition(Ccr<7:4>, COND2)) 7382561SN/A { 7393039Sstever@eecs.umich.edu#if FULL_SYSTEM 7402561SN/A int lTrapNum = I ? (Rs1 + SW_TRAP) : (Rs1 + Rs2); 7412561SN/A DPRINTF(Sparc, "The trap number is %d\n", lTrapNum); 7422561SN/A fault = new TrapInstruction(lTrapNum); 7432526SN/A#else 7442561SN/A DPRINTF(Sparc, "The syscall number is %d\n", R1); 7452561SN/A xc->syscall(R1); 7462561SN/A#endif 7472526SN/A } 7482526SN/A }}); 7492526SN/A } 7502526SN/A 0x3B: Nop::flush({{/*Instruction memory flush*/}}); 7512526SN/A 0x3C: save({{ 7522526SN/A //CWP should be set directly so that it always happens 7532526SN/A //Also, this will allow writing to the new window and 7542526SN/A //reading from the old one 7552526SN/A if(Cansave == 0) 7562526SN/A { 7572526SN/A if(Otherwin) 7582646Ssaidi@eecs.umich.edu fault = new SpillNOther(Wstate<5:3>); 7592526SN/A else 7602646Ssaidi@eecs.umich.edu fault = new SpillNNormal(Wstate<2:0>); 7613417Sgblack@eecs.umich.edu //Cwp = (Cwp + 2) % NWindows; 7622526SN/A } 7632526SN/A else if(Cleanwin - Canrestore == 0) 7642526SN/A { 7653417Sgblack@eecs.umich.edu //Cwp = (Cwp + 1) % NWindows; 7662526SN/A fault = new CleanWindow; 7672526SN/A } 7682526SN/A else 7692526SN/A { 7702526SN/A Cwp = (Cwp + 1) % NWindows; 7712526SN/A Rd = Rs1 + Rs2_or_imm13; 7722561SN/A Cansave = Cansave - 1; 7732561SN/A Canrestore = Canrestore + 1; 7743417Sgblack@eecs.umich.edu //This is here to make sure the CWP is written 7753417Sgblack@eecs.umich.edu //no matter what. This ensures that the results 7763417Sgblack@eecs.umich.edu //are written in the new window as well. 7773417Sgblack@eecs.umich.edu xc->setMiscRegWithEffect(MISCREG_CWP, Cwp); 7782526SN/A } 7792526SN/A }}); 7802526SN/A 0x3D: restore({{ 7812526SN/A if(Canrestore == 0) 7822526SN/A { 7832526SN/A if(Otherwin) 7842646Ssaidi@eecs.umich.edu fault = new FillNOther(Wstate<5:3>); 7852526SN/A else 7862646Ssaidi@eecs.umich.edu fault = new FillNNormal(Wstate<2:0>); 7872526SN/A } 7882526SN/A else 7892526SN/A { 7903417Sgblack@eecs.umich.edu //CWP should be set directly so that it always happens 7913417Sgblack@eecs.umich.edu //Also, this will allow writing to the new window and 7923417Sgblack@eecs.umich.edu //reading from the old one 7933417Sgblack@eecs.umich.edu Cwp = (Cwp - 1 + NWindows) % NWindows; 7942526SN/A Rd = Rs1 + Rs2_or_imm13; 7952561SN/A Cansave = Cansave + 1; 7962561SN/A Canrestore = Canrestore - 1; 7973417Sgblack@eecs.umich.edu //This is here to make sure the CWP is written 7983417Sgblack@eecs.umich.edu //no matter what. This ensures that the results 7993417Sgblack@eecs.umich.edu //are written in the new window as well. 8003417Sgblack@eecs.umich.edu xc->setMiscRegWithEffect(MISCREG_CWP, Cwp); 8012526SN/A } 8022526SN/A }}); 8032526SN/A 0x3E: decode FCN { 8042526SN/A 0x0: Priv::done({{ 8052526SN/A if(Tl == 0) 8062526SN/A return new IllegalInstruction; 8072646Ssaidi@eecs.umich.edu 8082646Ssaidi@eecs.umich.edu Cwp = Tstate<4:0>; 8092646Ssaidi@eecs.umich.edu Pstate = Tstate<20:8>; 8102646Ssaidi@eecs.umich.edu Asi = Tstate<31:24>; 8112646Ssaidi@eecs.umich.edu Ccr = Tstate<39:32>; 8122646Ssaidi@eecs.umich.edu Gl = Tstate<42:40>; 8132646Ssaidi@eecs.umich.edu NPC = Tnpc; 8142646Ssaidi@eecs.umich.edu NNPC = Tnpc + 4; 8152526SN/A Tl = Tl - 1; 8162526SN/A }}); 8172938Sgblack@eecs.umich.edu 0x1: Priv::retry({{ 8182526SN/A if(Tl == 0) 8192526SN/A return new IllegalInstruction; 8202646Ssaidi@eecs.umich.edu Cwp = Tstate<4:0>; 8212646Ssaidi@eecs.umich.edu Pstate = Tstate<20:8>; 8222646Ssaidi@eecs.umich.edu Asi = Tstate<31:24>; 8232646Ssaidi@eecs.umich.edu Ccr = Tstate<39:32>; 8242646Ssaidi@eecs.umich.edu Gl = Tstate<42:40>; 8252646Ssaidi@eecs.umich.edu NPC = Tpc; 8263417Sgblack@eecs.umich.edu NNPC = Tnpc; 8272526SN/A Tl = Tl - 1; 8282526SN/A }}); 8292526SN/A } 8302526SN/A } 8312469SN/A } 8322469SN/A 0x3: decode OP3 { 8332526SN/A format Load { 8343272Sgblack@eecs.umich.edu 0x00: lduw({{Rd = Mem.uw;}}); 8353272Sgblack@eecs.umich.edu 0x01: ldub({{Rd = Mem.ub;}}); 8363272Sgblack@eecs.umich.edu 0x02: lduh({{Rd = Mem.uhw;}}); 8372526SN/A 0x03: ldd({{ 8383272Sgblack@eecs.umich.edu uint64_t val = Mem.udw; 8392526SN/A RdLow = val<31:0>; 8402526SN/A RdHigh = val<63:32>; 8413272Sgblack@eecs.umich.edu }}); 8422526SN/A } 8432526SN/A format Store { 8443272Sgblack@eecs.umich.edu 0x04: stw({{Mem.uw = Rd.sw;}}); 8453272Sgblack@eecs.umich.edu 0x05: stb({{Mem.ub = Rd.sb;}}); 8463272Sgblack@eecs.umich.edu 0x06: sth({{Mem.uhw = Rd.shw;}}); 8473272Sgblack@eecs.umich.edu 0x07: std({{Mem.udw = RdLow<31:0> | (RdHigh<31:0> << 32);}}); 8482526SN/A } 8492526SN/A format Load { 8503272Sgblack@eecs.umich.edu 0x08: ldsw({{Rd = (int32_t)Mem.sw;}}); 8513272Sgblack@eecs.umich.edu 0x09: ldsb({{Rd = (int8_t)Mem.sb;}}); 8523272Sgblack@eecs.umich.edu 0x0A: ldsh({{Rd = (int16_t)Mem.shw;}}); 8533272Sgblack@eecs.umich.edu 0x0B: ldx({{Rd = (int64_t)Mem.sdw;}}); 8542526SN/A } 8553438Sgblack@eecs.umich.edu 0x0D: LoadStore::ldstub( 8563438Sgblack@eecs.umich.edu {{Rd = Mem.ub;}}, 8573438Sgblack@eecs.umich.edu {{Mem.ub = 0xFF;}}); 8583272Sgblack@eecs.umich.edu 0x0E: Store::stx({{Mem.udw = Rd}}); 8593388Sgblack@eecs.umich.edu 0x0F: LoadStore::swap( 8603438Sgblack@eecs.umich.edu {{uReg0 = Rd.uw; 8613388Sgblack@eecs.umich.edu Rd.uw = Mem.uw;}}, 8623438Sgblack@eecs.umich.edu {{Mem.uw = uReg0;}}); 8632526SN/A format Load { 8643272Sgblack@eecs.umich.edu 0x10: lduwa({{Rd = Mem.uw;}}); 8653272Sgblack@eecs.umich.edu 0x11: lduba({{Rd = Mem.ub;}}); 8663272Sgblack@eecs.umich.edu 0x12: lduha({{Rd = Mem.uhw;}}); 8672526SN/A 0x13: ldda({{ 8683272Sgblack@eecs.umich.edu uint64_t val = Mem.udw; 8692526SN/A RdLow = val<31:0>; 8702526SN/A RdHigh = val<63:32>; 8713272Sgblack@eecs.umich.edu }}); 8722526SN/A } 8732526SN/A format Store { 8743272Sgblack@eecs.umich.edu 0x14: stwa({{Mem.uw = Rd;}}); 8753272Sgblack@eecs.umich.edu 0x15: stba({{Mem.ub = Rd;}}); 8763272Sgblack@eecs.umich.edu 0x16: stha({{Mem.uhw = Rd;}}); 8773272Sgblack@eecs.umich.edu 0x17: stda({{Mem.udw = RdLow<31:0> | RdHigh<31:0> << 32;}}); 8782526SN/A } 8792526SN/A format Load { 8803272Sgblack@eecs.umich.edu 0x18: ldswa({{Rd = (int32_t)Mem.sw;}}); 8813272Sgblack@eecs.umich.edu 0x19: ldsba({{Rd = (int8_t)Mem.sb;}}); 8823272Sgblack@eecs.umich.edu 0x1A: ldsha({{Rd = (int16_t)Mem.shw;}}); 8833272Sgblack@eecs.umich.edu 0x1B: ldxa({{Rd = (int64_t)Mem.sdw;}}); 8842526SN/A } 8853388Sgblack@eecs.umich.edu 0x1D: LoadStore::ldstuba( 8863388Sgblack@eecs.umich.edu {{Rd = Mem.ub;}}, 8873388Sgblack@eecs.umich.edu {{Mem.ub = 0xFF}}); 8883272Sgblack@eecs.umich.edu 0x1E: Store::stxa({{Mem.udw = Rd}}); 8893388Sgblack@eecs.umich.edu 0x1F: LoadStore::swapa( 8903438Sgblack@eecs.umich.edu {{uReg0 = Rd.uw; 8913388Sgblack@eecs.umich.edu Rd.uw = Mem.uw;}}, 8923438Sgblack@eecs.umich.edu {{Mem.uw = uReg0;}}); 8932526SN/A format Trap { 8943272Sgblack@eecs.umich.edu 0x20: Load::ldf({{Frd.uw = Mem.uw;}}); 8952526SN/A 0x21: decode X { 8963272Sgblack@eecs.umich.edu 0x0: Load::ldfsr({{Fsr = Mem.uw | Fsr<63:32>;}}); 8973272Sgblack@eecs.umich.edu 0x1: Load::ldxfsr({{Fsr = Mem.udw;}}); 8982469SN/A } 8992526SN/A 0x22: ldqf({{fault = new FpDisabled;}}); 9003272Sgblack@eecs.umich.edu 0x23: Load::lddf({{Frd.udw = Mem.udw;}}); 9013272Sgblack@eecs.umich.edu 0x24: Store::stf({{Mem.uw = Frd.uw;}}); 9022526SN/A 0x25: decode X { 9033272Sgblack@eecs.umich.edu 0x0: Store::stfsr({{Mem.uw = Fsr<31:0>;}}); 9043272Sgblack@eecs.umich.edu 0x1: Store::stxfsr({{Mem.udw = Fsr;}}); 9052526SN/A } 9062526SN/A 0x26: stqf({{fault = new FpDisabled;}}); 9073272Sgblack@eecs.umich.edu 0x27: Store::stdf({{Mem.udw = Frd.udw;}}); 9082526SN/A 0x2D: Nop::prefetch({{ }}); 9093272Sgblack@eecs.umich.edu 0x30: Load::ldfa({{Frd.uw = Mem.uw;}}); 9102526SN/A 0x32: ldqfa({{fault = new FpDisabled;}}); 9113272Sgblack@eecs.umich.edu format LoadAlt { 9123272Sgblack@eecs.umich.edu 0x33: decode EXT_ASI { 9133272Sgblack@eecs.umich.edu //ASI_NUCLEUS 9143272Sgblack@eecs.umich.edu 0x04: FailUnimpl::lddfa_n(); 9153272Sgblack@eecs.umich.edu //ASI_NUCLEUS_LITTLE 9163272Sgblack@eecs.umich.edu 0x0C: FailUnimpl::lddfa_nl(); 9173272Sgblack@eecs.umich.edu //ASI_AS_IF_USER_PRIMARY 9183272Sgblack@eecs.umich.edu 0x10: FailUnimpl::lddfa_aiup(); 9193272Sgblack@eecs.umich.edu //ASI_AS_IF_USER_PRIMARY_LITTLE 9203272Sgblack@eecs.umich.edu 0x18: FailUnimpl::lddfa_aiupl(); 9213272Sgblack@eecs.umich.edu //ASI_AS_IF_USER_SECONDARY 9223272Sgblack@eecs.umich.edu 0x11: FailUnimpl::lddfa_aius(); 9233272Sgblack@eecs.umich.edu //ASI_AS_IF_USER_SECONDARY_LITTLE 9243272Sgblack@eecs.umich.edu 0x19: FailUnimpl::lddfa_aiusl(); 9253272Sgblack@eecs.umich.edu //ASI_REAL 9263272Sgblack@eecs.umich.edu 0x14: FailUnimpl::lddfa_real(); 9273272Sgblack@eecs.umich.edu //ASI_REAL_LITTLE 9283272Sgblack@eecs.umich.edu 0x1C: FailUnimpl::lddfa_real_l(); 9293272Sgblack@eecs.umich.edu //ASI_REAL_IO 9303272Sgblack@eecs.umich.edu 0x15: FailUnimpl::lddfa_real_io(); 9313272Sgblack@eecs.umich.edu //ASI_REAL_IO_LITTLE 9323272Sgblack@eecs.umich.edu 0x1D: FailUnimpl::lddfa_real_io_l(); 9333272Sgblack@eecs.umich.edu //ASI_PRIMARY 9343272Sgblack@eecs.umich.edu 0x80: FailUnimpl::lddfa_p(); 9353272Sgblack@eecs.umich.edu //ASI_PRIMARY_LITTLE 9363272Sgblack@eecs.umich.edu 0x88: FailUnimpl::lddfa_pl(); 9373272Sgblack@eecs.umich.edu //ASI_SECONDARY 9383272Sgblack@eecs.umich.edu 0x81: FailUnimpl::lddfa_s(); 9393272Sgblack@eecs.umich.edu //ASI_SECONDARY_LITTLE 9403272Sgblack@eecs.umich.edu 0x89: FailUnimpl::lddfa_sl(); 9413272Sgblack@eecs.umich.edu //ASI_PRIMARY_NO_FAULT 9423272Sgblack@eecs.umich.edu 0x82: FailUnimpl::lddfa_pnf(); 9433272Sgblack@eecs.umich.edu //ASI_PRIMARY_NO_FAULT_LITTLE 9443272Sgblack@eecs.umich.edu 0x8A: FailUnimpl::lddfa_pnfl(); 9453272Sgblack@eecs.umich.edu //ASI_SECONDARY_NO_FAULT 9463272Sgblack@eecs.umich.edu 0x83: FailUnimpl::lddfa_snf(); 9473272Sgblack@eecs.umich.edu //ASI_SECONDARY_NO_FAULT_LITTLE 9483272Sgblack@eecs.umich.edu 0x8B: FailUnimpl::lddfa_snfl(); 9493272Sgblack@eecs.umich.edu 9503272Sgblack@eecs.umich.edu format BlockLoad { 9513272Sgblack@eecs.umich.edu // LDBLOCKF 9523272Sgblack@eecs.umich.edu //ASI_BLOCK_AS_IF_USER_PRIMARY 9533272Sgblack@eecs.umich.edu 0x16: FailUnimpl::ldblockf_aiup(); 9543272Sgblack@eecs.umich.edu //ASI_BLOCK_AS_IF_USER_SECONDARY 9553272Sgblack@eecs.umich.edu 0x17: FailUnimpl::ldblockf_aius(); 9563272Sgblack@eecs.umich.edu //ASI_BLOCK_AS_IF_USER_PRIMARY_LITTLE 9573272Sgblack@eecs.umich.edu 0x1E: FailUnimpl::ldblockf_aiupl(); 9583272Sgblack@eecs.umich.edu //ASI_BLOCK_AS_IF_USER_SECONDARY_LITTLE 9593272Sgblack@eecs.umich.edu 0x1F: FailUnimpl::ldblockf_aiusl(); 9603272Sgblack@eecs.umich.edu //ASI_BLOCK_PRIMARY 9613378Sgblack@eecs.umich.edu 0xF0: ldblockf_p({{Frd_N.udw = Mem.udw;}}); 9623272Sgblack@eecs.umich.edu //ASI_BLOCK_SECONDARY 9633272Sgblack@eecs.umich.edu 0xF1: FailUnimpl::ldblockf_s(); 9643272Sgblack@eecs.umich.edu //ASI_BLOCK_PRIMARY_LITTLE 9653272Sgblack@eecs.umich.edu 0xF8: FailUnimpl::ldblockf_pl(); 9663272Sgblack@eecs.umich.edu //ASI_BLOCK_SECONDARY_LITTLE 9673272Sgblack@eecs.umich.edu 0xF9: FailUnimpl::ldblockf_sl(); 9683272Sgblack@eecs.umich.edu } 9693272Sgblack@eecs.umich.edu 9703272Sgblack@eecs.umich.edu //LDSHORTF 9713272Sgblack@eecs.umich.edu //ASI_FL8_PRIMARY 9723272Sgblack@eecs.umich.edu 0xD0: FailUnimpl::ldshortf_8p(); 9733272Sgblack@eecs.umich.edu //ASI_FL8_SECONDARY 9743272Sgblack@eecs.umich.edu 0xD1: FailUnimpl::ldshortf_8s(); 9753272Sgblack@eecs.umich.edu //ASI_FL8_PRIMARY_LITTLE 9763272Sgblack@eecs.umich.edu 0xD8: FailUnimpl::ldshortf_8pl(); 9773272Sgblack@eecs.umich.edu //ASI_FL8_SECONDARY_LITTLE 9783272Sgblack@eecs.umich.edu 0xD9: FailUnimpl::ldshortf_8sl(); 9793272Sgblack@eecs.umich.edu //ASI_FL16_PRIMARY 9803272Sgblack@eecs.umich.edu 0xD2: FailUnimpl::ldshortf_16p(); 9813272Sgblack@eecs.umich.edu //ASI_FL16_SECONDARY 9823272Sgblack@eecs.umich.edu 0xD3: FailUnimpl::ldshortf_16s(); 9833272Sgblack@eecs.umich.edu //ASI_FL16_PRIMARY_LITTLE 9843272Sgblack@eecs.umich.edu 0xDA: FailUnimpl::ldshortf_16pl(); 9853272Sgblack@eecs.umich.edu //ASI_FL16_SECONDARY_LITTLE 9863272Sgblack@eecs.umich.edu 0xDB: FailUnimpl::ldshortf_16sl(); 9873272Sgblack@eecs.umich.edu //Not an ASI which is legal with lddfa 9883378Sgblack@eecs.umich.edu default: Trap::lddfa_bad_asi( 9893378Sgblack@eecs.umich.edu {{fault = new DataAccessException;}}); 9903272Sgblack@eecs.umich.edu } 9913272Sgblack@eecs.umich.edu } 9923272Sgblack@eecs.umich.edu 0x34: Store::stfa({{Mem.uw = Frd.uw;}}); 9932954Sgblack@eecs.umich.edu 0x36: stqfa({{fault = new FpDisabled;}}); 9943378Sgblack@eecs.umich.edu format StoreAlt { 9953378Sgblack@eecs.umich.edu 0x37: decode EXT_ASI { 9963378Sgblack@eecs.umich.edu //ASI_NUCLEUS 9973378Sgblack@eecs.umich.edu 0x04: FailUnimpl::stdfa_n(); 9983378Sgblack@eecs.umich.edu //ASI_NUCLEUS_LITTLE 9993378Sgblack@eecs.umich.edu 0x0C: FailUnimpl::stdfa_nl(); 10003378Sgblack@eecs.umich.edu //ASI_AS_IF_USER_PRIMARY 10013378Sgblack@eecs.umich.edu 0x10: FailUnimpl::stdfa_aiup(); 10023378Sgblack@eecs.umich.edu //ASI_AS_IF_USER_PRIMARY_LITTLE 10033378Sgblack@eecs.umich.edu 0x18: FailUnimpl::stdfa_aiupl(); 10043378Sgblack@eecs.umich.edu //ASI_AS_IF_USER_SECONDARY 10053378Sgblack@eecs.umich.edu 0x11: FailUnimpl::stdfa_aius(); 10063378Sgblack@eecs.umich.edu //ASI_AS_IF_USER_SECONDARY_LITTLE 10073378Sgblack@eecs.umich.edu 0x19: FailUnimpl::stdfa_aiusl(); 10083378Sgblack@eecs.umich.edu //ASI_REAL 10093378Sgblack@eecs.umich.edu 0x14: FailUnimpl::stdfa_real(); 10103378Sgblack@eecs.umich.edu //ASI_REAL_LITTLE 10113378Sgblack@eecs.umich.edu 0x1C: FailUnimpl::stdfa_real_l(); 10123378Sgblack@eecs.umich.edu //ASI_REAL_IO 10133378Sgblack@eecs.umich.edu 0x15: FailUnimpl::stdfa_real_io(); 10143378Sgblack@eecs.umich.edu //ASI_REAL_IO_LITTLE 10153378Sgblack@eecs.umich.edu 0x1D: FailUnimpl::stdfa_real_io_l(); 10163378Sgblack@eecs.umich.edu //ASI_PRIMARY 10173378Sgblack@eecs.umich.edu 0x80: FailUnimpl::stdfa_p(); 10183378Sgblack@eecs.umich.edu //ASI_PRIMARY_LITTLE 10193378Sgblack@eecs.umich.edu 0x88: FailUnimpl::stdfa_pl(); 10203378Sgblack@eecs.umich.edu //ASI_SECONDARY 10213378Sgblack@eecs.umich.edu 0x81: FailUnimpl::stdfa_s(); 10223378Sgblack@eecs.umich.edu //ASI_SECONDARY_LITTLE 10233378Sgblack@eecs.umich.edu 0x89: FailUnimpl::stdfa_sl(); 10243378Sgblack@eecs.umich.edu //ASI_PRIMARY_NO_FAULT 10253378Sgblack@eecs.umich.edu 0x82: FailUnimpl::stdfa_pnf(); 10263378Sgblack@eecs.umich.edu //ASI_PRIMARY_NO_FAULT_LITTLE 10273378Sgblack@eecs.umich.edu 0x8A: FailUnimpl::stdfa_pnfl(); 10283378Sgblack@eecs.umich.edu //ASI_SECONDARY_NO_FAULT 10293378Sgblack@eecs.umich.edu 0x83: FailUnimpl::stdfa_snf(); 10303378Sgblack@eecs.umich.edu //ASI_SECONDARY_NO_FAULT_LITTLE 10313378Sgblack@eecs.umich.edu 0x8B: FailUnimpl::stdfa_snfl(); 10323378Sgblack@eecs.umich.edu 10333378Sgblack@eecs.umich.edu format BlockStore { 10343378Sgblack@eecs.umich.edu // STBLOCKF 10353378Sgblack@eecs.umich.edu //ASI_BLOCK_AS_IF_USER_PRIMARY 10363378Sgblack@eecs.umich.edu 0x16: FailUnimpl::stblockf_aiup(); 10373378Sgblack@eecs.umich.edu //ASI_BLOCK_AS_IF_USER_SECONDARY 10383378Sgblack@eecs.umich.edu 0x17: FailUnimpl::stblockf_aius(); 10393378Sgblack@eecs.umich.edu //ASI_BLOCK_AS_IF_USER_PRIMARY_LITTLE 10403378Sgblack@eecs.umich.edu 0x1E: FailUnimpl::stblockf_aiupl(); 10413378Sgblack@eecs.umich.edu //ASI_BLOCK_AS_IF_USER_SECONDARY_LITTLE 10423378Sgblack@eecs.umich.edu 0x1F: FailUnimpl::stblockf_aiusl(); 10433378Sgblack@eecs.umich.edu //ASI_BLOCK_PRIMARY 10443378Sgblack@eecs.umich.edu 0xF0: stblockf_p({{Mem.udw = Frd_N.udw;}}); 10453378Sgblack@eecs.umich.edu //ASI_BLOCK_SECONDARY 10463378Sgblack@eecs.umich.edu 0xF1: FailUnimpl::stblockf_s(); 10473378Sgblack@eecs.umich.edu //ASI_BLOCK_PRIMARY_LITTLE 10483378Sgblack@eecs.umich.edu 0xF8: FailUnimpl::stblockf_pl(); 10493378Sgblack@eecs.umich.edu //ASI_BLOCK_SECONDARY_LITTLE 10503378Sgblack@eecs.umich.edu 0xF9: FailUnimpl::stblockf_sl(); 10513378Sgblack@eecs.umich.edu } 10523378Sgblack@eecs.umich.edu 10533378Sgblack@eecs.umich.edu //STSHORTF 10543378Sgblack@eecs.umich.edu //ASI_FL8_PRIMARY 10553378Sgblack@eecs.umich.edu 0xD0: FailUnimpl::stshortf_8p(); 10563378Sgblack@eecs.umich.edu //ASI_FL8_SECONDARY 10573378Sgblack@eecs.umich.edu 0xD1: FailUnimpl::stshortf_8s(); 10583378Sgblack@eecs.umich.edu //ASI_FL8_PRIMARY_LITTLE 10593378Sgblack@eecs.umich.edu 0xD8: FailUnimpl::stshortf_8pl(); 10603378Sgblack@eecs.umich.edu //ASI_FL8_SECONDARY_LITTLE 10613378Sgblack@eecs.umich.edu 0xD9: FailUnimpl::stshortf_8sl(); 10623378Sgblack@eecs.umich.edu //ASI_FL16_PRIMARY 10633378Sgblack@eecs.umich.edu 0xD2: FailUnimpl::stshortf_16p(); 10643378Sgblack@eecs.umich.edu //ASI_FL16_SECONDARY 10653378Sgblack@eecs.umich.edu 0xD3: FailUnimpl::stshortf_16s(); 10663378Sgblack@eecs.umich.edu //ASI_FL16_PRIMARY_LITTLE 10673378Sgblack@eecs.umich.edu 0xDA: FailUnimpl::stshortf_16pl(); 10683378Sgblack@eecs.umich.edu //ASI_FL16_SECONDARY_LITTLE 10693378Sgblack@eecs.umich.edu 0xDB: FailUnimpl::stshortf_16sl(); 10703378Sgblack@eecs.umich.edu //Not an ASI which is legal with lddfa 10713378Sgblack@eecs.umich.edu default: Trap::stdfa_bad_asi( 10723378Sgblack@eecs.umich.edu {{fault = new DataAccessException;}}); 10733378Sgblack@eecs.umich.edu } 10743378Sgblack@eecs.umich.edu } 10753439Sgblack@eecs.umich.edu 0x3C: Cas::casa( 10763439Sgblack@eecs.umich.edu {{uReg0 = Mem.uw;}}, 10773439Sgblack@eecs.umich.edu {{if(Rs2.uw == uReg0) 10782526SN/A Mem.uw = Rd.uw; 10793439Sgblack@eecs.umich.edu else 10803439Sgblack@eecs.umich.edu storeCond = false; 10813439Sgblack@eecs.umich.edu Rd.uw = uReg0;}}); 10822526SN/A 0x3D: Nop::prefetcha({{ }}); 10833439Sgblack@eecs.umich.edu 0x3E: Cas::casxa( 10843439Sgblack@eecs.umich.edu {{uReg0 = Mem.udw;}}, 10853439Sgblack@eecs.umich.edu {{if(Rs2 == uReg0) 10862526SN/A Mem.udw = Rd; 10873439Sgblack@eecs.umich.edu else 10883439Sgblack@eecs.umich.edu storeCond = false; 10893439Sgblack@eecs.umich.edu Rd = uReg0;}}); 10902526SN/A } 10912469SN/A } 10922022SN/A} 1093