decoder.isa (3998:593cc702b366) | decoder.isa (4004:d551cf1bba0d) |
---|---|
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 --- 48 unchanged lines hidden (view full) --- 57 } 58 //Branch Never 59 0x0: decode A 60 { 61 0x0: bpn(19, {{ 62 NNPC = NNPC;//Don't do anything 63 }}); 64 0x1: bpn(19, {{ | 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 --- 48 unchanged lines hidden (view full) --- 57 } 58 //Branch Never 59 0x0: decode A 60 { 61 0x0: bpn(19, {{ 62 NNPC = NNPC;//Don't do anything 63 }}); 64 0x1: bpn(19, {{ |
65 NPC = xc->readNextPC() + 4; 66 NNPC = NPC + 4; | 65 NNPC = NPC + 8; 66 NPC = NPC + 4; |
67 }}, ',a'); 68 } 69 default: decode BPCC 70 { 71 0x0: bpcci(19, {{ 72 if(passesCondition(Ccr<3:0>, COND2)) 73 NNPC = xc->readPC() + disp; 74 else 75 handle_annul 76 }}); 77 0x2: bpccx(19, {{ 78 if(passesCondition(Ccr<7:4>, COND2)) | 67 }}, ',a'); 68 } 69 default: decode BPCC 70 { 71 0x0: bpcci(19, {{ 72 if(passesCondition(Ccr<3:0>, COND2)) 73 NNPC = xc->readPC() + disp; 74 else 75 handle_annul 76 }}); 77 0x2: bpccx(19, {{ 78 if(passesCondition(Ccr<7:4>, COND2)) |
79 { 80 //warn("Took branch!\n"); | |
81 NNPC = xc->readPC() + disp; | 79 NNPC = xc->readPC() + disp; |
82 } | |
83 else | 80 else |
84 { 85 //warn("Didn't take branch!\n"); | |
86 handle_annul | 81 handle_annul |
87 } | |
88 }}); 89 } 90 } 91 //bicc 92 0x2: decode COND2 93 { 94 //Branch Always 95 0x8: decode A --- 8 unchanged lines hidden (view full) --- 104 } 105 //Branch Never 106 0x0: decode A 107 { 108 0x0: bn(22, {{ 109 NNPC = NNPC;//Don't do anything 110 }}); 111 0x1: bn(22, {{ | 82 }}); 83 } 84 } 85 //bicc 86 0x2: decode COND2 87 { 88 //Branch Always 89 0x8: decode A --- 8 unchanged lines hidden (view full) --- 98 } 99 //Branch Never 100 0x0: decode A 101 { 102 0x0: bn(22, {{ 103 NNPC = NNPC;//Don't do anything 104 }}); 105 0x1: bn(22, {{ |
112 NPC = xc->readNextPC() + 4; 113 NNPC = NPC + 4; | 106 NNPC = NPC + 8; 107 NPC = NPC + 4; |
114 }}, ',a'); 115 } 116 default: bicc(22, {{ 117 if(passesCondition(Ccr<3:0>, COND2)) 118 NNPC = xc->readPC() + disp; 119 else 120 handle_annul 121 }}); --- 38 unchanged lines hidden (view full) --- 160 NNPC = xc->readPC() + disp; 161 else 162 handle_annul 163 }}); 164 } 165 } 166 //SETHI (or NOP if rd == 0 and imm == 0) 167 0x4: SetHi::sethi({{Rd.udw = imm;}}); | 108 }}, ',a'); 109 } 110 default: bicc(22, {{ 111 if(passesCondition(Ccr<3:0>, COND2)) 112 NNPC = xc->readPC() + disp; 113 else 114 handle_annul 115 }}); --- 38 unchanged lines hidden (view full) --- 154 NNPC = xc->readPC() + disp; 155 else 156 handle_annul 157 }}); 158 } 159 } 160 //SETHI (or NOP if rd == 0 and imm == 0) 161 0x4: SetHi::sethi({{Rd.udw = imm;}}); |
168 0x5: FailUnimpl::fbpfcc(); 169 0x6: FailUnimpl::fbfcc(); | 162 //fbpfcc 163 0x5: decode COND2 { 164 format BranchN { 165 //Branch Always 166 0x8: decode A 167 { 168 0x0: fbpa(22, {{ 169 NNPC = xc->readPC() + disp; 170 }}); 171 0x1: fbpa(22, {{ 172 NPC = xc->readPC() + disp; 173 NNPC = NPC + 4; 174 }}, ',a'); 175 } 176 //Branch Never 177 0x0: decode A 178 { 179 0x0: fbpn(22, {{ 180 NNPC = NNPC;//Don't do anything 181 }}); 182 0x1: fbpn(22, {{ 183 NNPC = NPC + 8; 184 NPC = NPC + 4; 185 }}, ',a'); 186 } 187 default: decode BPCC { 188 0x0: fbpcc0(22, {{ 189 if(passesFpCondition(Fsr<11:10>, COND2)) 190 NNPC = xc->readPC() + disp; 191 else 192 handle_annul 193 }}); 194 0x1: fbpcc1(22, {{ 195 if(passesFpCondition(Fsr<33:32>, COND2)) 196 NNPC = xc->readPC() + disp; 197 else 198 handle_annul 199 }}); 200 0x2: fbpcc2(22, {{ 201 if(passesFpCondition(Fsr<35:34>, COND2)) 202 NNPC = xc->readPC() + disp; 203 else 204 handle_annul 205 }}); 206 0x3: fbpcc3(22, {{ 207 if(passesFpCondition(Fsr<37:36>, COND2)) 208 NNPC = xc->readPC() + disp; 209 else 210 handle_annul 211 }}); 212 } 213 } 214 } 215 //fbfcc 216 0x6: decode COND2 { 217 format BranchN { 218 //Branch Always 219 0x8: decode A 220 { 221 0x0: fba(22, {{ 222 NNPC = xc->readPC() + disp; 223 }}); 224 0x1: fba(22, {{ 225 NPC = xc->readPC() + disp; 226 NNPC = NPC + 4; 227 }}, ',a'); 228 } 229 //Branch Never 230 0x0: decode A 231 { 232 0x0: fbn(22, {{ 233 NNPC = NNPC;//Don't do anything 234 }}); 235 0x1: fbn(22, {{ 236 NNPC = NPC + 8; 237 NPC = NPC + 4; 238 }}, ',a'); 239 } 240 default: fbfcc(22, {{ 241 if(passesFpCondition(Fsr<11:10>, COND2)) 242 NNPC = xc->readPC() + disp; 243 else 244 handle_annul 245 }}); 246 } 247 } |
170 } 171 0x1: BranchN::call(30, {{ 172 if (Pstate<3:>) 173 R15 = (xc->readPC())<31:0>; 174 else 175 R15 = xc->readPC(); 176 NNPC = R15 + disp; 177 }}); --- 584 unchanged lines hidden (view full) --- 762 else 763 fcc = 0; 764 uint8_t firstbit = 10; 765 if(FCMPCC) 766 firstbit = FCMPCC * 2 + 30; 767 Fsr = insertBits(Fsr, firstbit +1, firstbit, fcc); 768 }}); 769 0x53: FpUnimpl::fcmpq(); | 248 } 249 0x1: BranchN::call(30, {{ 250 if (Pstate<3:>) 251 R15 = (xc->readPC())<31:0>; 252 else 253 R15 = xc->readPC(); 254 NNPC = R15 + disp; 255 }}); --- 584 unchanged lines hidden (view full) --- 840 else 841 fcc = 0; 842 uint8_t firstbit = 10; 843 if(FCMPCC) 844 firstbit = FCMPCC * 2 + 30; 845 Fsr = insertBits(Fsr, firstbit +1, firstbit, fcc); 846 }}); 847 0x53: FpUnimpl::fcmpq(); |
770 0x55: fcmpes({{ | 848 0x54: fcmpes({{ |
771 uint8_t fcc = 0; 772 if(isnan(Frs1s) || isnan(Frs2s)) 773 fault = new FpExceptionIEEE754; 774 if(Frs1s < Frs2s) 775 fcc = 1; 776 else if(Frs1s > Frs2s) 777 fcc = 2; 778 uint8_t firstbit = 10; 779 if(FCMPCC) 780 firstbit = FCMPCC * 2 + 30; 781 Fsr = insertBits(Fsr, firstbit +1, firstbit, fcc); 782 }}); | 849 uint8_t fcc = 0; 850 if(isnan(Frs1s) || isnan(Frs2s)) 851 fault = new FpExceptionIEEE754; 852 if(Frs1s < Frs2s) 853 fcc = 1; 854 else if(Frs1s > Frs2s) 855 fcc = 2; 856 uint8_t firstbit = 10; 857 if(FCMPCC) 858 firstbit = FCMPCC * 2 + 30; 859 Fsr = insertBits(Fsr, firstbit +1, firstbit, fcc); 860 }}); |
783 0x56: fcmped({{ | 861 0x55: fcmped({{ |
784 uint8_t fcc = 0; 785 if(isnan(Frs1s) || isnan(Frs2s)) 786 fault = new FpExceptionIEEE754; 787 if(Frs1s < Frs2s) 788 fcc = 1; 789 else if(Frs1s > Frs2s) 790 fcc = 2; 791 uint8_t firstbit = 10; 792 if(FCMPCC) 793 firstbit = FCMPCC * 2 + 30; 794 Fsr = insertBits(Fsr, firstbit +1, firstbit, fcc); 795 }}); | 862 uint8_t fcc = 0; 863 if(isnan(Frs1s) || isnan(Frs2s)) 864 fault = new FpExceptionIEEE754; 865 if(Frs1s < Frs2s) 866 fcc = 1; 867 else if(Frs1s > Frs2s) 868 fcc = 2; 869 uint8_t firstbit = 10; 870 if(FCMPCC) 871 firstbit = FCMPCC * 2 + 30; 872 Fsr = insertBits(Fsr, firstbit +1, firstbit, fcc); 873 }}); |
796 0x57: FpUnimpl::fcmpeq(); | 874 0x56: FpUnimpl::fcmpeq(); |
797 default: FailUnimpl::fpop2(); 798 } 799 } 800 //This used to be just impdep1, but now it's a whole bunch 801 //of instructions 802 0x36: decode OPF{ 803 0x00: FailUnimpl::edge8(); 804 0x01: FailUnimpl::edge8n(); --- 554 unchanged lines hidden --- | 875 default: FailUnimpl::fpop2(); 876 } 877 } 878 //This used to be just impdep1, but now it's a whole bunch 879 //of instructions 880 0x36: decode OPF{ 881 0x00: FailUnimpl::edge8(); 882 0x01: FailUnimpl::edge8n(); --- 554 unchanged lines hidden --- |