Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: runtime/vm/simulator_arm.cc

Issue 17742003: Fixes floating point bug in ARM simulator. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/simulator_arm.h ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 <math.h> // for isnan. 5 #include <math.h> // for isnan.
6 #include <setjmp.h> 6 #include <setjmp.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #if defined(TARGET_ARCH_ARM) 10 #if defined(TARGET_ARCH_ARM)
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 // The sp is initialized to point to the bottom (high address) of the 753 // The sp is initialized to point to the bottom (high address) of the
754 // allocated stack area. 754 // allocated stack area.
755 registers_[SP] = StackTop(); 755 registers_[SP] = StackTop();
756 // The lr and pc are initialized to a known bad value that will cause an 756 // The lr and pc are initialized to a known bad value that will cause an
757 // access violation if the simulator ever tries to execute it. 757 // access violation if the simulator ever tries to execute it.
758 registers_[PC] = kBadLR; 758 registers_[PC] = kBadLR;
759 registers_[LR] = kBadLR; 759 registers_[LR] = kBadLR;
760 760
761 // All double-precision registers are initialized to zero. 761 // All double-precision registers are initialized to zero.
762 for (int i = 0; i < kNumberOfDRegisters; i++) { 762 for (int i = 0; i < kNumberOfDRegisters; i++) {
763 dregisters_[i] = 0.0; 763 dregisters_[i] = 0;
764 } 764 }
765 // Since VFP registers are overlapping, single-precision registers should 765 // Since VFP registers are overlapping, single-precision registers should
766 // already be initialized. 766 // already be initialized.
767 ASSERT(2*kNumberOfDRegisters >= kNumberOfSRegisters); 767 ASSERT(2*kNumberOfDRegisters >= kNumberOfSRegisters);
768 for (int i = 0; i < kNumberOfSRegisters; i++) { 768 for (int i = 0; i < kNumberOfSRegisters; i++) {
769 ASSERT(sregisters_[i] == 0.0); 769 ASSERT(sregisters_[i] == 0.0);
770 } 770 }
771 fp_n_flag_ = false; 771 fp_n_flag_ = false;
772 fp_z_flag_ = false; 772 fp_z_flag_ = false;
773 fp_c_flag_ = false; 773 fp_c_flag_ = false;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 894
895 // Raw access to the PC register without the special adjustment when reading. 895 // Raw access to the PC register without the special adjustment when reading.
896 int32_t Simulator::get_pc() const { 896 int32_t Simulator::get_pc() const {
897 return registers_[PC]; 897 return registers_[PC];
898 } 898 }
899 899
900 900
901 // Accessors for VFP register state. 901 // Accessors for VFP register state.
902 void Simulator::set_sregister(SRegister reg, float value) { 902 void Simulator::set_sregister(SRegister reg, float value) {
903 ASSERT((reg >= 0) && (reg < kNumberOfSRegisters)); 903 ASSERT((reg >= 0) && (reg < kNumberOfSRegisters));
904 sregisters_[reg] = bit_cast<int32_t, float>(value);
905 }
906
907
908 float Simulator::get_sregister(SRegister reg) const {
909 ASSERT((reg >= 0) && (reg < kNumberOfSRegisters));
910 return bit_cast<float, int32_t>(sregisters_[reg]);
911 }
912
913
914 void Simulator::set_dregister(DRegister reg, double value) {
915 ASSERT((reg >= 0) && (reg < kNumberOfDRegisters));
916 dregisters_[reg] = bit_cast<int64_t, double>(value);
917 }
918
919
920 double Simulator::get_dregister(DRegister reg) const {
921 ASSERT((reg >= 0) && (reg < kNumberOfDRegisters));
922 return bit_cast<double, int64_t>(dregisters_[reg]);
923 }
924
925
926 void Simulator::set_sregister_bits(SRegister reg, int32_t value) {
927 ASSERT((reg >= 0) && (reg < kNumberOfSRegisters));
904 sregisters_[reg] = value; 928 sregisters_[reg] = value;
905 } 929 }
906 930
907 931
908 float Simulator::get_sregister(SRegister reg) const { 932 int32_t Simulator::get_sregister_bits(SRegister reg) const {
909 ASSERT((reg >= 0) && (reg < kNumberOfSRegisters)); 933 ASSERT((reg >= 0) && (reg < kNumberOfSRegisters));
910 return sregisters_[reg]; 934 return sregisters_[reg];
911 } 935 }
912 936
913 937
914 void Simulator::set_dregister(DRegister reg, double value) { 938 void Simulator::set_dregister_bits(DRegister reg, int64_t value) {
915 ASSERT((reg >= 0) && (reg < kNumberOfDRegisters)); 939 ASSERT((reg >= 0) && (reg < kNumberOfDRegisters));
916 dregisters_[reg] = value; 940 dregisters_[reg] = value;
917 } 941 }
918 942
919 943
920 double Simulator::get_dregister(DRegister reg) const { 944 int64_t Simulator::get_dregister_bits(DRegister reg) const {
921 ASSERT((reg >= 0) && (reg < kNumberOfDRegisters)); 945 ASSERT((reg >= 0) && (reg < kNumberOfDRegisters));
922 return dregisters_[reg]; 946 return dregisters_[reg];
923 } 947 }
924 948
925 949
926 void Simulator::HandleIllegalAccess(uword addr, Instr* instr) { 950 void Simulator::HandleIllegalAccess(uword addr, Instr* instr) {
927 uword fault_pc = get_pc(); 951 uword fault_pc = get_pc();
928 // The debugger will not be able to single step past this instruction, but 952 // The debugger will not be able to single step past this instruction, but
929 // it will be possible to disassemble the code and inspect registers. 953 // it will be possible to disassemble the code and inspect registers.
930 char buffer[128]; 954 char buffer[128];
(...skipping 1433 matching lines...) Expand 10 before | Expand all | Expand 10 after
2364 void Simulator::DecodeType6(Instr* instr) { 2388 void Simulator::DecodeType6(Instr* instr) {
2365 if (instr->IsVFPDoubleTransfer()) { 2389 if (instr->IsVFPDoubleTransfer()) {
2366 Register rd = instr->RdField(); 2390 Register rd = instr->RdField();
2367 Register rn = instr->RnField(); 2391 Register rn = instr->RnField();
2368 if (instr->Bit(8) == 0) { 2392 if (instr->Bit(8) == 0) {
2369 SRegister sm = instr->SmField(); 2393 SRegister sm = instr->SmField();
2370 SRegister sm1 = static_cast<SRegister>(sm + 1); 2394 SRegister sm1 = static_cast<SRegister>(sm + 1);
2371 ASSERT(sm1 < kNumberOfSRegisters); 2395 ASSERT(sm1 < kNumberOfSRegisters);
2372 if (instr->Bit(20) == 1) { 2396 if (instr->Bit(20) == 1) {
2373 // Format(instr, "vmovrrs'cond 'rd, 'rn, {'sm', 'sm1}"); 2397 // Format(instr, "vmovrrs'cond 'rd, 'rn, {'sm', 'sm1}");
2374 set_register(rd, bit_cast<int32_t, float>(get_sregister(sm))); 2398 set_register(rd, get_sregister_bits(sm));
2375 set_register(rn, bit_cast<int32_t, float>(get_sregister(sm1))); 2399 set_register(rn, get_sregister_bits(sm1));
2376 } else { 2400 } else {
2377 // Format(instr, "vmovsrr'cond {'sm, 'sm1}, 'rd', 'rn"); 2401 // Format(instr, "vmovsrr'cond {'sm, 'sm1}, 'rd', 'rn");
2378 set_sregister(sm, bit_cast<float, int32_t>(get_register(rd))); 2402 set_sregister_bits(sm, get_register(rd));
2379 set_sregister(sm1, bit_cast<float, int32_t>(get_register(rn))); 2403 set_sregister_bits(sm1, get_register(rn));
2380 } 2404 }
2381 } else { 2405 } else {
2382 DRegister dm = instr->DmField(); 2406 DRegister dm = instr->DmField();
2383 if (instr->Bit(20) == 1) { 2407 if (instr->Bit(20) == 1) {
2384 // Format(instr, "vmovrrd'cond 'rd, 'rn, 'dm"); 2408 // Format(instr, "vmovrrd'cond 'rd, 'rn, 'dm");
2385 int64_t dm_val = bit_cast<int64_t, double>(get_dregister(dm)); 2409 int64_t dm_val = get_dregister_bits(dm);
2386 set_register(rd, Utils::Low32Bits(dm_val)); 2410 set_register(rd, Utils::Low32Bits(dm_val));
2387 set_register(rn, Utils::High32Bits(dm_val)); 2411 set_register(rn, Utils::High32Bits(dm_val));
2388 } else { 2412 } else {
2389 // Format(instr, "vmovdrr'cond 'dm, 'rd, 'rn"); 2413 // Format(instr, "vmovdrr'cond 'dm, 'rd, 'rn");
2390 int64_t dm_val = Utils::LowHighTo64Bits(get_register(rd), 2414 int64_t dm_val = Utils::LowHighTo64Bits(get_register(rd),
2391 get_register(rn)); 2415 get_register(rn));
2392 set_dregister(dm, bit_cast<double, int64_t>(dm_val)); 2416 set_dregister_bits(dm, dm_val);
2393 } 2417 }
2394 } 2418 }
2395 } else if (instr-> IsVFPLoadStore()) { 2419 } else if (instr-> IsVFPLoadStore()) {
2396 Register rn = instr->RnField(); 2420 Register rn = instr->RnField();
2397 int32_t addr = get_register(rn); 2421 int32_t addr = get_register(rn);
2398 int32_t imm_val = instr->Bits(0, 8) << 2; 2422 int32_t imm_val = instr->Bits(0, 8) << 2;
2399 if (instr->Bit(23) == 1) { 2423 if (instr->Bit(23) == 1) {
2400 addr += imm_val; 2424 addr += imm_val;
2401 } else { 2425 } else {
2402 addr -= imm_val; 2426 addr -= imm_val;
2403 } 2427 }
2404 if (IsIllegalAddress(addr)) { 2428 if (IsIllegalAddress(addr)) {
2405 HandleIllegalAccess(addr, instr); 2429 HandleIllegalAccess(addr, instr);
2406 } else { 2430 } else {
2407 if (instr->Bit(8) == 0) { 2431 if (instr->Bit(8) == 0) {
2408 SRegister sd = instr->SdField(); 2432 SRegister sd = instr->SdField();
2409 if (instr->Bit(20) == 1) { // vldrs 2433 if (instr->Bit(20) == 1) { // vldrs
2410 // Format(instr, "vldrs'cond 'sd, ['rn, #+'off10]"); 2434 // Format(instr, "vldrs'cond 'sd, ['rn, #+'off10]");
2411 // Format(instr, "vldrs'cond 'sd, ['rn, #-'off10]"); 2435 // Format(instr, "vldrs'cond 'sd, ['rn, #-'off10]");
2412 set_sregister(sd, bit_cast<float, int32_t>(ReadW(addr, instr))); 2436 set_sregister_bits(sd, ReadW(addr, instr));
2413 } else { // vstrs 2437 } else { // vstrs
2414 // Format(instr, "vstrs'cond 'sd, ['rn, #+'off10]"); 2438 // Format(instr, "vstrs'cond 'sd, ['rn, #+'off10]");
2415 // Format(instr, "vstrs'cond 'sd, ['rn, #-'off10]"); 2439 // Format(instr, "vstrs'cond 'sd, ['rn, #-'off10]");
2416 WriteW(addr, bit_cast<int32_t, float>(get_sregister(sd)), instr); 2440 WriteW(addr, get_sregister_bits(sd), instr);
2417 } 2441 }
2418 } else { 2442 } else {
2419 DRegister dd = instr->DdField(); 2443 DRegister dd = instr->DdField();
2420 if (instr->Bit(20) == 1) { // vldrd 2444 if (instr->Bit(20) == 1) { // vldrd
2421 // Format(instr, "vldrd'cond 'dd, ['rn, #+'off10]"); 2445 // Format(instr, "vldrd'cond 'dd, ['rn, #+'off10]");
2422 // Format(instr, "vldrd'cond 'dd, ['rn, #-'off10]"); 2446 // Format(instr, "vldrd'cond 'dd, ['rn, #-'off10]");
2423 int64_t dd_val = Utils::LowHighTo64Bits(ReadW(addr, instr), 2447 int64_t dd_val = Utils::LowHighTo64Bits(ReadW(addr, instr),
2424 ReadW(addr + 4, instr)); 2448 ReadW(addr + 4, instr));
2425 set_dregister(dd, bit_cast<double, int64_t>(dd_val)); 2449 set_dregister_bits(dd, dd_val);
2426 } else { // vstrd 2450 } else { // vstrd
2427 // Format(instr, "vstrd'cond 'dd, ['rn, #+'off10]"); 2451 // Format(instr, "vstrd'cond 'dd, ['rn, #+'off10]");
2428 // Format(instr, "vstrd'cond 'dd, ['rn, #-'off10]"); 2452 // Format(instr, "vstrd'cond 'dd, ['rn, #-'off10]");
2429 int64_t dd_val = bit_cast<int64_t, double>(get_dregister(dd)); 2453 int64_t dd_val = get_dregister_bits(dd);
2430 WriteW(addr, Utils::Low32Bits(dd_val), instr); 2454 WriteW(addr, Utils::Low32Bits(dd_val), instr);
2431 WriteW(addr + 4, Utils::High32Bits(dd_val), instr); 2455 WriteW(addr + 4, Utils::High32Bits(dd_val), instr);
2432 } 2456 }
2433 } 2457 }
2434 } 2458 }
2435 } else if (instr->IsVFPMultipleLoadStore()) { 2459 } else if (instr->IsVFPMultipleLoadStore()) {
2436 Register rn = instr->RnField(); 2460 Register rn = instr->RnField();
2437 int32_t addr = get_register(rn); 2461 int32_t addr = get_register(rn);
2438 int32_t imm_val = instr->Bits(0, 8); 2462 int32_t imm_val = instr->Bits(0, 8);
2439 if (instr->Bit(23) == 0) { 2463 if (instr->Bit(23) == 0) {
2440 addr -= (imm_val << 2); 2464 addr -= (imm_val << 2);
2441 } 2465 }
2442 if (instr->HasW()) { 2466 if (instr->HasW()) {
2443 if (instr->Bit(23) == 1) { 2467 if (instr->Bit(23) == 1) {
2444 set_register(rn, addr + (imm_val << 2)); 2468 set_register(rn, addr + (imm_val << 2));
2445 } else { 2469 } else {
2446 set_register(rn, addr); // already subtracted from addr 2470 set_register(rn, addr); // already subtracted from addr
2447 } 2471 }
2448 } 2472 }
2449 if (IsIllegalAddress(addr)) { 2473 if (IsIllegalAddress(addr)) {
2450 HandleIllegalAccess(addr, instr); 2474 HandleIllegalAccess(addr, instr);
2451 } else { 2475 } else {
2452 if (instr->Bit(8) == 0) { 2476 if (instr->Bit(8) == 0) {
2453 int32_t regs_cnt = imm_val; 2477 int32_t regs_cnt = imm_val;
2454 int32_t start = instr->Bit(22) | (instr->Bits(12, 4) << 1); 2478 int32_t start = instr->Bit(22) | (instr->Bits(12, 4) << 1);
2455 for (int i = start; i < start + regs_cnt; i++) { 2479 for (int i = start; i < start + regs_cnt; i++) {
2456 SRegister sd = static_cast<SRegister>(i); 2480 SRegister sd = static_cast<SRegister>(i);
2457 if (instr->Bit(20) == 1) { 2481 if (instr->Bit(20) == 1) {
2458 // Format(instr, "vldms'cond'pu 'rn'w, 'slist"); 2482 // Format(instr, "vldms'cond'pu 'rn'w, 'slist");
2459 set_sregister(sd, bit_cast<float, int32_t>(ReadW(addr, instr))); 2483 set_sregister_bits(sd, ReadW(addr, instr));
2460 } else { 2484 } else {
2461 // Format(instr, "vstms'cond'pu 'rn'w, 'slist"); 2485 // Format(instr, "vstms'cond'pu 'rn'w, 'slist");
2462 WriteW(addr, bit_cast<int32_t, float>(get_sregister(sd)), instr); 2486 WriteW(addr, get_sregister_bits(sd), instr);
2463 } 2487 }
2464 addr += 4; 2488 addr += 4;
2465 } 2489 }
2466 } else { 2490 } else {
2467 int32_t regs_cnt = imm_val >> 1; 2491 int32_t regs_cnt = imm_val >> 1;
2468 int32_t start = (instr->Bit(22) << 4) | instr->Bits(12, 4); 2492 int32_t start = (instr->Bit(22) << 4) | instr->Bits(12, 4);
2469 for (int i = start; i < start + regs_cnt; i++) { 2493 for (int i = start; i < start + regs_cnt; i++) {
2470 DRegister dd = static_cast<DRegister>(i); 2494 DRegister dd = static_cast<DRegister>(i);
2471 if (instr->Bit(20) == 1) { 2495 if (instr->Bit(20) == 1) {
2472 // Format(instr, "vldmd'cond'pu 'rn'w, 'dlist"); 2496 // Format(instr, "vldmd'cond'pu 'rn'w, 'dlist");
2473 int64_t dd_val = Utils::LowHighTo64Bits(ReadW(addr, instr), 2497 int64_t dd_val = Utils::LowHighTo64Bits(ReadW(addr, instr),
2474 ReadW(addr + 4, instr)); 2498 ReadW(addr + 4, instr));
2475 set_dregister(dd, bit_cast<double, int64_t>(dd_val)); 2499 set_dregister_bits(dd, dd_val);
2476 } else { 2500 } else {
2477 // Format(instr, "vstmd'cond'pu 'rn'w, 'dlist"); 2501 // Format(instr, "vstmd'cond'pu 'rn'w, 'dlist");
2478 int64_t dd_val = bit_cast<int64_t, double>(get_dregister(dd)); 2502 int64_t dd_val = get_dregister_bits(dd);
2479 WriteW(addr, Utils::Low32Bits(dd_val), instr); 2503 WriteW(addr, Utils::Low32Bits(dd_val), instr);
2480 WriteW(addr + 4, Utils::High32Bits(dd_val), instr); 2504 WriteW(addr + 4, Utils::High32Bits(dd_val), instr);
2481 } 2505 }
2482 addr += 8; 2506 addr += 8;
2483 } 2507 }
2484 } 2508 }
2485 } 2509 }
2486 } else { 2510 } else {
2487 UnimplementedInstruction(instr); 2511 UnimplementedInstruction(instr);
2488 } 2512 }
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
2719 set_dregister(dd, static_cast<double>(get_sregister(sm))); 2743 set_dregister(dd, static_cast<double>(get_sregister(sm)));
2720 } else { 2744 } else {
2721 // Format(instr, "vcvtsd'cond 'sd, 'dm"); 2745 // Format(instr, "vcvtsd'cond 'sd, 'dm");
2722 sd = instr->SdField(); 2746 sd = instr->SdField();
2723 set_sregister(sd, static_cast<float>(get_dregister(dm))); 2747 set_sregister(sd, static_cast<float>(get_dregister(dm)));
2724 } 2748 }
2725 break; 2749 break;
2726 } 2750 }
2727 case 8: { // vcvt, vcvtr between floating-point and integer 2751 case 8: { // vcvt, vcvtr between floating-point and integer
2728 sm = instr->SmField(); 2752 sm = instr->SmField();
2729 float sm_val = get_sregister(sm); 2753 int32_t sm_int = get_sregister_bits(sm);
2730 uint32_t ud_val = 0; 2754 uint32_t ud_val = 0;
2731 int32_t id_val = 0; 2755 int32_t id_val = 0;
2732 if (instr->Bit(7) == 0) { // vcvtsu, vcvtdu 2756 if (instr->Bit(7) == 0) { // vcvtsu, vcvtdu
2733 ud_val = bit_cast<uint32_t, float>(sm_val); 2757 ud_val = static_cast<uint32_t>(sm_int);
2734 } else { // vcvtsi, vcvtdi 2758 } else { // vcvtsi, vcvtdi
2735 id_val = bit_cast<int32_t, float>(sm_val); 2759 id_val = sm_int;
2736 } 2760 }
2737 if (instr->Bit(8) == 0) { 2761 if (instr->Bit(8) == 0) {
2738 float sd_val; 2762 float sd_val;
2739 if (instr->Bit(7) == 0) { 2763 if (instr->Bit(7) == 0) {
2740 // Format(instr, "vcvtsu'cond 'sd, 'sm"); 2764 // Format(instr, "vcvtsu'cond 'sd, 'sm");
2741 sd_val = static_cast<float>(ud_val); 2765 sd_val = static_cast<float>(ud_val);
2742 } else { 2766 } else {
2743 // Format(instr, "vcvtsi'cond 'sd, 'sm"); 2767 // Format(instr, "vcvtsi'cond 'sd, 'sm");
2744 sd_val = static_cast<float>(id_val); 2768 sd_val = static_cast<float>(id_val);
2745 } 2769 }
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
2803 if (dm_val <= INT_MIN) { 2827 if (dm_val <= INT_MIN) {
2804 id_val = INT_MIN; 2828 id_val = INT_MIN;
2805 } else if (dm_val >= INT_MAX) { 2829 } else if (dm_val >= INT_MAX) {
2806 id_val = INT_MAX; 2830 id_val = INT_MAX;
2807 } else { 2831 } else {
2808 id_val = static_cast<int32_t>(dm_val); 2832 id_val = static_cast<int32_t>(dm_val);
2809 } 2833 }
2810 ASSERT((id_val >= 0) || !(dm_val >= 0.0)); 2834 ASSERT((id_val >= 0) || !(dm_val >= 0.0));
2811 } 2835 }
2812 } 2836 }
2813 float sd_val; 2837 int32_t sd_val;
2814 if (instr->Bit(16) == 0) { 2838 if (instr->Bit(16) == 0) {
2815 sd_val = bit_cast<float, uint32_t>(ud_val); 2839 sd_val = static_cast<int32_t>(ud_val);
2816 } else { 2840 } else {
2817 sd_val = bit_cast<float, int32_t>(id_val); 2841 sd_val = id_val;
2818 } 2842 }
2819 set_sregister(sd, sd_val); 2843 set_sregister_bits(sd, sd_val);
2820 break; 2844 break;
2821 } 2845 }
2822 case 2: // vcvtb, vcvtt 2846 case 2: // vcvtb, vcvtt
2823 case 3: // vcvtb, vcvtt 2847 case 3: // vcvtb, vcvtt
2824 case 9: // undefined 2848 case 9: // undefined
2825 case 10: // vcvt between floating-point and fixed-point 2849 case 10: // vcvt between floating-point and fixed-point
2826 case 11: // vcvt between floating-point and fixed-point 2850 case 11: // vcvt between floating-point and fixed-point
2827 case 14: // vcvt between floating-point and fixed-point 2851 case 14: // vcvt between floating-point and fixed-point
2828 case 15: // vcvt between floating-point and fixed-point 2852 case 15: // vcvt between floating-point and fixed-point
2829 default: { 2853 default: {
2830 UnimplementedInstruction(instr); 2854 UnimplementedInstruction(instr);
2831 break; 2855 break;
2832 } 2856 }
2833 } 2857 }
2834 } 2858 }
2835 break; 2859 break;
2836 } 2860 }
2837 } else { 2861 } else {
2838 // 8, 16, or 32-bit Transfer between ARM Core and VFP 2862 // 8, 16, or 32-bit Transfer between ARM Core and VFP
2839 if ((instr->Bits(21, 3) == 0) && (instr->Bit(8) == 0)) { 2863 if ((instr->Bits(21, 3) == 0) && (instr->Bit(8) == 0)) {
2840 Register rd = instr->RdField(); 2864 Register rd = instr->RdField();
2841 SRegister sn = instr->SnField(); 2865 SRegister sn = instr->SnField();
2842 if (instr->Bit(20) == 0) { 2866 if (instr->Bit(20) == 0) {
2843 // Format(instr, "vmovs'cond 'sn, 'rd"); 2867 // Format(instr, "vmovs'cond 'sn, 'rd");
2844 set_sregister(sn, bit_cast<float, int32_t>(get_register(rd))); 2868 set_sregister_bits(sn, get_register(rd));
2845 } else { 2869 } else {
2846 // Format(instr, "vmovr'cond 'rd, 'sn"); 2870 // Format(instr, "vmovr'cond 'rd, 'sn");
2847 set_register(rd, bit_cast<int32_t, float>(get_sregister(sn))); 2871 set_register(rd, get_sregister_bits(sn));
2848 } 2872 }
2849 } else if ((instr->Bits(20, 4) == 0xf) && (instr->Bit(8) == 0) && 2873 } else if ((instr->Bits(20, 4) == 0xf) && (instr->Bit(8) == 0) &&
2850 (instr->Bits(12, 4) == 0xf)) { 2874 (instr->Bits(12, 4) == 0xf)) {
2851 // Format(instr, "vmstat'cond"); 2875 // Format(instr, "vmstat'cond");
2852 n_flag_ = fp_n_flag_; 2876 n_flag_ = fp_n_flag_;
2853 z_flag_ = fp_z_flag_; 2877 z_flag_ = fp_z_flag_;
2854 c_flag_ = fp_c_flag_; 2878 c_flag_ = fp_c_flag_;
2855 v_flag_ = fp_v_flag_; 2879 v_flag_ = fp_v_flag_;
2856 } else { 2880 } else {
2857 UnimplementedInstruction(instr); 2881 UnimplementedInstruction(instr);
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
3093 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); 3117 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception));
3094 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); 3118 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace));
3095 buf->Longjmp(); 3119 buf->Longjmp();
3096 } 3120 }
3097 3121
3098 } // namespace dart 3122 } // namespace dart
3099 3123
3100 #endif // !defined(HOST_ARCH_ARM) 3124 #endif // !defined(HOST_ARCH_ARM)
3101 3125
3102 #endif // defined TARGET_ARCH_ARM 3126 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/simulator_arm.h ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698