OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef V8_MIPS_CONSTANTS_H_ | 5 #ifndef V8_MIPS_CONSTANTS_H_ |
6 #define V8_MIPS_CONSTANTS_H_ | 6 #define V8_MIPS_CONSTANTS_H_ |
7 | 7 |
8 #include "src/base/logging.h" | 8 #include "src/base/logging.h" |
9 #include "src/base/macros.h" | 9 #include "src/base/macros.h" |
10 #include "src/globals.h" | 10 #include "src/globals.h" |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 JR = ((1 << 3) + 0), | 387 JR = ((1 << 3) + 0), |
388 JALR = ((1 << 3) + 1), | 388 JALR = ((1 << 3) + 1), |
389 MOVZ = ((1 << 3) + 2), | 389 MOVZ = ((1 << 3) + 2), |
390 MOVN = ((1 << 3) + 3), | 390 MOVN = ((1 << 3) + 3), |
391 BREAK = ((1 << 3) + 5), | 391 BREAK = ((1 << 3) + 5), |
392 | 392 |
393 MFHI = ((2 << 3) + 0), | 393 MFHI = ((2 << 3) + 0), |
394 CLZ_R6 = ((2 << 3) + 0), | 394 CLZ_R6 = ((2 << 3) + 0), |
395 CLO_R6 = ((2 << 3) + 1), | 395 CLO_R6 = ((2 << 3) + 1), |
396 MFLO = ((2 << 3) + 2), | 396 MFLO = ((2 << 3) + 2), |
| 397 DCLZ_R6 = ((2 << 3) + 2), |
| 398 DCLO_R6 = ((2 << 3) + 3), |
397 DSLLV = ((2 << 3) + 4), | 399 DSLLV = ((2 << 3) + 4), |
398 DSRLV = ((2 << 3) + 6), | 400 DSRLV = ((2 << 3) + 6), |
399 DSRAV = ((2 << 3) + 7), | 401 DSRAV = ((2 << 3) + 7), |
400 | 402 |
401 MULT = ((3 << 3) + 0), | 403 MULT = ((3 << 3) + 0), |
402 MULTU = ((3 << 3) + 1), | 404 MULTU = ((3 << 3) + 1), |
403 DIV = ((3 << 3) + 2), | 405 DIV = ((3 << 3) + 2), |
404 DIVU = ((3 << 3) + 3), | 406 DIVU = ((3 << 3) + 3), |
405 DMULT = ((3 << 3) + 4), | 407 DMULT = ((3 << 3) + 4), |
406 DMULTU = ((3 << 3) + 5), | 408 DMULTU = ((3 << 3) + 5), |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 DIV_MOD_U = ((3 << 3) + 3), | 457 DIV_MOD_U = ((3 << 3) + 3), |
456 D_DIV_MOD = ((3 << 3) + 6), | 458 D_DIV_MOD = ((3 << 3) + 6), |
457 D_DIV_MOD_U = ((3 << 3) + 7), | 459 D_DIV_MOD_U = ((3 << 3) + 7), |
458 | 460 |
459 // drotr in special4? | 461 // drotr in special4? |
460 | 462 |
461 // SPECIAL2 Encoding of Function Field. | 463 // SPECIAL2 Encoding of Function Field. |
462 MUL = ((0 << 3) + 2), | 464 MUL = ((0 << 3) + 2), |
463 CLZ = ((4 << 3) + 0), | 465 CLZ = ((4 << 3) + 0), |
464 CLO = ((4 << 3) + 1), | 466 CLO = ((4 << 3) + 1), |
| 467 DCLZ = ((4 << 3) + 4), |
| 468 DCLO = ((4 << 3) + 5), |
465 | 469 |
466 // SPECIAL3 Encoding of Function Field. | 470 // SPECIAL3 Encoding of Function Field. |
467 EXT = ((0 << 3) + 0), | 471 EXT = ((0 << 3) + 0), |
468 DEXTM = ((0 << 3) + 1), | 472 DEXTM = ((0 << 3) + 1), |
469 DEXTU = ((0 << 3) + 2), | 473 DEXTU = ((0 << 3) + 2), |
470 DEXT = ((0 << 3) + 3), | 474 DEXT = ((0 << 3) + 3), |
471 INS = ((0 << 3) + 4), | 475 INS = ((0 << 3) + 4), |
472 DINSM = ((0 << 3) + 5), | 476 DINSM = ((0 << 3) + 5), |
473 DINSU = ((0 << 3) + 6), | 477 DINSU = ((0 << 3) + 6), |
474 DINS = ((0 << 3) + 7), | 478 DINS = ((0 << 3) + 7), |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 OpcodeToBitNumber(LD) | OpcodeToBitNumber(LBU) | OpcodeToBitNumber(LHU) | | 924 OpcodeToBitNumber(LD) | OpcodeToBitNumber(LBU) | OpcodeToBitNumber(LHU) | |
921 OpcodeToBitNumber(LWR) | OpcodeToBitNumber(SB) | OpcodeToBitNumber(SH) | | 925 OpcodeToBitNumber(LWR) | OpcodeToBitNumber(SB) | OpcodeToBitNumber(SH) | |
922 OpcodeToBitNumber(SWL) | OpcodeToBitNumber(SW) | OpcodeToBitNumber(SD) | | 926 OpcodeToBitNumber(SWL) | OpcodeToBitNumber(SW) | OpcodeToBitNumber(SD) | |
923 OpcodeToBitNumber(SWR) | OpcodeToBitNumber(LWC1) | | 927 OpcodeToBitNumber(SWR) | OpcodeToBitNumber(LWC1) | |
924 OpcodeToBitNumber(LDC1) | OpcodeToBitNumber(SWC1) | | 928 OpcodeToBitNumber(LDC1) | OpcodeToBitNumber(SWC1) | |
925 OpcodeToBitNumber(SDC1) | OpcodeToBitNumber(PCREL) | | 929 OpcodeToBitNumber(SDC1) | OpcodeToBitNumber(PCREL) | |
926 OpcodeToBitNumber(BC) | OpcodeToBitNumber(BALC); | 930 OpcodeToBitNumber(BC) | OpcodeToBitNumber(BALC); |
927 | 931 |
928 #define FunctionFieldToBitNumber(function) (1ULL << function) | 932 #define FunctionFieldToBitNumber(function) (1ULL << function) |
929 | 933 |
| 934 // On r6, DCLZ_R6 aliases to existing MFLO. |
930 static const uint64_t kFunctionFieldRegisterTypeMask = | 935 static const uint64_t kFunctionFieldRegisterTypeMask = |
931 FunctionFieldToBitNumber(JR) | FunctionFieldToBitNumber(JALR) | | 936 FunctionFieldToBitNumber(JR) | FunctionFieldToBitNumber(JALR) | |
932 FunctionFieldToBitNumber(BREAK) | FunctionFieldToBitNumber(SLL) | | 937 FunctionFieldToBitNumber(BREAK) | FunctionFieldToBitNumber(SLL) | |
933 FunctionFieldToBitNumber(DSLL) | FunctionFieldToBitNumber(DSLL32) | | 938 FunctionFieldToBitNumber(DSLL) | FunctionFieldToBitNumber(DSLL32) | |
934 FunctionFieldToBitNumber(SRL) | FunctionFieldToBitNumber(DSRL) | | 939 FunctionFieldToBitNumber(SRL) | FunctionFieldToBitNumber(DSRL) | |
935 FunctionFieldToBitNumber(DSRL32) | FunctionFieldToBitNumber(SRA) | | 940 FunctionFieldToBitNumber(DSRL32) | FunctionFieldToBitNumber(SRA) | |
936 FunctionFieldToBitNumber(DSRA) | FunctionFieldToBitNumber(DSRA32) | | 941 FunctionFieldToBitNumber(DSRA) | FunctionFieldToBitNumber(DSRA32) | |
937 FunctionFieldToBitNumber(SLLV) | FunctionFieldToBitNumber(DSLLV) | | 942 FunctionFieldToBitNumber(SLLV) | FunctionFieldToBitNumber(DSLLV) | |
938 FunctionFieldToBitNumber(SRLV) | FunctionFieldToBitNumber(DSRLV) | | 943 FunctionFieldToBitNumber(SRLV) | FunctionFieldToBitNumber(DSRLV) | |
939 FunctionFieldToBitNumber(SRAV) | FunctionFieldToBitNumber(DSRAV) | | 944 FunctionFieldToBitNumber(SRAV) | FunctionFieldToBitNumber(DSRAV) | |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 return kUnsupported; | 1169 return kUnsupported; |
1165 } | 1170 } |
1166 } else { | 1171 } else { |
1167 return kRegisterType; | 1172 return kRegisterType; |
1168 } | 1173 } |
1169 break; | 1174 break; |
1170 case SPECIAL2: | 1175 case SPECIAL2: |
1171 switch (FunctionFieldRaw()) { | 1176 switch (FunctionFieldRaw()) { |
1172 case MUL: | 1177 case MUL: |
1173 case CLZ: | 1178 case CLZ: |
| 1179 case DCLZ: |
1174 return kRegisterType; | 1180 return kRegisterType; |
1175 default: | 1181 default: |
1176 return kUnsupported; | 1182 return kUnsupported; |
1177 } | 1183 } |
1178 break; | 1184 break; |
1179 case SPECIAL3: | 1185 case SPECIAL3: |
1180 switch (FunctionFieldRaw()) { | 1186 switch (FunctionFieldRaw()) { |
1181 case INS: | 1187 case INS: |
1182 case EXT: | 1188 case EXT: |
1183 case DEXT: | 1189 case DEXT: |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 } | 1255 } |
1250 return kUnsupported; | 1256 return kUnsupported; |
1251 } | 1257 } |
1252 | 1258 |
1253 #undef OpcodeToBitNumber | 1259 #undef OpcodeToBitNumber |
1254 #undef FunctionFieldToBitNumber | 1260 #undef FunctionFieldToBitNumber |
1255 } // namespace internal | 1261 } // namespace internal |
1256 } // namespace v8 | 1262 } // namespace v8 |
1257 | 1263 |
1258 #endif // #ifndef V8_MIPS_CONSTANTS_H_ | 1264 #endif // #ifndef V8_MIPS_CONSTANTS_H_ |
OLD | NEW |