428,429c428,445
< 0x0: BasicOperate::saved({{/*Boogy Boogy*/}});
< 0x1: BasicOperate::restored({{/*Boogy Boogy*/}});
---
> 0x0: Priv::saved({{
> assert(Cansave < NWindows - 2);
> assert(Otherwin || Canrestore);
> Cansave = Cansave + 1;
> if(Otherwin == 0)
> Canrestore = Canrestore - 1;
> else
> Otherwin = Otherwin - 1;
> }});
> 0x1: BasicOperate::restored({{
> assert(Cansave || Otherwin);
> assert(Canrestore < NWindows - 2);
> Canrestore = Canrestore + 1;
> if(Otherwin == 0)
> Cansave = Cansave - 1;
> else
> Otherwin = Otherwin - 1;
> }});
687,690d702
< //CWP should be set directly so that it always happens
< //Also, this will allow writing to the new window and
< //reading from the old one
< Cwp = (Cwp - 1 + NWindows) % NWindows;
700c712,715
< Rd = Rs1 + Rs2_or_imm13;
---
> //CWP should be set directly so that it always happens
> //Also, this will allow writing to the new window and
> //reading from the old one
> Cwp = (Cwp - 1 + NWindows) % NWindows;
702a718,722
> //This is here to make sure the CWP is written
> //no matter what. This ensures that the results
> //are written in the new window as well.
> xc->setMiscRegWithEffect(MISCREG_CWP, Cwp);
> warn("About to set the CWP to %d\n", Cwp);
704,707d723
< //This is here to make sure the CWP is written
< //no matter what. This ensures that the results
< //are written in the new window as well.
< xc->setMiscRegWithEffect(MISCREG_CWP, Cwp);
750c766
< Cwp = (Cwp + 2) % NWindows;
---
> //Cwp = (Cwp + 2) % NWindows;
754c770
< Cwp = (Cwp + 1) % NWindows;
---
> //Cwp = (Cwp + 1) % NWindows;
762a779,782
> //This is here to make sure the CWP is written
> //no matter what. This ensures that the results
> //are written in the new window as well.
> xc->setMiscRegWithEffect(MISCREG_CWP, Cwp);
764,767d783
< //This is here to make sure the CWP is written
< //no matter what. This ensures that the results
< //are written in the new window as well.
< xc->setMiscRegWithEffect(MISCREG_CWP, Cwp);
770,773d785
< //CWP should be set directly so that it always happens
< //Also, this will allow writing to the new window and
< //reading from the old one
< Cwp = (Cwp - 1 + NWindows) % NWindows;
782a795,798
> //CWP should be set directly so that it always happens
> //Also, this will allow writing to the new window and
> //reading from the old one
> Cwp = (Cwp - 1 + NWindows) % NWindows;
785a802,805
> //This is here to make sure the CWP is written
> //no matter what. This ensures that the results
> //are written in the new window as well.
> xc->setMiscRegWithEffect(MISCREG_CWP, Cwp);
787,790d806
< //This is here to make sure the CWP is written
< //no matter what. This ensures that the results
< //are written in the new window as well.
< xc->setMiscRegWithEffect(MISCREG_CWP, Cwp);
815c831
< NNPC = Tnpc + 4;
---
> NNPC = Tnpc;