| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64_DECODER_ARM64_H_ | 5 #ifndef V8_ARM64_DECODER_ARM64_H_ |
| 6 #define V8_ARM64_DECODER_ARM64_H_ | 6 #define V8_ARM64_DECODER_ARM64_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "src/arm64/instructions-arm64.h" | 10 #include "src/arm64/instructions-arm64.h" |
| 11 #include "src/globals.h" | 11 #include "src/globals.h" |
| 12 | 12 |
| 13 namespace v8 { | 13 namespace v8 { |
| 14 namespace internal { | 14 namespace internal { |
| 15 | 15 |
| 16 | 16 |
| 17 // List macro containing all visitors needed by the decoder class. | 17 // List macro containing all visitors needed by the decoder class. |
| 18 | 18 |
| 19 #define VISITOR_LIST(V) \ | 19 #define VISITOR_LIST(V) \ |
| 20 V(PCRelAddressing) \ | 20 V(PCRelAddressing) \ |
| 21 V(AddSubImmediate) \ | 21 V(AddSubImmediate) \ |
| 22 V(LogicalImmediate) \ | 22 V(LogicalImmediate) \ |
| 23 V(MoveWideImmediate) \ | 23 V(MoveWideImmediate) \ |
| 24 V(Bitfield) \ | 24 V(Bitfield) \ |
| 25 V(Extract) \ | 25 V(Extract) \ |
| 26 V(UnconditionalBranch) \ | 26 V(UnconditionalBranch) \ |
| 27 V(UnconditionalBranchToRegister) \ | 27 V(UnconditionalBranchToRegister) \ |
| 28 V(CompareBranch) \ | 28 V(CompareBranch) \ |
| 29 V(TestBranch) \ | 29 V(TestBranch) \ |
| 30 V(ConditionalBranch) \ | 30 V(ConditionalBranch) \ |
| 31 V(System) \ | 31 V(System) \ |
| 32 V(Exception) \ | 32 V(Exception) \ |
| 33 V(LoadStorePairPostIndex) \ | 33 V(LoadStorePairPostIndex) \ |
| 34 V(LoadStorePairOffset) \ | 34 V(LoadStorePairOffset) \ |
| 35 V(LoadStorePairPreIndex) \ | 35 V(LoadStorePairPreIndex) \ |
| 36 V(LoadLiteral) \ | 36 V(LoadLiteral) \ |
| 37 V(LoadStoreUnscaledOffset) \ | 37 V(LoadStoreUnscaledOffset) \ |
| 38 V(LoadStorePostIndex) \ | 38 V(LoadStorePostIndex) \ |
| 39 V(LoadStorePreIndex) \ | 39 V(LoadStorePreIndex) \ |
| 40 V(LoadStoreRegisterOffset) \ | 40 V(LoadStoreRegisterOffset) \ |
| 41 V(LoadStoreUnsignedOffset) \ | 41 V(LoadStoreUnsignedOffset) \ |
| 42 V(LoadStoreAcquireRelease) \ | 42 V(LoadStoreAcquireRelease) \ |
| 43 V(LogicalShifted) \ | 43 V(LogicalShifted) \ |
| 44 V(AddSubShifted) \ | 44 V(AddSubShifted) \ |
| 45 V(AddSubExtended) \ | 45 V(AddSubExtended) \ |
| 46 V(AddSubWithCarry) \ | 46 V(AddSubWithCarry) \ |
| 47 V(ConditionalCompareRegister) \ | 47 V(ConditionalCompareRegister) \ |
| 48 V(ConditionalCompareImmediate) \ | 48 V(ConditionalCompareImmediate) \ |
| 49 V(ConditionalSelect) \ | 49 V(ConditionalSelect) \ |
| 50 V(DataProcessing1Source) \ | 50 V(DataProcessing1Source) \ |
| 51 V(DataProcessing2Source) \ | 51 V(DataProcessing2Source) \ |
| 52 V(DataProcessing3Source) \ | 52 V(DataProcessing3Source) \ |
| 53 V(FPCompare) \ | 53 V(FPCompare) \ |
| 54 V(FPConditionalCompare) \ | 54 V(FPConditionalCompare) \ |
| 55 V(FPConditionalSelect) \ | 55 V(FPConditionalSelect) \ |
| 56 V(FPImmediate) \ | 56 V(FPImmediate) \ |
| 57 V(FPDataProcessing1Source) \ | 57 V(FPDataProcessing1Source) \ |
| 58 V(FPDataProcessing2Source) \ | 58 V(FPDataProcessing2Source) \ |
| 59 V(FPDataProcessing3Source) \ | 59 V(FPDataProcessing3Source) \ |
| 60 V(FPIntegerConvert) \ | 60 V(FPIntegerConvert) \ |
| 61 V(FPFixedPointConvert) \ | 61 V(FPFixedPointConvert) \ |
| 62 V(NEON2RegMisc) \ | 62 V(Unallocated) \ |
| 63 V(NEON3Different) \ | |
| 64 V(NEON3Same) \ | |
| 65 V(NEONAcrossLanes) \ | |
| 66 V(NEONByIndexedElement) \ | |
| 67 V(NEONCopy) \ | |
| 68 V(NEONExtract) \ | |
| 69 V(NEONLoadStoreMultiStruct) \ | |
| 70 V(NEONLoadStoreMultiStructPostIndex) \ | |
| 71 V(NEONLoadStoreSingleStruct) \ | |
| 72 V(NEONLoadStoreSingleStructPostIndex) \ | |
| 73 V(NEONModifiedImmediate) \ | |
| 74 V(NEONScalar2RegMisc) \ | |
| 75 V(NEONScalar3Diff) \ | |
| 76 V(NEONScalar3Same) \ | |
| 77 V(NEONScalarByIndexedElement) \ | |
| 78 V(NEONScalarCopy) \ | |
| 79 V(NEONScalarPairwise) \ | |
| 80 V(NEONScalarShiftImmediate) \ | |
| 81 V(NEONShiftImmediate) \ | |
| 82 V(NEONTable) \ | |
| 83 V(NEONPerm) \ | |
| 84 V(Unallocated) \ | |
| 85 V(Unimplemented) | 63 V(Unimplemented) |
| 86 | 64 |
| 87 // The Visitor interface. Disassembler and simulator (and other tools) | 65 // The Visitor interface. Disassembler and simulator (and other tools) |
| 88 // must provide implementations for all of these functions. | 66 // must provide implementations for all of these functions. |
| 89 class DecoderVisitor { | 67 class DecoderVisitor { |
| 90 public: | 68 public: |
| 91 virtual ~DecoderVisitor() {} | 69 virtual ~DecoderVisitor() {} |
| 92 | 70 |
| 93 #define DECLARE(A) virtual void Visit##A(Instruction* instr) = 0; | 71 #define DECLARE(A) virtual void Visit##A(Instruction* instr) = 0; |
| 94 VISITOR_LIST(DECLARE) | 72 VISITOR_LIST(DECLARE) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 124 void PrependVisitor(DecoderVisitor* visitor); | 102 void PrependVisitor(DecoderVisitor* visitor); |
| 125 void InsertVisitorBefore(DecoderVisitor* new_visitor, | 103 void InsertVisitorBefore(DecoderVisitor* new_visitor, |
| 126 DecoderVisitor* registered_visitor); | 104 DecoderVisitor* registered_visitor); |
| 127 void InsertVisitorAfter(DecoderVisitor* new_visitor, | 105 void InsertVisitorAfter(DecoderVisitor* new_visitor, |
| 128 DecoderVisitor* registered_visitor); | 106 DecoderVisitor* registered_visitor); |
| 129 | 107 |
| 130 // Remove a previously registered visitor class from the list of visitors | 108 // Remove a previously registered visitor class from the list of visitors |
| 131 // stored by the decoder. | 109 // stored by the decoder. |
| 132 void RemoveVisitor(DecoderVisitor* visitor); | 110 void RemoveVisitor(DecoderVisitor* visitor); |
| 133 | 111 |
| 134 void VisitNEONShiftImmediate(const Instruction* instr); | |
| 135 | |
| 136 #define DECLARE(A) void Visit##A(Instruction* instr); | 112 #define DECLARE(A) void Visit##A(Instruction* instr); |
| 137 VISITOR_LIST(DECLARE) | 113 VISITOR_LIST(DECLARE) |
| 138 #undef DECLARE | 114 #undef DECLARE |
| 139 | 115 |
| 140 private: | 116 private: |
| 141 // Visitors are registered in a list. | 117 // Visitors are registered in a list. |
| 142 std::list<DecoderVisitor*> visitors_; | 118 std::list<DecoderVisitor*> visitors_; |
| 143 }; | 119 }; |
| 144 | 120 |
| 145 | 121 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 void DecodeDataProcessing(Instruction* instr); | 166 void DecodeDataProcessing(Instruction* instr); |
| 191 | 167 |
| 192 // Decode the floating point parts of the instruction tree, and call the | 168 // Decode the floating point parts of the instruction tree, and call the |
| 193 // corresponding visitors. | 169 // corresponding visitors. |
| 194 // On entry, instruction bits 27:24 = {0xE, 0xF}. | 170 // On entry, instruction bits 27:24 = {0xE, 0xF}. |
| 195 void DecodeFP(Instruction* instr); | 171 void DecodeFP(Instruction* instr); |
| 196 | 172 |
| 197 // Decode the Advanced SIMD (NEON) load/store part of the instruction tree, | 173 // Decode the Advanced SIMD (NEON) load/store part of the instruction tree, |
| 198 // and call the corresponding visitors. | 174 // and call the corresponding visitors. |
| 199 // On entry, instruction bits 29:25 = 0x6. | 175 // On entry, instruction bits 29:25 = 0x6. |
| 200 void DecodeNEONLoadStore(Instruction* instr); | 176 void DecodeAdvSIMDLoadStore(Instruction* instr); |
| 201 | 177 |
| 202 // Decode the Advanced SIMD (NEON) data processing part of the instruction | 178 // Decode the Advanced SIMD (NEON) data processing part of the instruction |
| 203 // tree, and call the corresponding visitors. | 179 // tree, and call the corresponding visitors. |
| 204 // On entry, instruction bits 27:25 = 0x7. | 180 // On entry, instruction bits 27:25 = 0x7. |
| 205 void DecodeNEONVectorDataProcessing(Instruction* instr); | 181 void DecodeAdvSIMDDataProcessing(Instruction* instr); |
| 206 | |
| 207 // Decode the Advanced SIMD (NEON) scalar data processing part of the | |
| 208 // instruction tree, and call the corresponding visitors. | |
| 209 // On entry, instruction bits 28:25 = 0xF. | |
| 210 void DecodeNEONScalarDataProcessing(Instruction* instr); | |
| 211 }; | 182 }; |
| 212 | 183 |
| 213 | 184 |
| 214 } // namespace internal | 185 } // namespace internal |
| 215 } // namespace v8 | 186 } // namespace v8 |
| 216 | 187 |
| 217 #endif // V8_ARM64_DECODER_ARM64_H_ | 188 #endif // V8_ARM64_DECODER_ARM64_H_ |
| OLD | NEW |