| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
| 8 | 8 |
| 9 #include "src/mips/constants-mips.h" | 9 #include "src/mips/constants-mips.h" |
| 10 | 10 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 case J: | 134 case J: |
| 135 case JAL: | 135 case JAL: |
| 136 case BEQ: | 136 case BEQ: |
| 137 case BNE: | 137 case BNE: |
| 138 case BLEZ: | 138 case BLEZ: |
| 139 case BGTZ: | 139 case BGTZ: |
| 140 case BEQL: | 140 case BEQL: |
| 141 case BNEL: | 141 case BNEL: |
| 142 case BLEZL: | 142 case BLEZL: |
| 143 case BGTZL: | 143 case BGTZL: |
| 144 case BC: |
| 145 case BALC: |
| 144 return true; | 146 return true; |
| 145 case REGIMM: | 147 case REGIMM: |
| 146 switch (RtFieldRaw()) { | 148 switch (RtFieldRaw()) { |
| 147 case BLTZ: | 149 case BLTZ: |
| 148 case BGEZ: | 150 case BGEZ: |
| 149 case BLTZAL: | 151 case BLTZAL: |
| 150 case BGEZAL: | 152 case BGEZAL: |
| 151 return true; | 153 return true; |
| 152 default: | 154 default: |
| 153 return false; | 155 return false; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 166 return false; | 168 return false; |
| 167 } | 169 } |
| 168 } | 170 } |
| 169 | 171 |
| 170 | 172 |
| 171 bool Instruction::IsLinkingInstruction() const { | 173 bool Instruction::IsLinkingInstruction() const { |
| 172 const int op = OpcodeFieldRaw(); | 174 const int op = OpcodeFieldRaw(); |
| 173 switch (op) { | 175 switch (op) { |
| 174 case JAL: | 176 case JAL: |
| 175 return true; | 177 return true; |
| 178 case POP76: |
| 179 if (RsFieldRawNoAssert() == JIALC) |
| 180 return true; // JIALC |
| 181 else |
| 182 return false; // BNEZC |
| 176 case REGIMM: | 183 case REGIMM: |
| 177 switch (RtFieldRaw()) { | 184 switch (RtFieldRaw()) { |
| 178 case BGEZAL: | 185 case BGEZAL: |
| 179 case BLTZAL: | 186 case BLTZAL: |
| 180 return true; | 187 return true; |
| 181 default: | 188 default: |
| 182 return false; | 189 return false; |
| 183 } | 190 } |
| 184 case SPECIAL: | 191 case SPECIAL: |
| 185 switch (FunctionFieldRaw()) { | 192 switch (FunctionFieldRaw()) { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 case CLZ: | 272 case CLZ: |
| 266 return kRegisterType; | 273 return kRegisterType; |
| 267 default: | 274 default: |
| 268 return kUnsupported; | 275 return kUnsupported; |
| 269 } | 276 } |
| 270 break; | 277 break; |
| 271 case SPECIAL3: | 278 case SPECIAL3: |
| 272 switch (FunctionFieldRaw()) { | 279 switch (FunctionFieldRaw()) { |
| 273 case INS: | 280 case INS: |
| 274 case EXT: | 281 case EXT: |
| 275 case BITSWAP: | |
| 276 return kRegisterType; | 282 return kRegisterType; |
| 283 case BSHFL: { |
| 284 int sa = SaFieldRaw() >> kSaShift; |
| 285 switch (sa) { |
| 286 case BITSWAP: |
| 287 return kRegisterType; |
| 288 case WSBH: |
| 289 case SEB: |
| 290 case SEH: |
| 291 return kUnsupported; |
| 292 } |
| 293 sa >>= kBp2Bits; |
| 294 switch (sa) { |
| 295 case ALIGN: |
| 296 return kRegisterType; |
| 297 default: |
| 298 return kUnsupported; |
| 299 } |
| 300 } |
| 277 default: | 301 default: |
| 278 return kUnsupported; | 302 return kUnsupported; |
| 279 } | 303 } |
| 280 break; | 304 break; |
| 281 case COP1: // Coprocessor instructions. | 305 case COP1: // Coprocessor instructions. |
| 282 switch (RsFieldRawNoAssert()) { | 306 switch (RsFieldRawNoAssert()) { |
| 283 case BC1: // Branch on coprocessor condition. | 307 case BC1: // Branch on coprocessor condition. |
| 284 case BC1EQZ: | 308 case BC1EQZ: |
| 285 case BC1NEZ: | 309 case BC1NEZ: |
| 286 return kImmediateType; | 310 return kImmediateType; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 302 case SLTI: | 326 case SLTI: |
| 303 case SLTIU: | 327 case SLTIU: |
| 304 case ANDI: | 328 case ANDI: |
| 305 case ORI: | 329 case ORI: |
| 306 case XORI: | 330 case XORI: |
| 307 case LUI: | 331 case LUI: |
| 308 case BEQL: | 332 case BEQL: |
| 309 case BNEL: | 333 case BNEL: |
| 310 case BLEZL: | 334 case BLEZL: |
| 311 case BGTZL: | 335 case BGTZL: |
| 312 case BEQZC: | 336 case POP66: |
| 313 case BNEZC: | 337 case POP76: |
| 314 case LB: | 338 case LB: |
| 315 case LH: | 339 case LH: |
| 316 case LWL: | 340 case LWL: |
| 317 case LW: | 341 case LW: |
| 318 case LBU: | 342 case LBU: |
| 319 case LHU: | 343 case LHU: |
| 320 case LWR: | 344 case LWR: |
| 321 case SB: | 345 case SB: |
| 322 case SH: | 346 case SH: |
| 323 case SWL: | 347 case SWL: |
| 324 case SW: | 348 case SW: |
| 325 case SWR: | 349 case SWR: |
| 326 case LWC1: | 350 case LWC1: |
| 327 case LDC1: | 351 case LDC1: |
| 328 case SWC1: | 352 case SWC1: |
| 329 case SDC1: | 353 case SDC1: |
| 354 case PCREL: |
| 355 case BC: |
| 356 case BALC: |
| 330 return kImmediateType; | 357 return kImmediateType; |
| 331 // 26 bits immediate type instructions. e.g.: j imm26. | 358 // 26 bits immediate type instructions. e.g.: j imm26. |
| 332 case J: | 359 case J: |
| 333 case JAL: | 360 case JAL: |
| 334 return kJumpType; | 361 return kJumpType; |
| 335 default: | 362 default: |
| 336 return kUnsupported; | 363 return kUnsupported; |
| 337 } | 364 } |
| 338 return kUnsupported; | 365 return kUnsupported; |
| 339 } | 366 } |
| 340 | 367 |
| 341 | 368 |
| 342 } // namespace internal | 369 } // namespace internal |
| 343 } // namespace v8 | 370 } // namespace v8 |
| 344 | 371 |
| 345 #endif // V8_TARGET_ARCH_MIPS | 372 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |