| 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 #include "vm/disassembler.h" | 5 #include "vm/disassembler.h" |
| 6 | 6 |
| 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. | 7 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 8 #if defined(TARGET_ARCH_ARM64) | 8 #if defined(TARGET_ARCH_ARM64) |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 | 10 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 PrintRegister(rn, R31IsSP); | 188 PrintRegister(rn, R31IsSP); |
| 189 if (off != 0) { | 189 if (off != 0) { |
| 190 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), | 190 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), |
| 191 remaining_size_in_buffer(), | 191 remaining_size_in_buffer(), |
| 192 ", #%d", | 192 ", #%d", |
| 193 off); | 193 off); |
| 194 } | 194 } |
| 195 Print("]"); | 195 Print("]"); |
| 196 } else { | 196 } else { |
| 197 switch (instr->Bits(10, 2)) { | 197 switch (instr->Bits(10, 2)) { |
| 198 case 0: { |
| 199 // rn + signed 9-bit immediate, pre-index, no writeback. |
| 200 const int32_t imm9 = instr->SImm9Field(); |
| 201 Print("["); |
| 202 PrintRegister(rn, R31IsSP); |
| 203 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), |
| 204 remaining_size_in_buffer(), |
| 205 ", #%d", |
| 206 imm9); |
| 207 Print("]"); |
| 208 break; |
| 209 } |
| 198 case 1: { | 210 case 1: { |
| 199 const int32_t imm9 = instr->SImm9Field(); | 211 const int32_t imm9 = instr->SImm9Field(); |
| 200 // rn + signed 9-bit immediate, post-index, writeback. | 212 // rn + signed 9-bit immediate, post-index, writeback. |
| 201 Print("["); | 213 Print("["); |
| 202 PrintRegister(rn, R31IsSP); | 214 PrintRegister(rn, R31IsSP); |
| 203 Print("]"); | 215 Print("]"); |
| 204 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), | 216 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), |
| 205 remaining_size_in_buffer(), | 217 remaining_size_in_buffer(), |
| 206 ", #%d !", | 218 ", #%d !", |
| 207 imm9); | 219 imm9); |
| 208 break; | 220 break; |
| 209 } | 221 } |
| 210 case 3: { | |
| 211 const int32_t imm9 = instr->SImm9Field(); | |
| 212 // rn + signed 9-bit immediate, pre-index, writeback. | |
| 213 Print("["); | |
| 214 PrintRegister(rn, R31IsSP); | |
| 215 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), | |
| 216 remaining_size_in_buffer(), | |
| 217 ", #%d", | |
| 218 imm9); | |
| 219 Print("] !"); | |
| 220 break; | |
| 221 } | |
| 222 case 2: { | 222 case 2: { |
| 223 const Register rm = instr->RmField(); | 223 const Register rm = instr->RmField(); |
| 224 const Extend ext = instr->ExtendTypeField(); | 224 const Extend ext = instr->ExtendTypeField(); |
| 225 const int s = instr->Bit(12); | 225 const int s = instr->Bit(12); |
| 226 Print("["); | 226 Print("["); |
| 227 PrintRegister(rn, R31IsSP); | 227 PrintRegister(rn, R31IsSP); |
| 228 Print(", "); | 228 Print(", "); |
| 229 PrintRegister(rm, R31IsZR); | 229 PrintRegister(rm, R31IsZR); |
| 230 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), | 230 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), |
| 231 remaining_size_in_buffer(), | 231 remaining_size_in_buffer(), |
| 232 " %s", | 232 " %s", |
| 233 extend_names[ext]); | 233 extend_names[ext]); |
| 234 if (s == 1) { | 234 if (s == 1) { |
| 235 Print(" scaled"); | 235 Print(" scaled"); |
| 236 } | 236 } |
| 237 Print("]"); | 237 Print("]"); |
| 238 break; | 238 break; |
| 239 } | 239 } |
| 240 case 3: { |
| 241 const int32_t imm9 = instr->SImm9Field(); |
| 242 // rn + signed 9-bit immediate, pre-index, writeback. |
| 243 Print("["); |
| 244 PrintRegister(rn, R31IsSP); |
| 245 buffer_pos_ += OS::SNPrint(current_position_in_buffer(), |
| 246 remaining_size_in_buffer(), |
| 247 ", #%d", |
| 248 imm9); |
| 249 Print("] !"); |
| 250 break; |
| 251 } |
| 240 default: { | 252 default: { |
| 241 Print("???"); | 253 Print("???"); |
| 242 } | 254 } |
| 243 } | 255 } |
| 244 } | 256 } |
| 245 } | 257 } |
| 246 | 258 |
| 247 | 259 |
| 248 // Handle all register based formatting in these functions to reduce the | 260 // Handle all register based formatting in these functions to reduce the |
| 249 // complexity of FormatOption. | 261 // complexity of FormatOption. |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 human_buffer, | 931 human_buffer, |
| 920 sizeof(human_buffer), | 932 sizeof(human_buffer), |
| 921 pc); | 933 pc); |
| 922 pc += instruction_length; | 934 pc += instruction_length; |
| 923 } | 935 } |
| 924 } | 936 } |
| 925 | 937 |
| 926 } // namespace dart | 938 } // namespace dart |
| 927 | 939 |
| 928 #endif // defined TARGET_ARCH_ARM | 940 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |