OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC_CONSTANTS_PPC_H_ | 5 #ifndef V8_PPC_CONSTANTS_PPC_H_ |
6 #define V8_PPC_CONSTANTS_PPC_H_ | 6 #define V8_PPC_CONSTANTS_PPC_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "src/base/logging.h" | 10 #include "src/base/logging.h" |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 /* Vector Load Half Word into Half Word Odd Signed and Splat */ \ | 548 /* Vector Load Half Word into Half Word Odd Signed and Splat */ \ |
549 V(evlhhossplat, EVLHHOSSPLAT, 0x1000030F) \ | 549 V(evlhhossplat, EVLHHOSSPLAT, 0x1000030F) \ |
550 /* Vector Load Half Word into Half Word Odd Signed and Splat Indexed */ \ | 550 /* Vector Load Half Word into Half Word Odd Signed and Splat Indexed */ \ |
551 V(evlhhossplatx, EVLHHOSSPLATX, 0x1000030E) \ | 551 V(evlhhossplatx, EVLHHOSSPLATX, 0x1000030E) \ |
552 /* Vector Load Half Word into Half Word Odd Unsigned and Splat */ \ | 552 /* Vector Load Half Word into Half Word Odd Unsigned and Splat */ \ |
553 V(evlhhousplat, EVLHHOUSPLAT, 0x1000030D) \ | 553 V(evlhhousplat, EVLHHOUSPLAT, 0x1000030D) \ |
554 /* Vector Load Half Word into Half Word Odd Unsigned and Splat Indexed */ \ | 554 /* Vector Load Half Word into Half Word Odd Unsigned and Splat Indexed */ \ |
555 V(evlhhousplatx, EVLHHOUSPLATX, 0x1000030C) \ | 555 V(evlhhousplatx, EVLHHOUSPLATX, 0x1000030C) \ |
556 /* Vector Load Word into Two Half Words Even */ \ | 556 /* Vector Load Word into Two Half Words Even */ \ |
557 V(evlwhe, EVLWHE, 0x10000311) \ | 557 V(evlwhe, EVLWHE, 0x10000311) \ |
558 /* Vector Load Word into Two Half Words Even Indexed */ \ | |
559 V(evlwhex, EVLWHEX, 0x10000310) \ | |
560 /* Vector Load Word into Two Half Words Odd Signed (with sign extension) */ \ | 558 /* Vector Load Word into Two Half Words Odd Signed (with sign extension) */ \ |
561 V(evlwhos, EVLWHOS, 0x10000317) \ | 559 V(evlwhos, EVLWHOS, 0x10000317) \ |
562 /* Vector Load Word into Two Half Words Odd Signed Indexed (with sign */ \ | 560 /* Vector Load Word into Two Half Words Odd Signed Indexed (with sign */ \ |
563 /* extension) */ \ | 561 /* extension) */ \ |
564 V(evlwhosx, EVLWHOSX, 0x10000316) \ | 562 V(evlwhosx, EVLWHOSX, 0x10000316) \ |
565 /* Vector Load Word into Two Half Words Odd Unsigned (zero-extended) */ \ | 563 /* Vector Load Word into Two Half Words Odd Unsigned (zero-extended) */ \ |
566 V(evlwhou, EVLWHOU, 0x10000315) \ | 564 V(evlwhou, EVLWHOU, 0x10000315) \ |
567 /* Vector Load Word into Two Half Words Odd Unsigned Indexed (zero- */ \ | 565 /* Vector Load Word into Two Half Words Odd Unsigned Indexed (zero- */ \ |
568 /* extended) */ \ | 566 /* extended) */ \ |
569 V(evlwhoux, EVLWHOUX, 0x10000314) \ | 567 V(evlwhoux, EVLWHOUX, 0x10000314) \ |
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1325 /* Store Halfword with Decoration Indexed */ \ | 1323 /* Store Halfword with Decoration Indexed */ \ |
1326 V(sthdx, STHDX, 0x7C000546) \ | 1324 V(sthdx, STHDX, 0x7C000546) \ |
1327 /* Store Word with Decoration Indexed */ \ | 1325 /* Store Word with Decoration Indexed */ \ |
1328 V(stwdx, STWDX, 0x7C000586) \ | 1326 V(stwdx, STWDX, 0x7C000586) \ |
1329 /* Data Cache Block Allocate */ \ | 1327 /* Data Cache Block Allocate */ \ |
1330 V(dcba, DCBA, 0x7C0005EC) \ | 1328 V(dcba, DCBA, 0x7C0005EC) \ |
1331 /* Data Cache Block Invalidate */ \ | 1329 /* Data Cache Block Invalidate */ \ |
1332 V(dcbi, DCBI, 0x7C0003AC) \ | 1330 V(dcbi, DCBI, 0x7C0003AC) \ |
1333 /* Instruction Cache Block Touch */ \ | 1331 /* Instruction Cache Block Touch */ \ |
1334 V(icbt, ICBT, 0x7C00002C) \ | 1332 V(icbt, ICBT, 0x7C00002C) \ |
1335 /* Memory Barrier */ \ | |
1336 V(mbar, MBAR, 0x7C0006AC) \ | |
1337 /* Move to Condition Register from XER */ \ | 1333 /* Move to Condition Register from XER */ \ |
1338 V(mcrxr, MCRXR, 0x7C000400) \ | 1334 V(mcrxr, MCRXR, 0x7C000400) \ |
1339 /* TLB Invalidate Local Indexed */ \ | 1335 /* TLB Invalidate Local Indexed */ \ |
1340 V(tlbilx, TLBILX, 0x7C000024) \ | 1336 V(tlbilx, TLBILX, 0x7C000024) \ |
1341 /* TLB Invalidate Virtual Address Indexed */ \ | 1337 /* TLB Invalidate Virtual Address Indexed */ \ |
1342 V(tlbivax, TLBIVAX, 0x7C000624) \ | 1338 V(tlbivax, TLBIVAX, 0x7C000624) \ |
1343 /* TLB Read Entry */ \ | 1339 /* TLB Read Entry */ \ |
1344 V(tlbre, TLBRE, 0x7C000764) \ | 1340 V(tlbre, TLBRE, 0x7C000764) \ |
1345 /* TLB Search Indexed */ \ | 1341 /* TLB Search Indexed */ \ |
1346 V(tlbsx, TLBSX, 0x7C000724) \ | 1342 V(tlbsx, TLBSX, 0x7C000724) \ |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1677 V(std, STD, 0xF8000000) \ | 1673 V(std, STD, 0xF8000000) \ |
1678 /* Store Doubleword with Update */ \ | 1674 /* Store Doubleword with Update */ \ |
1679 V(stdu, STDU, 0xF8000001) \ | 1675 V(stdu, STDU, 0xF8000001) \ |
1680 /* Load Floating-Point Double Pair */ \ | 1676 /* Load Floating-Point Double Pair */ \ |
1681 V(lfdp, LFDP, 0xE4000000) \ | 1677 V(lfdp, LFDP, 0xE4000000) \ |
1682 /* Store Floating-Point Double Pair */ \ | 1678 /* Store Floating-Point Double Pair */ \ |
1683 V(stfdp, STFDP, 0xF4000000) \ | 1679 V(stfdp, STFDP, 0xF4000000) \ |
1684 /* Store Quadword */ \ | 1680 /* Store Quadword */ \ |
1685 V(stq, STQ, 0xF8000002) | 1681 V(stq, STQ, 0xF8000002) |
1686 | 1682 |
| 1683 #define PPC_DQ_OPCODE_LIST(V) \ |
| 1684 V(lsq, LSQ, 0xE0000000) |
| 1685 |
1687 #define PPC_D_OPCODE_LIST(V) \ | 1686 #define PPC_D_OPCODE_LIST(V) \ |
1688 /* Trap Doubleword Immediate */ \ | 1687 /* Trap Doubleword Immediate */ \ |
1689 V(tdi, TDI, 0x08000000) \ | 1688 V(tdi, TDI, 0x08000000) \ |
1690 /* Add Immediate */ \ | 1689 /* Add Immediate */ \ |
1691 V(addi, ADDI, 0x38000000) \ | 1690 V(addi, ADDI, 0x38000000) \ |
1692 /* Add Immediate Carrying */ \ | 1691 /* Add Immediate Carrying */ \ |
1693 V(addic, ADDIC, 0x30000000) \ | 1692 V(addic, ADDIC, 0x30000000) \ |
1694 /* Add Immediate Carrying & record CR0 */ \ | 1693 /* Add Immediate Carrying & record CR0 */ \ |
1695 V(addicx, ADDICx, 0x34000000) \ | 1694 V(addicx, ADDICx, 0x34000000) \ |
1696 /* Add Immediate Shifted */ \ | 1695 /* Add Immediate Shifted */ \ |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2018 /* Subtract From & record OV */ \ | 2017 /* Subtract From & record OV */ \ |
2019 V(subfo, SUBFO, 0x7C000450) \ | 2018 V(subfo, SUBFO, 0x7C000450) \ |
2020 /* Subtract From Zero Extended */ \ | 2019 /* Subtract From Zero Extended */ \ |
2021 V(subfze, SUBFZE, 0x7C000190) \ | 2020 V(subfze, SUBFZE, 0x7C000190) \ |
2022 /* Subtract From Zero Extended & record OV */ \ | 2021 /* Subtract From Zero Extended & record OV */ \ |
2023 V(subfzeo, SUBFZEO, 0x7C000590) \ | 2022 V(subfzeo, SUBFZEO, 0x7C000590) \ |
2024 /* Add and Generate Sixes */ \ | 2023 /* Add and Generate Sixes */ \ |
2025 V(addg, ADDG, 0x7C000094) \ | 2024 V(addg, ADDG, 0x7C000094) \ |
2026 /* Multiply Accumulate Cross Halfword to Word Modulo Signed */ \ | 2025 /* Multiply Accumulate Cross Halfword to Word Modulo Signed */ \ |
2027 V(macchw, MACCHW, 0x10000158) \ | 2026 V(macchw, MACCHW, 0x10000158) \ |
2028 /* Multiply Accumulate Cross Halfword to Word Modulo Signed & record OV */ \ | |
2029 V(macchwo, MACCHWO, 0x10000158) \ | |
2030 /* Multiply Accumulate Cross Halfword to Word Saturate Signed */ \ | 2027 /* Multiply Accumulate Cross Halfword to Word Saturate Signed */ \ |
2031 V(macchws, MACCHWS, 0x100001D8) \ | 2028 V(macchws, MACCHWS, 0x100001D8) \ |
2032 /* Multiply Accumulate Cross Halfword to Word Saturate Signed & record */ \ | |
2033 /* OV */ \ | |
2034 V(macchwso, MACCHWSO, 0x100001D8) \ | |
2035 /* Multiply Accumulate Cross Halfword to Word Saturate Unsigned */ \ | 2029 /* Multiply Accumulate Cross Halfword to Word Saturate Unsigned */ \ |
2036 V(macchwsu, MACCHWSU, 0x10000198) \ | 2030 V(macchwsu, MACCHWSU, 0x10000198) \ |
2037 /* Multiply Accumulate Cross Halfword to Word Saturate Unsigned & record */ \ | |
2038 /* OV */ \ | |
2039 V(macchwsuo, MACCHWSUO, 0x10000198) \ | |
2040 /* Multiply Accumulate Cross Halfword to Word Modulo Unsigned */ \ | 2031 /* Multiply Accumulate Cross Halfword to Word Modulo Unsigned */ \ |
2041 V(macchwu, MACCHWU, 0x10000118) \ | 2032 V(macchwu, MACCHWU, 0x10000118) \ |
2042 /* Multiply Accumulate Cross Halfword to Word Modulo Unsigned & record */ \ | |
2043 /* OV */ \ | |
2044 V(macchwuo, MACCHWUO, 0x10000118) \ | |
2045 /* Multiply Accumulate High Halfword to Word Modulo Signed */ \ | 2033 /* Multiply Accumulate High Halfword to Word Modulo Signed */ \ |
2046 V(machhw, MACHHW, 0x10000058) \ | 2034 V(machhw, MACHHW, 0x10000058) \ |
2047 /* Multiply Accumulate High Halfword to Word Modulo Signed & record OV */ \ | |
2048 V(machhwo, MACHHWO, 0x10000058) \ | |
2049 /* Multiply Accumulate High Halfword to Word Saturate Signed */ \ | 2035 /* Multiply Accumulate High Halfword to Word Saturate Signed */ \ |
2050 V(machhws, MACHHWS, 0x100000D8) \ | 2036 V(machhws, MACHHWS, 0x100000D8) \ |
2051 /* Multiply Accumulate High Halfword to Word Saturate Signed & record OV */ \ | |
2052 V(machhwso, MACHHWSO, 0x100000D8) \ | |
2053 /* Multiply Accumulate High Halfword to Word Saturate Unsigned */ \ | 2037 /* Multiply Accumulate High Halfword to Word Saturate Unsigned */ \ |
2054 V(machhwsu, MACHHWSU, 0x10000098) \ | 2038 V(machhwsu, MACHHWSU, 0x10000098) \ |
2055 /* Multiply Accumulate High Halfword to Word Saturate Unsigned & record */ \ | |
2056 /* OV */ \ | |
2057 V(machhwsuo, MACHHWSUO, 0x10000098) \ | |
2058 /* Multiply Accumulate High Halfword to Word Modulo Unsigned */ \ | 2039 /* Multiply Accumulate High Halfword to Word Modulo Unsigned */ \ |
2059 V(machhwu, MACHHWU, 0x10000018) \ | 2040 V(machhwu, MACHHWU, 0x10000018) \ |
2060 /* Multiply Accumulate High Halfword to Word Modulo Unsigned & record OV */ \ | |
2061 V(machhwuo, MACHHWUO, 0x10000018) \ | |
2062 /* Multiply Accumulate Low Halfword to Word Modulo Signed */ \ | 2041 /* Multiply Accumulate Low Halfword to Word Modulo Signed */ \ |
2063 V(maclhw, MACLHW, 0x10000358) \ | 2042 V(maclhw, MACLHW, 0x10000358) \ |
2064 /* Multiply Accumulate Low Halfword to Word Modulo Signed & record OV */ \ | |
2065 V(maclhwo, MACLHWO, 0x10000358) \ | |
2066 /* Multiply Accumulate Low Halfword to Word Saturate Signed */ \ | 2043 /* Multiply Accumulate Low Halfword to Word Saturate Signed */ \ |
2067 V(maclhws, MACLHWS, 0x100003D8) \ | 2044 V(maclhws, MACLHWS, 0x100003D8) \ |
2068 /* Multiply Accumulate Low Halfword to Word Saturate Signed & record OV */ \ | |
2069 V(maclhwso, MACLHWSO, 0x100003D8) \ | |
2070 /* Multiply Accumulate Low Halfword to Word Saturate Unsigned */ \ | 2045 /* Multiply Accumulate Low Halfword to Word Saturate Unsigned */ \ |
2071 V(maclhwsu, MACLHWSU, 0x10000398) \ | 2046 V(maclhwsu, MACLHWSU, 0x10000398) \ |
2072 /* Multiply Accumulate Low Halfword to Word Saturate Unsigned & record */ \ | |
2073 /* OV */ \ | |
2074 V(maclhwsuo, MACLHWSUO, 0x10000398) \ | |
2075 /* Multiply Accumulate Low Halfword to Word Modulo Unsigned */ \ | 2047 /* Multiply Accumulate Low Halfword to Word Modulo Unsigned */ \ |
2076 V(maclhwu, MACLHWU, 0x10000318) \ | 2048 V(maclhwu, MACLHWU, 0x10000318) \ |
2077 /* Multiply Accumulate Low Halfword to Word Modulo Unsigned & record OV */ \ | |
2078 V(maclhwuo, MACLHWUO, 0x10000318) \ | |
2079 /* Negative Multiply Accumulate Cross Halfword to Word Modulo Signed */ \ | 2049 /* Negative Multiply Accumulate Cross Halfword to Word Modulo Signed */ \ |
2080 V(nmacchw, NMACCHW, 0x1000015C) \ | 2050 V(nmacchw, NMACCHW, 0x1000015C) \ |
2081 /* Negative Multiply Accumulate Cross Halfword to Word Modulo Signed & */ \ | |
2082 /* record OV */ \ | |
2083 V(nmacchwo, NMACCHWO, 0x1000015C) \ | |
2084 /* Negative Multiply Accumulate Cross Halfword to Word Saturate Signed */ \ | 2051 /* Negative Multiply Accumulate Cross Halfword to Word Saturate Signed */ \ |
2085 V(nmacchws, NMACCHWS, 0x100001DC) \ | 2052 V(nmacchws, NMACCHWS, 0x100001DC) \ |
2086 /* Negative Multiply Accumulate Cross Halfword to Word Saturate Signed & */ \ | |
2087 /* record OV */ \ | |
2088 V(nmacchwso, NMACCHWSO, 0x100001DC) \ | |
2089 /* Negative Multiply Accumulate High Halfword to Word Modulo Signed */ \ | 2053 /* Negative Multiply Accumulate High Halfword to Word Modulo Signed */ \ |
2090 V(nmachhw, NMACHHW, 0x1000005C) \ | 2054 V(nmachhw, NMACHHW, 0x1000005C) \ |
2091 /* Negative Multiply Accumulate High Halfword to Word Modulo Signed & */ \ | |
2092 /* record OV */ \ | |
2093 V(nmachhwo, NMACHHWO, 0x1000005C) \ | |
2094 /* Negative Multiply Accumulate High Halfword to Word Saturate Signed */ \ | 2055 /* Negative Multiply Accumulate High Halfword to Word Saturate Signed */ \ |
2095 V(nmachhws, NMACHHWS, 0x100000DC) \ | 2056 V(nmachhws, NMACHHWS, 0x100000DC) \ |
2096 /* Negative Multiply Accumulate High Halfword to Word Saturate Signed & */ \ | |
2097 /* record OV */ \ | |
2098 V(nmachhwso, NMACHHWSO, 0x100000DC) \ | |
2099 /* Negative Multiply Accumulate Low Halfword to Word Modulo Signed */ \ | 2057 /* Negative Multiply Accumulate Low Halfword to Word Modulo Signed */ \ |
2100 V(nmaclhw, NMACLHW, 0x1000035C) \ | 2058 V(nmaclhw, NMACLHW, 0x1000035C) \ |
2101 /* Negative Multiply Accumulate Low Halfword to Word Modulo Signed & */ \ | |
2102 /* record OV */ \ | |
2103 V(nmaclhwo, NMACLHWO, 0x1000035C) \ | |
2104 /* Negative Multiply Accumulate Low Halfword to Word Saturate Signed */ \ | 2059 /* Negative Multiply Accumulate Low Halfword to Word Saturate Signed */ \ |
2105 V(nmaclhws, NMACLHWS, 0x100003DC) \ | 2060 V(nmaclhws, NMACLHWS, 0x100003DC) \ |
2106 /* Negative Multiply Accumulate Low Halfword to Word Saturate Signed & */ \ | |
2107 /* record OV */ \ | |
2108 V(nmaclhwso, NMACLHWSO, 0x100003DC) | |
2109 | 2061 |
2110 #define PPC_XL_OPCODE_LIST(V) \ | 2062 #define PPC_XL_OPCODE_LIST(V) \ |
2111 /* Branch Conditional to Count Register */ \ | 2063 /* Branch Conditional to Count Register */ \ |
2112 V(bcctr, BCCTRX, 0x4C000420) \ | 2064 V(bcctr, BCCTRX, 0x4C000420) \ |
2113 /* Branch Conditional to Link Register */ \ | 2065 /* Branch Conditional to Link Register */ \ |
2114 V(bclr, BCLRX, 0x4C000020) \ | 2066 V(bclr, BCLRX, 0x4C000020) \ |
2115 /* Condition Register AND */ \ | 2067 /* Condition Register AND */ \ |
2116 V(crand, CRAND, 0x4C000202) \ | 2068 V(crand, CRAND, 0x4C000202) \ |
2117 /* Condition Register AND with Complement */ \ | 2069 /* Condition Register AND with Complement */ \ |
2118 V(crandc, CRANDC, 0x4C000102) \ | 2070 V(crandc, CRANDC, 0x4C000102) \ |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2531 | 2483 |
2532 #define PPC_SC_OPCODE_LIST(V) \ | 2484 #define PPC_SC_OPCODE_LIST(V) \ |
2533 /* System Call */ \ | 2485 /* System Call */ \ |
2534 V(sc, SC, 0x44000002) | 2486 V(sc, SC, 0x44000002) |
2535 | 2487 |
2536 | 2488 |
2537 #define PPC_OPCODE_LIST(V) \ | 2489 #define PPC_OPCODE_LIST(V) \ |
2538 PPC_X_OPCODE_LIST(V) \ | 2490 PPC_X_OPCODE_LIST(V) \ |
2539 PPC_XO_OPCODE_LIST(V) \ | 2491 PPC_XO_OPCODE_LIST(V) \ |
2540 PPC_DS_OPCODE_LIST(V) \ | 2492 PPC_DS_OPCODE_LIST(V) \ |
| 2493 PPC_DQ_OPCODE_LIST(V) \ |
2541 PPC_MDS_OPCODE_LIST(V) \ | 2494 PPC_MDS_OPCODE_LIST(V) \ |
2542 PPC_MD_OPCODE_LIST(V) \ | 2495 PPC_MD_OPCODE_LIST(V) \ |
2543 PPC_XS_OPCODE_LIST(V) \ | 2496 PPC_XS_OPCODE_LIST(V) \ |
2544 PPC_D_OPCODE_LIST(V) \ | 2497 PPC_D_OPCODE_LIST(V) \ |
2545 PPC_I_OPCODE_LIST(V) \ | 2498 PPC_I_OPCODE_LIST(V) \ |
2546 PPC_B_OPCODE_LIST(V) \ | 2499 PPC_B_OPCODE_LIST(V) \ |
2547 PPC_XL_OPCODE_LIST(V) \ | 2500 PPC_XL_OPCODE_LIST(V) \ |
2548 PPC_A_OPCODE_LIST(V) \ | 2501 PPC_A_OPCODE_LIST(V) \ |
2549 PPC_XFX_OPCODE_LIST(V) \ | 2502 PPC_XFX_OPCODE_LIST(V) \ |
2550 PPC_M_OPCODE_LIST(V) \ | 2503 PPC_M_OPCODE_LIST(V) \ |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2810 inline int RSValue() const { return Bits(25, 21); } | 2763 inline int RSValue() const { return Bits(25, 21); } |
2811 inline int RTValue() const { return Bits(25, 21); } | 2764 inline int RTValue() const { return Bits(25, 21); } |
2812 inline int RAValue() const { return Bits(20, 16); } | 2765 inline int RAValue() const { return Bits(20, 16); } |
2813 DECLARE_STATIC_ACCESSOR(RAValue); | 2766 DECLARE_STATIC_ACCESSOR(RAValue); |
2814 inline int RBValue() const { return Bits(15, 11); } | 2767 inline int RBValue() const { return Bits(15, 11); } |
2815 DECLARE_STATIC_ACCESSOR(RBValue); | 2768 DECLARE_STATIC_ACCESSOR(RBValue); |
2816 inline int RCValue() const { return Bits(10, 6); } | 2769 inline int RCValue() const { return Bits(10, 6); } |
2817 DECLARE_STATIC_ACCESSOR(RCValue); | 2770 DECLARE_STATIC_ACCESSOR(RCValue); |
2818 | 2771 |
2819 inline int OpcodeValue() const { return static_cast<Opcode>(Bits(31, 26)); } | 2772 inline int OpcodeValue() const { return static_cast<Opcode>(Bits(31, 26)); } |
2820 inline Opcode OpcodeField() const { | 2773 inline uint32_t OpcodeField() const { |
2821 return static_cast<Opcode>(BitField(31, 26)); | 2774 return static_cast<Opcode>(BitField(31, 26)); |
2822 } | 2775 } |
2823 | 2776 |
| 2777 #define OPCODE_CASES(name, opcode_name, opcode_value) \ |
| 2778 case opcode_name: |
| 2779 |
| 2780 inline Opcode OpcodeBase() const { |
| 2781 uint32_t opcode = OpcodeField(); |
| 2782 uint32_t extcode = OpcodeField(); |
| 2783 switch (opcode) { |
| 2784 PPC_D_OPCODE_LIST(OPCODE_CASES) |
| 2785 PPC_I_OPCODE_LIST(OPCODE_CASES) |
| 2786 PPC_B_OPCODE_LIST(OPCODE_CASES) |
| 2787 PPC_M_OPCODE_LIST(OPCODE_CASES) |
| 2788 return static_cast<Opcode>(opcode); |
| 2789 } |
| 2790 |
| 2791 opcode = extcode | BitField(10, 0); |
| 2792 switch (opcode) { |
| 2793 PPC_VX_OPCODE_LIST(OPCODE_CASES) |
| 2794 return static_cast<Opcode>(opcode); |
| 2795 } |
| 2796 opcode = extcode | BitField(9, 0); |
| 2797 switch (opcode) { |
| 2798 PPC_VC_OPCODE_LIST(OPCODE_CASES) |
| 2799 return static_cast<Opcode>(opcode); |
| 2800 } |
| 2801 opcode = extcode | BitField(10, 1) | BitField(20, 20); |
| 2802 switch (opcode) { |
| 2803 PPC_XFX_OPCODE_LIST(OPCODE_CASES) |
| 2804 return static_cast<Opcode>(opcode); |
| 2805 } |
| 2806 opcode = extcode | BitField(10, 1); |
| 2807 switch (opcode) { |
| 2808 PPC_X_OPCODE_LIST(OPCODE_CASES) |
| 2809 PPC_XL_OPCODE_LIST(OPCODE_CASES) |
| 2810 PPC_XFL_OPCODE_LIST(OPCODE_CASES) |
| 2811 PPC_XX1_OPCODE_LIST(OPCODE_CASES) |
| 2812 PPC_XX2_OPCODE_LIST(OPCODE_CASES) |
| 2813 PPC_EVX_OPCODE_LIST(OPCODE_CASES) |
| 2814 return static_cast<Opcode>(opcode); |
| 2815 } |
| 2816 opcode = extcode | BitField(9, 1); |
| 2817 switch (opcode) { |
| 2818 PPC_XO_OPCODE_LIST(OPCODE_CASES) |
| 2819 PPC_Z22_OPCODE_LIST(OPCODE_CASES) |
| 2820 return static_cast<Opcode>(opcode); |
| 2821 } |
| 2822 opcode = extcode | BitField(10, 2); |
| 2823 switch (opcode) { |
| 2824 PPC_XS_OPCODE_LIST(OPCODE_CASES) |
| 2825 return static_cast<Opcode>(opcode); |
| 2826 } |
| 2827 opcode = extcode | BitField(10, 3); |
| 2828 switch (opcode) { |
| 2829 PPC_EVS_OPCODE_LIST(OPCODE_CASES) |
| 2830 PPC_XX3_OPCODE_LIST(OPCODE_CASES) |
| 2831 return static_cast<Opcode>(opcode); |
| 2832 } |
| 2833 opcode = extcode | BitField(8, 1); |
| 2834 switch (opcode) { |
| 2835 PPC_Z23_OPCODE_LIST(OPCODE_CASES) |
| 2836 return static_cast<Opcode>(opcode); |
| 2837 } |
| 2838 opcode = extcode | BitField(5, 0); |
| 2839 switch (opcode) { |
| 2840 PPC_VA_OPCODE_LIST(OPCODE_CASES) |
| 2841 return static_cast<Opcode>(opcode); |
| 2842 } |
| 2843 opcode = extcode | BitField(5, 1); |
| 2844 switch (opcode) { |
| 2845 PPC_A_OPCODE_LIST(OPCODE_CASES) |
| 2846 return static_cast<Opcode>(opcode); |
| 2847 } |
| 2848 opcode = extcode | BitField(4, 1); |
| 2849 switch (opcode) { |
| 2850 PPC_MDS_OPCODE_LIST(OPCODE_CASES) |
| 2851 return static_cast<Opcode>(opcode); |
| 2852 } |
| 2853 opcode = extcode | BitField(4, 2); |
| 2854 switch (opcode) { |
| 2855 PPC_MD_OPCODE_LIST(OPCODE_CASES) |
| 2856 return static_cast<Opcode>(opcode); |
| 2857 } |
| 2858 opcode = extcode | BitField(5, 4); |
| 2859 switch (opcode) { |
| 2860 PPC_XX4_OPCODE_LIST(OPCODE_CASES) |
| 2861 return static_cast<Opcode>(opcode); |
| 2862 } |
| 2863 opcode = extcode | BitField(2, 0); |
| 2864 switch (opcode) { |
| 2865 PPC_DQ_OPCODE_LIST(OPCODE_CASES) |
| 2866 return static_cast<Opcode>(opcode); |
| 2867 } |
| 2868 opcode = extcode | BitField(1, 0); |
| 2869 switch (opcode) { |
| 2870 PPC_DS_OPCODE_LIST(OPCODE_CASES) |
| 2871 return static_cast<Opcode>(opcode); |
| 2872 } |
| 2873 opcode = extcode | BitField(1, 1); |
| 2874 switch (opcode) { |
| 2875 PPC_SC_OPCODE_LIST(OPCODE_CASES) |
| 2876 return static_cast<Opcode>(opcode); |
| 2877 } |
| 2878 printf("opcode = %x\n", InstructionBits()); |
| 2879 UNIMPLEMENTED(); |
| 2880 return static_cast<Opcode>(0); |
| 2881 } |
| 2882 |
| 2883 #undef OPCODE_CASES |
| 2884 |
2824 // Fields used in Software interrupt instructions | 2885 // Fields used in Software interrupt instructions |
2825 inline SoftwareInterruptCodes SvcValue() const { | 2886 inline SoftwareInterruptCodes SvcValue() const { |
2826 return static_cast<SoftwareInterruptCodes>(Bits(23, 0)); | 2887 return static_cast<SoftwareInterruptCodes>(Bits(23, 0)); |
2827 } | 2888 } |
2828 | 2889 |
2829 // Instructions are read of out a code stream. The only way to get a | 2890 // Instructions are read of out a code stream. The only way to get a |
2830 // reference to an instruction is to convert a pointer. There is no way | 2891 // reference to an instruction is to convert a pointer. There is no way |
2831 // to allocate or create instances of class Instruction. | 2892 // to allocate or create instances of class Instruction. |
2832 // Use the At(pc) function to create references to Instruction. | 2893 // Use the At(pc) function to create references to Instruction. |
2833 static Instruction* At(byte* pc) { | 2894 static Instruction* At(byte* pc) { |
(...skipping 23 matching lines...) Expand all Loading... |
2857 // Lookup the register number for the name provided. | 2918 // Lookup the register number for the name provided. |
2858 static int Number(const char* name); | 2919 static int Number(const char* name); |
2859 | 2920 |
2860 private: | 2921 private: |
2861 static const char* names_[kNumDoubleRegisters]; | 2922 static const char* names_[kNumDoubleRegisters]; |
2862 }; | 2923 }; |
2863 } // namespace internal | 2924 } // namespace internal |
2864 } // namespace v8 | 2925 } // namespace v8 |
2865 | 2926 |
2866 #endif // V8_PPC_CONSTANTS_PPC_H_ | 2927 #endif // V8_PPC_CONSTANTS_PPC_H_ |
OLD | NEW |