| OLD | NEW | 
|---|
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. | 
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without | 
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are | 
| 4 // met: | 4 // met: | 
| 5 // | 5 // | 
| 6 //     * Redistributions of source code must retain the above copyright | 6 //     * Redistributions of source code must retain the above copyright | 
| 7 //       notice, this list of conditions and the following disclaimer. | 7 //       notice, this list of conditions and the following disclaimer. | 
| 8 //     * Redistributions in binary form must reproduce the above | 8 //     * Redistributions in binary form must reproduce the above | 
| 9 //       copyright notice, this list of conditions and the following | 9 //       copyright notice, this list of conditions and the following | 
| 10 //       disclaimer in the documentation and/or other materials provided | 10 //       disclaimer in the documentation and/or other materials provided | 
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 411       if (instr->HasLink()) { | 411       if (instr->HasLink()) { | 
| 412         Print("l"); | 412         Print("l"); | 
| 413       } | 413       } | 
| 414       return 1; | 414       return 1; | 
| 415     } | 415     } | 
| 416     case 'm': { | 416     case 'm': { | 
| 417       if (format[1] == 'e') {  // 'memop: load/store instructions | 417       if (format[1] == 'e') {  // 'memop: load/store instructions | 
| 418         ASSERT(STRING_STARTS_WITH(format, "memop")); | 418         ASSERT(STRING_STARTS_WITH(format, "memop")); | 
| 419         if (instr->HasL()) { | 419         if (instr->HasL()) { | 
| 420           Print("ldr"); | 420           Print("ldr"); | 
|  | 421         } else if ((instr->Bits(27, 25) == 0) && (instr->Bit(20) == 0)) { | 
|  | 422           if (instr->Bits(7, 4) == 0xf) { | 
|  | 423             Print("strd"); | 
|  | 424           } else { | 
|  | 425             Print("ldrd"); | 
|  | 426           } | 
| 421         } else { | 427         } else { | 
| 422           Print("str"); | 428           Print("str"); | 
| 423         } | 429         } | 
| 424         return 5; | 430         return 5; | 
| 425       } | 431       } | 
| 426       // 'msg: for simulator break instructions | 432       // 'msg: for simulator break instructions | 
| 427       ASSERT(STRING_STARTS_WITH(format, "msg")); | 433       ASSERT(STRING_STARTS_WITH(format, "msg")); | 
| 428       byte* str = | 434       byte* str = | 
| 429           reinterpret_cast<byte*>(instr->InstructionBits() & 0x0fffffff); | 435           reinterpret_cast<byte*>(instr->InstructionBits() & 0x0fffffff); | 
| 430       out_buffer_pos_ += v8i::OS::SNPrintF(out_buffer_ + out_buffer_pos_, | 436       out_buffer_pos_ += v8i::OS::SNPrintF(out_buffer_ + out_buffer_pos_, | 
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 607           // when referring to the target registers. They are mapped to the Rn | 613           // when referring to the target registers. They are mapped to the Rn | 
| 608           // and Rd fields as follows: | 614           // and Rd fields as follows: | 
| 609           // RdLo == Rd field | 615           // RdLo == Rd field | 
| 610           // RdHi == Rn field | 616           // RdHi == Rn field | 
| 611           // The order of registers is: <RdLo>, <RdHi>, <Rm>, <Rs> | 617           // The order of registers is: <RdLo>, <RdHi>, <Rm>, <Rs> | 
| 612           Format(instr, "'um'al'cond's 'rd, 'rn, 'rm, 'rs"); | 618           Format(instr, "'um'al'cond's 'rd, 'rn, 'rm, 'rs"); | 
| 613         } | 619         } | 
| 614       } else { | 620       } else { | 
| 615         Unknown(instr);  // not used by V8 | 621         Unknown(instr);  // not used by V8 | 
| 616       } | 622       } | 
|  | 623     } else if ((instr->Bit(20) == 0) && ((instr->Bits(7, 4) & 0xd) == 0xd)) { | 
|  | 624       // ldrd, strd | 
|  | 625       switch (instr->PUField()) { | 
|  | 626         case 0: { | 
|  | 627           if (instr->Bit(22) == 0) { | 
|  | 628             Format(instr, "'memop'cond's 'rd, ['rn], -'rm"); | 
|  | 629           } else { | 
|  | 630             Format(instr, "'memop'cond's 'rd, ['rn], #-'off8"); | 
|  | 631           } | 
|  | 632           break; | 
|  | 633         } | 
|  | 634         case 1: { | 
|  | 635           if (instr->Bit(22) == 0) { | 
|  | 636             Format(instr, "'memop'cond's 'rd, ['rn], +'rm"); | 
|  | 637           } else { | 
|  | 638             Format(instr, "'memop'cond's 'rd, ['rn], #+'off8"); | 
|  | 639           } | 
|  | 640           break; | 
|  | 641         } | 
|  | 642         case 2: { | 
|  | 643           if (instr->Bit(22) == 0) { | 
|  | 644             Format(instr, "'memop'cond's 'rd, ['rn, -'rm]'w"); | 
|  | 645           } else { | 
|  | 646             Format(instr, "'memop'cond's 'rd, ['rn, #-'off8]'w"); | 
|  | 647           } | 
|  | 648           break; | 
|  | 649         } | 
|  | 650         case 3: { | 
|  | 651           if (instr->Bit(22) == 0) { | 
|  | 652             Format(instr, "'memop'cond's 'rd, ['rn, +'rm]'w"); | 
|  | 653           } else { | 
|  | 654             Format(instr, "'memop'cond's 'rd, ['rn, #+'off8]'w"); | 
|  | 655           } | 
|  | 656           break; | 
|  | 657         } | 
|  | 658         default: { | 
|  | 659           // The PU field is a 2-bit field. | 
|  | 660           UNREACHABLE(); | 
|  | 661           break; | 
|  | 662         } | 
|  | 663       } | 
| 617     } else { | 664     } else { | 
| 618       // extra load/store instructions | 665       // extra load/store instructions | 
| 619       switch (instr->PUField()) { | 666       switch (instr->PUField()) { | 
| 620         case 0: { | 667         case 0: { | 
| 621           if (instr->Bit(22) == 0) { | 668           if (instr->Bit(22) == 0) { | 
| 622             Format(instr, "'memop'cond'sign'h 'rd, ['rn], -'rm"); | 669             Format(instr, "'memop'cond'sign'h 'rd, ['rn], -'rm"); | 
| 623           } else { | 670           } else { | 
| 624             Format(instr, "'memop'cond'sign'h 'rd, ['rn], #-'off8"); | 671             Format(instr, "'memop'cond'sign'h 'rd, ['rn], #-'off8"); | 
| 625           } | 672           } | 
| 626           break; | 673           break; | 
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1302     buffer[0] = '\0'; | 1349     buffer[0] = '\0'; | 
| 1303     byte* prev_pc = pc; | 1350     byte* prev_pc = pc; | 
| 1304     pc += d.InstructionDecode(buffer, pc); | 1351     pc += d.InstructionDecode(buffer, pc); | 
| 1305     fprintf(f, "%p    %08x      %s\n", | 1352     fprintf(f, "%p    %08x      %s\n", | 
| 1306             prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1353             prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 
| 1307   } | 1354   } | 
| 1308 } | 1355 } | 
| 1309 | 1356 | 
| 1310 | 1357 | 
| 1311 }  // namespace disasm | 1358 }  // namespace disasm | 
| OLD | NEW | 
|---|