OLD | NEW |
1 // Copyright 2007-2009 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 } else { | 991 } else { |
992 Unknown(instr); // Not used by V8. | 992 Unknown(instr); // Not used by V8. |
993 } | 993 } |
994 } | 994 } |
995 } | 995 } |
996 | 996 |
997 | 997 |
998 // Decode Type 6 coprocessor instructions. | 998 // Decode Type 6 coprocessor instructions. |
999 // Dm = vmov(Rt, Rt2) | 999 // Dm = vmov(Rt, Rt2) |
1000 // <Rt, Rt2> = vmov(Dm) | 1000 // <Rt, Rt2> = vmov(Dm) |
| 1001 // Ddst = MEM(Rbase + 4*offset). |
| 1002 // MEM(Rbase + 4*offset) = Dsrc. |
1001 void Decoder::DecodeType6CoprocessorIns(Instr* instr) { | 1003 void Decoder::DecodeType6CoprocessorIns(Instr* instr) { |
1002 ASSERT((instr->TypeField() == 6)); | 1004 ASSERT((instr->TypeField() == 6)); |
1003 | 1005 |
1004 if (instr->Bit(23) == 1) { | 1006 if (instr->CoprocessorField() != 0xB) { |
1005 Unknown(instr); // Not used by V8. | |
1006 } else if (instr->Bit(22) == 1) { | |
1007 if ((instr->Bits(27, 24) == 0xC) && | |
1008 (instr->Bit(22) == 1) && | |
1009 (instr->Bits(11, 8) == 0xB) && | |
1010 (instr->Bits(7, 6) == 0x0) && | |
1011 (instr->Bit(4) == 1)) { | |
1012 if (instr->Bit(20) == 0) { | |
1013 Format(instr, "vmov'cond 'Dm, 'rt, 'rn"); | |
1014 } else if (instr->Bit(20) == 1) { | |
1015 Format(instr, "vmov'cond 'rt, 'rn, 'Dm"); | |
1016 } | |
1017 } else { | |
1018 Unknown(instr); // Not used by V8. | |
1019 } | |
1020 } else if (instr->Bit(21) == 1) { | |
1021 Unknown(instr); // Not used by V8. | 1007 Unknown(instr); // Not used by V8. |
1022 } else { | 1008 } else { |
1023 Unknown(instr); // Not used by V8. | 1009 switch (instr->OpcodeField()) { |
| 1010 case 0x2: |
| 1011 // Load and store double to two GP registers |
| 1012 if (instr->Bits(7, 4) != 0x1) { |
| 1013 Unknown(instr); // Not used by V8. |
| 1014 } else if (instr->HasL()) { |
| 1015 Format(instr, "vmov'cond 'rt, 'rn, 'Dm"); |
| 1016 } else { |
| 1017 Format(instr, "vmov'cond 'Dm, 'rt, 'rn"); |
| 1018 } |
| 1019 break; |
| 1020 case 0x8: |
| 1021 if (instr->HasL()) { |
| 1022 Format(instr, "vldr'cond 'Dd, ['rn - 4*'off8]"); |
| 1023 } else { |
| 1024 Format(instr, "vstr'cond 'Dd, ['rn - 4*'off8]"); |
| 1025 } |
| 1026 break; |
| 1027 case 0xC: |
| 1028 if (instr->HasL()) { |
| 1029 Format(instr, "vldr'cond 'Dd, ['rn + 4*'off8]"); |
| 1030 } else { |
| 1031 Format(instr, "vstr'cond 'Dd, ['rn + 4*'off8]"); |
| 1032 } |
| 1033 break; |
| 1034 default: |
| 1035 Unknown(instr); // Not used by V8. |
| 1036 break; |
| 1037 } |
1024 } | 1038 } |
1025 } | 1039 } |
1026 | 1040 |
1027 | 1041 |
1028 // Disassemble the instruction at *instr_ptr into the output buffer. | 1042 // Disassemble the instruction at *instr_ptr into the output buffer. |
1029 int Decoder::InstructionDecode(byte* instr_ptr) { | 1043 int Decoder::InstructionDecode(byte* instr_ptr) { |
1030 Instr* instr = Instr::At(instr_ptr); | 1044 Instr* instr = Instr::At(instr_ptr); |
1031 // Print raw instruction bytes. | 1045 // Print raw instruction bytes. |
1032 out_buffer_pos_ += v8i::OS::SNPrintF(out_buffer_ + out_buffer_pos_, | 1046 out_buffer_pos_ += v8i::OS::SNPrintF(out_buffer_ + out_buffer_pos_, |
1033 "%08x ", | 1047 "%08x ", |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1157 buffer[0] = '\0'; | 1171 buffer[0] = '\0'; |
1158 byte* prev_pc = pc; | 1172 byte* prev_pc = pc; |
1159 pc += d.InstructionDecode(buffer, pc); | 1173 pc += d.InstructionDecode(buffer, pc); |
1160 fprintf(f, "%p %08x %s\n", | 1174 fprintf(f, "%p %08x %s\n", |
1161 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); | 1175 prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start()); |
1162 } | 1176 } |
1163 } | 1177 } |
1164 | 1178 |
1165 | 1179 |
1166 } // namespace disasm | 1180 } // namespace disasm |
OLD | NEW |