| 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 "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
| 8 | 8 |
| 9 #include "constants-mips.h" | 9 #include "constants-mips.h" |
| 10 | 10 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 return true; | 144 return true; |
| 145 case REGIMM: | 145 case REGIMM: |
| 146 switch (RtFieldRaw()) { | 146 switch (RtFieldRaw()) { |
| 147 case BLTZ: | 147 case BLTZ: |
| 148 case BGEZ: | 148 case BGEZ: |
| 149 case BLTZAL: | 149 case BLTZAL: |
| 150 case BGEZAL: | 150 case BGEZAL: |
| 151 return true; | 151 return true; |
| 152 default: | 152 default: |
| 153 return false; | 153 return false; |
| 154 }; | 154 } |
| 155 break; | 155 break; |
| 156 case SPECIAL: | 156 case SPECIAL: |
| 157 switch (FunctionFieldRaw()) { | 157 switch (FunctionFieldRaw()) { |
| 158 case JR: | 158 case JR: |
| 159 case JALR: | 159 case JALR: |
| 160 return true; | 160 return true; |
| 161 default: | 161 default: |
| 162 return false; | 162 return false; |
| 163 }; | 163 } |
| 164 break; | 164 break; |
| 165 default: | 165 default: |
| 166 return false; | 166 return false; |
| 167 }; | 167 } |
| 168 } | 168 } |
| 169 | 169 |
| 170 | 170 |
| 171 bool Instruction::IsLinkingInstruction() const { | 171 bool Instruction::IsLinkingInstruction() const { |
| 172 const int op = OpcodeFieldRaw(); | 172 const int op = OpcodeFieldRaw(); |
| 173 switch (op) { | 173 switch (op) { |
| 174 case JAL: | 174 case JAL: |
| 175 return true; | 175 return true; |
| 176 case REGIMM: | 176 case REGIMM: |
| 177 switch (RtFieldRaw()) { | 177 switch (RtFieldRaw()) { |
| 178 case BGEZAL: | 178 case BGEZAL: |
| 179 case BLTZAL: | 179 case BLTZAL: |
| 180 return true; | 180 return true; |
| 181 default: | 181 default: |
| 182 return false; | 182 return false; |
| 183 }; | 183 } |
| 184 case SPECIAL: | 184 case SPECIAL: |
| 185 switch (FunctionFieldRaw()) { | 185 switch (FunctionFieldRaw()) { |
| 186 case JALR: | 186 case JALR: |
| 187 return true; | 187 return true; |
| 188 default: | 188 default: |
| 189 return false; | 189 return false; |
| 190 }; | 190 } |
| 191 default: | 191 default: |
| 192 return false; | 192 return false; |
| 193 }; | 193 } |
| 194 } | 194 } |
| 195 | 195 |
| 196 | 196 |
| 197 bool Instruction::IsTrap() const { | 197 bool Instruction::IsTrap() const { |
| 198 if (OpcodeFieldRaw() != SPECIAL) { | 198 if (OpcodeFieldRaw() != SPECIAL) { |
| 199 return false; | 199 return false; |
| 200 } else { | 200 } else { |
| 201 switch (FunctionFieldRaw()) { | 201 switch (FunctionFieldRaw()) { |
| 202 case BREAK: | 202 case BREAK: |
| 203 case TGE: | 203 case TGE: |
| 204 case TGEU: | 204 case TGEU: |
| 205 case TLT: | 205 case TLT: |
| 206 case TLTU: | 206 case TLTU: |
| 207 case TEQ: | 207 case TEQ: |
| 208 case TNE: | 208 case TNE: |
| 209 return true; | 209 return true; |
| 210 default: | 210 default: |
| 211 return false; | 211 return false; |
| 212 }; | 212 } |
| 213 } | 213 } |
| 214 } | 214 } |
| 215 | 215 |
| 216 | 216 |
| 217 Instruction::Type Instruction::InstructionType() const { | 217 Instruction::Type Instruction::InstructionType() const { |
| 218 switch (OpcodeFieldRaw()) { | 218 switch (OpcodeFieldRaw()) { |
| 219 case SPECIAL: | 219 case SPECIAL: |
| 220 switch (FunctionFieldRaw()) { | 220 switch (FunctionFieldRaw()) { |
| 221 case JR: | 221 case JR: |
| 222 case JALR: | 222 case JALR: |
| (...skipping 25 matching lines...) Expand all Loading... |
| 248 case TLT: | 248 case TLT: |
| 249 case TLTU: | 249 case TLTU: |
| 250 case TEQ: | 250 case TEQ: |
| 251 case TNE: | 251 case TNE: |
| 252 case MOVZ: | 252 case MOVZ: |
| 253 case MOVN: | 253 case MOVN: |
| 254 case MOVCI: | 254 case MOVCI: |
| 255 return kRegisterType; | 255 return kRegisterType; |
| 256 default: | 256 default: |
| 257 return kUnsupported; | 257 return kUnsupported; |
| 258 }; | 258 } |
| 259 break; | 259 break; |
| 260 case SPECIAL2: | 260 case SPECIAL2: |
| 261 switch (FunctionFieldRaw()) { | 261 switch (FunctionFieldRaw()) { |
| 262 case MUL: | 262 case MUL: |
| 263 case CLZ: | 263 case CLZ: |
| 264 return kRegisterType; | 264 return kRegisterType; |
| 265 default: | 265 default: |
| 266 return kUnsupported; | 266 return kUnsupported; |
| 267 }; | 267 } |
| 268 break; | 268 break; |
| 269 case SPECIAL3: | 269 case SPECIAL3: |
| 270 switch (FunctionFieldRaw()) { | 270 switch (FunctionFieldRaw()) { |
| 271 case INS: | 271 case INS: |
| 272 case EXT: | 272 case EXT: |
| 273 return kRegisterType; | 273 return kRegisterType; |
| 274 default: | 274 default: |
| 275 return kUnsupported; | 275 return kUnsupported; |
| 276 }; | 276 } |
| 277 break; | 277 break; |
| 278 case COP1: // Coprocessor instructions. | 278 case COP1: // Coprocessor instructions. |
| 279 switch (RsFieldRawNoAssert()) { | 279 switch (RsFieldRawNoAssert()) { |
| 280 case BC1: // Branch on coprocessor condition. | 280 case BC1: // Branch on coprocessor condition. |
| 281 return kImmediateType; | 281 return kImmediateType; |
| 282 default: | 282 default: |
| 283 return kRegisterType; | 283 return kRegisterType; |
| 284 }; | 284 } |
| 285 break; | 285 break; |
| 286 case COP1X: | 286 case COP1X: |
| 287 return kRegisterType; | 287 return kRegisterType; |
| 288 // 16 bits Immediate type instructions. e.g.: addi dest, src, imm16. | 288 // 16 bits Immediate type instructions. e.g.: addi dest, src, imm16. |
| 289 case REGIMM: | 289 case REGIMM: |
| 290 case BEQ: | 290 case BEQ: |
| 291 case BNE: | 291 case BNE: |
| 292 case BLEZ: | 292 case BLEZ: |
| 293 case BGTZ: | 293 case BGTZ: |
| 294 case ADDI: | 294 case ADDI: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 319 case LDC1: | 319 case LDC1: |
| 320 case SWC1: | 320 case SWC1: |
| 321 case SDC1: | 321 case SDC1: |
| 322 return kImmediateType; | 322 return kImmediateType; |
| 323 // 26 bits immediate type instructions. e.g.: j imm26. | 323 // 26 bits immediate type instructions. e.g.: j imm26. |
| 324 case J: | 324 case J: |
| 325 case JAL: | 325 case JAL: |
| 326 return kJumpType; | 326 return kJumpType; |
| 327 default: | 327 default: |
| 328 return kUnsupported; | 328 return kUnsupported; |
| 329 }; | 329 } |
| 330 return kUnsupported; | 330 return kUnsupported; |
| 331 } | 331 } |
| 332 | 332 |
| 333 | 333 |
| 334 } } // namespace v8::internal | 334 } } // namespace v8::internal |
| 335 | 335 |
| 336 #endif // V8_TARGET_ARCH_MIPS | 336 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |