1// Copyright (c) 2006-2007 The Regents of The University of Michigan 2// All rights reserved. 3// 4// Redistribution and use in source and binary forms, with or without 5// modification, are permitted provided that the following conditions are 6// met: redistributions of source code must retain the above copyright 7// notice, this list of conditions and the following disclaimer; 8// redistributions in binary form must reproduce the above copyright --- 299 unchanged lines hidden (view full) --- 308 0x0: sra({{Rd = Rs1.sw >> (I ? SHCNT32 : Rs2<4:0>);}}); 309 0x1: srax({{Rd = Rs1.sdw >> (I ? SHCNT64 : Rs2<5:0>);}}); 310 } 311 0x28: decode RS1 { 312 0x00: NoPriv::rdy({{Rd = Y<31:0>;}}); 313 //1 should cause an illegal instruction exception 314 0x02: NoPriv::rdccr({{Rd = Ccr;}}); 315 0x03: NoPriv::rdasi({{Rd = Asi;}}); |
316 0x04: Priv::rdtick({{Rd = Tick;}}, {{Tick<63:>}}); |
317 0x05: NoPriv::rdpc({{ 318 if(Pstate<3:>) 319 Rd = (xc->readPC())<31:0>; 320 else 321 Rd = xc->readPC();}}); 322 0x06: NoPriv::rdfprs({{ 323 //Wait for all fpops to finish. 324 Rd = Fprs; 325 }}); 326 //7-14 should cause an illegal instruction exception 327 0x0F: decode I { 328 0x0: Nop::stbar({{/*stuff*/}}, IsWriteBarrier, MemWriteOp); 329 0x1: Nop::membar({{/*stuff*/}}, IsMemBarrier, MemReadOp); 330 } 331 0x10: Priv::rdpcr({{Rd = Pcr;}}); |
332 0x11: Priv::rdpic({{Rd = Pic;}}, {{Pcr<0:>}}); |
333 //0x12 should cause an illegal instruction exception 334 0x13: NoPriv::rdgsr({{ 335 fault = checkFpEnableFault(xc); 336 if (fault) 337 return fault; 338 Rd = Gsr; 339 }}); 340 //0x14-0x15 should cause an illegal instruction exception 341 0x16: Priv::rdsoftint({{Rd = Softint;}}); 342 0x17: Priv::rdtick_cmpr({{Rd = TickCmpr;}}); |
343 0x18: Priv::rdstick({{Rd = Stick}}, {{Stick<63:>}}); |
344 0x19: Priv::rdstick_cmpr({{Rd = StickCmpr;}}); 345 0x1A: Priv::rdstrand_sts_reg({{ 346 if(Pstate<2:> && !Hpstate<2:>) 347 Rd = StrandStsReg<0:>; 348 else 349 Rd = StrandStsReg; 350 }}); 351 //0x1A is supposed to be reserved, but it reads the strand 352 //status register. 353 //0x1B-0x1F should cause an illegal instruction exception 354 } 355 0x29: decode RS1 { 356 0x00: HPriv::rdhprhpstate({{Rd = Hpstate;}}); |
357 0x01: HPriv::rdhprhtstate({{Rd = Htstate;}}, checkTl=true); |
358 //0x02 should cause an illegal instruction exception 359 0x03: HPriv::rdhprhintp({{Rd = Hintp;}}); 360 //0x04 should cause an illegal instruction exception 361 0x05: HPriv::rdhprhtba({{Rd = Htba;}}); 362 0x06: HPriv::rdhprhver({{Rd = Hver;}}); 363 //0x07-0x1E should cause an illegal instruction exception 364 0x1F: HPriv::rdhprhstick_cmpr({{Rd = HstickCmpr;}}); 365 } 366 0x2A: decode RS1 { |
367 0x00: Priv::rdprtpc({{Rd = Tpc;}}, checkTl=true); 368 0x01: Priv::rdprtnpc({{Rd = Tnpc;}}, checkTl=true); 369 0x02: Priv::rdprtstate({{Rd = Tstate;}}, checkTl=true); 370 0x03: Priv::rdprtt({{Rd = Tt;}}, checkTl=true); |
371 0x04: Priv::rdprtick({{Rd = Tick;}}); 372 0x05: Priv::rdprtba({{Rd = Tba;}}); 373 0x06: Priv::rdprpstate({{Rd = Pstate;}}); 374 0x07: Priv::rdprtl({{Rd = Tl;}}); 375 0x08: Priv::rdprpil({{Rd = Pil;}}); 376 0x09: Priv::rdprcwp({{Rd = Cwp;}}); 377 0x0A: Priv::rdprcansave({{Rd = Cansave;}}); 378 0x0B: Priv::rdprcanrestore({{Rd = Canrestore;}}); --- 51 unchanged lines hidden (view full) --- 430 //0x01 should cause an illegal instruction exception 431 0x02: NoPriv::wrccr({{Ccr = Rs1 ^ Rs2_or_imm13;}}); 432 0x03: NoPriv::wrasi({{Asi = Rs1 ^ Rs2_or_imm13;}}); 433 //0x04-0x05 should cause an illegal instruction exception 434 0x06: NoPriv::wrfprs({{Fprs = Rs1 ^ Rs2_or_imm13;}}); 435 //0x07-0x0E should cause an illegal instruction exception 436 0x0F: Trap::softreset({{fault = new SoftwareInitiatedReset;}}); 437 0x10: Priv::wrpcr({{Pcr = Rs1 ^ Rs2_or_imm13;}}); |
438 0x11: Priv::wrpic({{Pic = Rs1 ^ Rs2_or_imm13;}}, {{Pcr<0:>}}); |
439 //0x12 should cause an illegal instruction exception 440 0x13: NoPriv::wrgsr({{ 441 if(Fprs<2:> == 0 || Pstate<4:> == 0) 442 return new FpDisabled; 443 Gsr = Rs1 ^ Rs2_or_imm13; 444 }}); 445 0x14: Priv::wrsoftint_set({{SoftintSet = Rs1 ^ Rs2_or_imm13;}}); 446 0x15: Priv::wrsoftint_clr({{SoftintClr = Rs1 ^ Rs2_or_imm13;}}); --- 31 unchanged lines hidden (view full) --- 478 else 479 Otherwin = Otherwin - 1; 480 481 if(Cleanwin < NWindows - 1) 482 Cleanwin = Cleanwin + 1; 483 }}); 484 } 485 0x32: decode RD { |
486 0x00: Priv::wrprtpc( 487 {{Tpc = Rs1 ^ Rs2_or_imm13;}}, checkTl=true); 488 0x01: Priv::wrprtnpc( 489 {{Tnpc = Rs1 ^ Rs2_or_imm13;}}, checkTl=true); 490 0x02: Priv::wrprtstate( 491 {{Tstate = Rs1 ^ Rs2_or_imm13;}}, checkTl=true); 492 0x03: Priv::wrprtt( 493 {{Tt = Rs1 ^ Rs2_or_imm13;}}, checkTl=true); |
494 0x04: HPriv::wrprtick({{Tick = Rs1 ^ Rs2_or_imm13;}}); 495 0x05: Priv::wrprtba({{Tba = Rs1 ^ Rs2_or_imm13;}}); 496 0x06: Priv::wrprpstate({{Pstate = Rs1 ^ Rs2_or_imm13;}}); 497 0x07: Priv::wrprtl({{ 498 if(Pstate<2:> && !Hpstate<2:>) 499 Tl = std::min<uint64_t>(Rs1 ^ Rs2_or_imm13, MaxPTL); 500 else 501 Tl = std::min<uint64_t>(Rs1 ^ Rs2_or_imm13, MaxTL); --- 11 unchanged lines hidden (view full) --- 513 Gl = std::min<uint64_t>(Rs1 ^ Rs2_or_imm13, MaxPGL); 514 else 515 Gl = std::min<uint64_t>(Rs1 ^ Rs2_or_imm13, MaxGL); 516 }}); 517 //0x11-0x1F should cause an illegal instruction exception 518 } 519 0x33: decode RD { 520 0x00: HPriv::wrhprhpstate({{Hpstate = Rs1 ^ Rs2_or_imm13;}}); |
521 0x01: HPriv::wrhprhtstate( 522 {{Htstate = Rs1 ^ Rs2_or_imm13;}}, checkTl=true); |
523 //0x02 should cause an illegal instruction exception 524 0x03: HPriv::wrhprhintp({{Hintp = Rs1 ^ Rs2_or_imm13;}}); 525 //0x04 should cause an illegal instruction exception 526 0x05: HPriv::wrhprhtba({{Htba = Rs1 ^ Rs2_or_imm13;}}); 527 //0x06-0x01D should cause an illegal instruction exception 528 0x1F: HPriv::wrhprhstick_cmpr({{HstickCmpr = Rs1 ^ Rs2_or_imm13;}}); 529 } 530 0x34: decode OPF{ --- 555 unchanged lines hidden (view full) --- 1086 Cwp = (Cwp - 1 + NWindows) % NWindows; 1087 Rd_prev = Rs1 + Rs2_or_imm13; 1088 Cansave = Cansave + 1; 1089 Canrestore = Canrestore - 1; 1090 } 1091 }}); 1092 0x3E: decode FCN { 1093 0x0: Priv::done({{ |
1094 Cwp = Tstate<4:0>; 1095 Pstate = Tstate<20:8>; 1096 Asi = Tstate<31:24>; 1097 Ccr = Tstate<39:32>; 1098 Gl = Tstate<42:40>; 1099 Hpstate = Htstate; 1100 NPC = Tnpc; 1101 NNPC = Tnpc + 4; 1102 Tl = Tl - 1; |
1103 }}, checkTl=true); |
1104 0x1: Priv::retry({{ |
1105 Cwp = Tstate<4:0>; 1106 Pstate = Tstate<20:8>; 1107 Asi = Tstate<31:24>; 1108 Ccr = Tstate<39:32>; 1109 Gl = Tstate<42:40>; 1110 Hpstate = Htstate; 1111 NPC = Tpc; 1112 NNPC = Tnpc; 1113 Tl = Tl - 1; |
1114 }}, checkTl=true); |
1115 } 1116 } 1117 } 1118 0x3: decode OP3 { 1119 format Load { 1120 0x00: lduw({{Rd = Mem.uw;}}); 1121 0x01: ldub({{Rd = Mem.ub;}}); 1122 0x02: lduh({{Rd = Mem.uhw;}}); --- 349 unchanged lines hidden --- |