| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Declares a Simulator for ARM64 instructions if we are not generating a native | 5 // Declares a Simulator for ARM64 instructions if we are not generating a native |
| 6 // ARM64 binary. This Simulator allows us to run and debug ARM64 code generation | 6 // ARM64 binary. This Simulator allows us to run and debug ARM64 code generation |
| 7 // on regular desktop machines. | 7 // on regular desktop machines. |
| 8 // Dart calls into generated code by "calling" the InvokeDartCode stub, | 8 // Dart calls into generated code by "calling" the InvokeDartCode stub, |
| 9 // which will start execution in the Simulator or forwards to the real entry | 9 // which will start execution in the Simulator or forwards to the real entry |
| 10 // on a ARM64 HW platform. | 10 // on a ARM64 HW platform. |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 168 |
| 169 inline uint32_t ReadWU(uword addr, Instr* instr); | 169 inline uint32_t ReadWU(uword addr, Instr* instr); |
| 170 inline int32_t ReadW(uword addr, Instr* instr); | 170 inline int32_t ReadW(uword addr, Instr* instr); |
| 171 inline void WriteW(uword addr, uint32_t value, Instr* instr); | 171 inline void WriteW(uword addr, uint32_t value, Instr* instr); |
| 172 | 172 |
| 173 inline intptr_t ReadX(uword addr, Instr* instr); | 173 inline intptr_t ReadX(uword addr, Instr* instr); |
| 174 inline void WriteX(uword addr, intptr_t value, Instr* instr); | 174 inline void WriteX(uword addr, intptr_t value, Instr* instr); |
| 175 | 175 |
| 176 // Helper functions to set the conditional flags in the architecture state. | 176 // Helper functions to set the conditional flags in the architecture state. |
| 177 void SetNZFlagsW(int32_t val); | 177 void SetNZFlagsW(int32_t val); |
| 178 bool CarryFromW(int32_t left, int32_t right); | 178 bool CarryFromW(int32_t left, int32_t right, int32_t carry); |
| 179 bool BorrowFromW(int32_t left, int32_t right); | 179 bool OverflowFromW(int32_t left, int32_t right, int32_t carry); |
| 180 bool OverflowFromW( | |
| 181 int32_t alu_out, int32_t left, int32_t right, bool addition); | |
| 182 | 180 |
| 183 void SetNZFlagsX(int64_t val); | 181 void SetNZFlagsX(int64_t val); |
| 184 bool CarryFromX(int64_t left, int64_t right); | 182 bool CarryFromX(int64_t alu_out, int64_t left, int64_t right, bool addition); |
| 185 bool BorrowFromX(int64_t left, int64_t right); | |
| 186 bool OverflowFromX( | 183 bool OverflowFromX( |
| 187 int64_t alu_out, int64_t left, int64_t right, bool addition); | 184 int64_t alu_out, int64_t left, int64_t right, bool addition); |
| 188 | 185 |
| 189 void SetCFlag(bool val); | 186 void SetCFlag(bool val); |
| 190 void SetVFlag(bool val); | 187 void SetVFlag(bool val); |
| 191 | 188 |
| 192 int64_t ShiftOperand(uint8_t reg_size, | 189 int64_t ShiftOperand(uint8_t reg_size, |
| 193 int64_t value, | 190 int64_t value, |
| 194 Shift shift_type, | 191 Shift shift_type, |
| 195 uint8_t amount); | 192 uint8_t amount); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 224 } | 221 } |
| 225 | 222 |
| 226 friend class SimulatorDebugger; | 223 friend class SimulatorDebugger; |
| 227 friend class SimulatorSetjmpBuffer; | 224 friend class SimulatorSetjmpBuffer; |
| 228 DISALLOW_COPY_AND_ASSIGN(Simulator); | 225 DISALLOW_COPY_AND_ASSIGN(Simulator); |
| 229 }; | 226 }; |
| 230 | 227 |
| 231 } // namespace dart | 228 } // namespace dart |
| 232 | 229 |
| 233 #endif // VM_SIMULATOR_ARM64_H_ | 230 #endif // VM_SIMULATOR_ARM64_H_ |
| OLD | NEW |