1// Copyright (c) 2006 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

--- 411 unchanged lines hidden (view full) ---

420 0x5: movrne({{Rd = (Rs1.sdw != 0) ? Rs2_or_imm10 : Rd;}});
421 0x6: movrg({{Rd = (Rs1.sdw > 0) ? Rs2_or_imm10 : Rd;}});
422 0x7: movrge({{Rd = (Rs1.sdw >= 0) ? Rs2_or_imm10 : Rd;}});
423 }
424 0x30: wrasr({{
425 xc->setMiscRegWithEffect(RD + AsrStart, Rs1 ^ Rs2_or_imm13);
426 }});
427 0x31: decode FCN {
428 0x0: BasicOperate::saved({{/*Boogy Boogy*/}});
429 0x1: BasicOperate::restored({{/*Boogy Boogy*/}});
428 0x0: Priv::saved({{
429 assert(Cansave < NWindows - 2);
430 assert(Otherwin || Canrestore);
431 Cansave = Cansave + 1;
432 if(Otherwin == 0)
433 Canrestore = Canrestore - 1;
434 else
435 Otherwin = Otherwin - 1;
436 }});
437 0x1: BasicOperate::restored({{
438 assert(Cansave || Otherwin);
439 assert(Canrestore < NWindows - 2);
440 Canrestore = Canrestore + 1;
441 if(Otherwin == 0)
442 Cansave = Cansave - 1;
443 else
444 Otherwin = Otherwin - 1;
445 }});
446 }
447 0x32: Priv::wrpr({{
448 // XXX Need to protect with format that traps non-priv
449 // access
450 fault = xc->setMiscRegWithEffect(RD + PrStart, Rs1 ^ Rs2_or_imm13);
451 }});
452 0x33: HPriv::wrhpr({{
453 // XXX Need to protect with format that traps non-priv/priv

--- 241 unchanged lines hidden (view full) ---

695 //which one should be returned.
696 Addr target = Rs1 + Rs2_or_imm13;
697 if(target & 0x3)
698 fault = new MemAddressNotAligned;
699 else
700 NNPC = target;
701 if(fault == NoFault)
702 {
687 //CWP should be set directly so that it always happens
688 //Also, this will allow writing to the new window and
689 //reading from the old one
690 Cwp = (Cwp - 1 + NWindows) % NWindows;
703 if(Canrestore == 0)
704 {
705 if(Otherwin)
706 fault = new FillNOther(Wstate<5:3>);
707 else
708 fault = new FillNNormal(Wstate<2:0>);
709 }
710 else
711 {
700 Rd = Rs1 + Rs2_or_imm13;
712 //CWP should be set directly so that it always happens
713 //Also, this will allow writing to the new window and
714 //reading from the old one
715 Cwp = (Cwp - 1 + NWindows) % NWindows;
716 Cansave = Cansave + 1;
717 Canrestore = Canrestore - 1;
718 //This is here to make sure the CWP is written
719 //no matter what. This ensures that the results
720 //are written in the new window as well.
721 xc->setMiscRegWithEffect(MISCREG_CWP, Cwp);
722 warn("About to set the CWP to %d\n", Cwp);
723 }
704 //This is here to make sure the CWP is written
705 //no matter what. This ensures that the results
706 //are written in the new window as well.
707 xc->setMiscRegWithEffect(MISCREG_CWP, Cwp);
724 }
725 }});
726 0x3A: decode CC
727 {
728 0x0: Trap::tcci({{
729 if(passesCondition(Ccr<3:0>, COND2))
730 {
731#if FULL_SYSTEM

--- 26 unchanged lines hidden (view full) ---

758 //Also, this will allow writing to the new window and
759 //reading from the old one
760 if(Cansave == 0)
761 {
762 if(Otherwin)
763 fault = new SpillNOther(Wstate<5:3>);
764 else
765 fault = new SpillNNormal(Wstate<2:0>);
750 Cwp = (Cwp + 2) % NWindows;
766 //Cwp = (Cwp + 2) % NWindows;
767 }
768 else if(Cleanwin - Canrestore == 0)
769 {
754 Cwp = (Cwp + 1) % NWindows;
770 //Cwp = (Cwp + 1) % NWindows;
771 fault = new CleanWindow;
772 }
773 else
774 {
775 Cwp = (Cwp + 1) % NWindows;
776 Rd = Rs1 + Rs2_or_imm13;
777 Cansave = Cansave - 1;
778 Canrestore = Canrestore + 1;
779 //This is here to make sure the CWP is written
780 //no matter what. This ensures that the results
781 //are written in the new window as well.
782 xc->setMiscRegWithEffect(MISCREG_CWP, Cwp);
783 }
764 //This is here to make sure the CWP is written
765 //no matter what. This ensures that the results
766 //are written in the new window as well.
767 xc->setMiscRegWithEffect(MISCREG_CWP, Cwp);
784 }});
785 0x3D: restore({{
770 //CWP should be set directly so that it always happens
771 //Also, this will allow writing to the new window and
772 //reading from the old one
773 Cwp = (Cwp - 1 + NWindows) % NWindows;
786 if(Canrestore == 0)
787 {
788 if(Otherwin)
789 fault = new FillNOther(Wstate<5:3>);
790 else
791 fault = new FillNNormal(Wstate<2:0>);
792 }
793 else
794 {
795 //CWP should be set directly so that it always happens
796 //Also, this will allow writing to the new window and
797 //reading from the old one
798 Cwp = (Cwp - 1 + NWindows) % NWindows;
799 Rd = Rs1 + Rs2_or_imm13;
800 Cansave = Cansave + 1;
801 Canrestore = Canrestore - 1;
802 //This is here to make sure the CWP is written
803 //no matter what. This ensures that the results
804 //are written in the new window as well.
805 xc->setMiscRegWithEffect(MISCREG_CWP, Cwp);
806 }
787 //This is here to make sure the CWP is written
788 //no matter what. This ensures that the results
789 //are written in the new window as well.
790 xc->setMiscRegWithEffect(MISCREG_CWP, Cwp);
807 }});
808 0x3E: decode FCN {
809 0x0: Priv::done({{
810 if(Tl == 0)
811 return new IllegalInstruction;
812
813 Cwp = Tstate<4:0>;
814 Pstate = Tstate<20:8>;

--- 8 unchanged lines hidden (view full) ---

823 if(Tl == 0)
824 return new IllegalInstruction;
825 Cwp = Tstate<4:0>;
826 Pstate = Tstate<20:8>;
827 Asi = Tstate<31:24>;
828 Ccr = Tstate<39:32>;
829 Gl = Tstate<42:40>;
830 NPC = Tpc;
815 NNPC = Tnpc + 4;
831 NNPC = Tnpc;
832 Tl = Tl - 1;
833 }});
834 }
835 }
836 }
837 0x3: decode OP3 {
838 format Load {
839 0x00: lduw({{Rd = Mem.uw;}});

--- 257 unchanged lines hidden ---