decoder.isa (3388:1c6ebfc4c20e) | decoder.isa (3417:41aab2d0319b) |
---|---|
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 { | 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 }}); |
430 } 431 0x32: Priv::wrpr({{ 432 // XXX Need to protect with format that traps non-priv 433 // access 434 fault = xc->setMiscRegWithEffect(RD + PrStart, Rs1 ^ Rs2_or_imm13); 435 }}); 436 0x33: HPriv::wrhpr({{ 437 // XXX Need to protect with format that traps non-priv/priv --- 241 unchanged lines hidden (view full) --- 679 //which one should be returned. 680 Addr target = Rs1 + Rs2_or_imm13; 681 if(target & 0x3) 682 fault = new MemAddressNotAligned; 683 else 684 NNPC = target; 685 if(fault == NoFault) 686 { | 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; | |
691 if(Canrestore == 0) 692 { 693 if(Otherwin) 694 fault = new FillNOther(Wstate<5:3>); 695 else 696 fault = new FillNNormal(Wstate<2:0>); 697 } 698 else 699 { | 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; |
701 Cansave = Cansave + 1; 702 Canrestore = Canrestore - 1; | 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); |
|
703 } | 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); | |
708 } 709 }}); 710 0x3A: decode CC 711 { 712 0x0: Trap::tcci({{ 713 if(passesCondition(Ccr<3:0>, COND2)) 714 { 715#if FULL_SYSTEM --- 26 unchanged lines hidden (view full) --- 742 //Also, this will allow writing to the new window and 743 //reading from the old one 744 if(Cansave == 0) 745 { 746 if(Otherwin) 747 fault = new SpillNOther(Wstate<5:3>); 748 else 749 fault = new SpillNNormal(Wstate<2:0>); | 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; |
751 } 752 else if(Cleanwin - Canrestore == 0) 753 { | 767 } 768 else if(Cleanwin - Canrestore == 0) 769 { |
754 Cwp = (Cwp + 1) % NWindows; | 770 //Cwp = (Cwp + 1) % NWindows; |
755 fault = new CleanWindow; 756 } 757 else 758 { 759 Cwp = (Cwp + 1) % NWindows; 760 Rd = Rs1 + Rs2_or_imm13; 761 Cansave = Cansave - 1; 762 Canrestore = Canrestore + 1; | 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); |
|
763 } | 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); | |
768 }}); 769 0x3D: restore({{ | 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; | |
774 if(Canrestore == 0) 775 { 776 if(Otherwin) 777 fault = new FillNOther(Wstate<5:3>); 778 else 779 fault = new FillNNormal(Wstate<2:0>); 780 } 781 else 782 { | 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; |
|
783 Rd = Rs1 + Rs2_or_imm13; 784 Cansave = Cansave + 1; 785 Canrestore = Canrestore - 1; | 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); |
|
786 } | 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); | |
791 }}); 792 0x3E: decode FCN { 793 0x0: Priv::done({{ 794 if(Tl == 0) 795 return new IllegalInstruction; 796 797 Cwp = Tstate<4:0>; 798 Pstate = Tstate<20:8>; --- 8 unchanged lines hidden (view full) --- 807 if(Tl == 0) 808 return new IllegalInstruction; 809 Cwp = Tstate<4:0>; 810 Pstate = Tstate<20:8>; 811 Asi = Tstate<31:24>; 812 Ccr = Tstate<39:32>; 813 Gl = Tstate<42:40>; 814 NPC = Tpc; | 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; |
816 Tl = Tl - 1; 817 }}); 818 } 819 } 820 } 821 0x3: decode OP3 { 822 format Load { 823 0x00: lduw({{Rd = Mem.uw;}}); --- 257 unchanged lines hidden --- | 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 --- |