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

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

Issue 18295007: Fixes bug in double to int conversion on arm. (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/intermediate_language_arm.cc ('k') | tests/language/language.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 2809 matching lines...) Expand 10 before | Expand all | Expand 10 after
2820 ud_val = INT_MAX; 2820 ud_val = INT_MAX;
2821 } else if (dm_val > 0.0) { 2821 } else if (dm_val > 0.0) {
2822 ud_val = static_cast<uint32_t>(dm_val); 2822 ud_val = static_cast<uint32_t>(dm_val);
2823 } 2823 }
2824 } else { 2824 } else {
2825 // Format(instr, "vcvtid'cond 'sd, 'dm"); 2825 // Format(instr, "vcvtid'cond 'sd, 'dm");
2826 if (dm_val <= INT_MIN) { 2826 if (dm_val <= INT_MIN) {
2827 id_val = INT_MIN; 2827 id_val = INT_MIN;
2828 } else if (dm_val >= INT_MAX) { 2828 } else if (dm_val >= INT_MAX) {
2829 id_val = INT_MAX; 2829 id_val = INT_MAX;
2830 } else if (isnan(dm_val)) {
2831 id_val = 0;
2830 } else { 2832 } else {
2831 id_val = static_cast<int32_t>(dm_val); 2833 id_val = static_cast<int32_t>(dm_val);
2832 } 2834 }
2833 ASSERT((id_val >= 0) || !(dm_val >= 0.0)); 2835 ASSERT((id_val >= 0) || !(dm_val >= 0.0));
2834 } 2836 }
2835 } 2837 }
2836 int32_t sd_val; 2838 int32_t sd_val;
2837 if (instr->Bit(16) == 0) { 2839 if (instr->Bit(16) == 0) {
2838 sd_val = static_cast<int32_t>(ud_val); 2840 sd_val = static_cast<int32_t>(ud_val);
2839 } else { 2841 } else {
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
3116 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception)); 3118 set_register(kExceptionObjectReg, bit_cast<int32_t>(raw_exception));
3117 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace)); 3119 set_register(kStackTraceObjectReg, bit_cast<int32_t>(raw_stacktrace));
3118 buf->Longjmp(); 3120 buf->Longjmp();
3119 } 3121 }
3120 3122
3121 } // namespace dart 3123 } // namespace dart
3122 3124
3123 #endif // !defined(HOST_ARCH_ARM) 3125 #endif // !defined(HOST_ARCH_ARM)
3124 3126
3125 #endif // defined TARGET_ARCH_ARM 3127 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698