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

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

Issue 2463593002: VM: Enable branch merging of isnan, isinf. (Closed)
Patch Set: addressed comments Created 4 years, 1 month 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
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | no next file » | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 <setjmp.h> // NOLINT 5 #include <setjmp.h> // NOLINT
6 #include <stdlib.h> 6 #include <stdlib.h>
7 7
8 #include "vm/globals.h" 8 #include "vm/globals.h"
9 #if defined(TARGET_ARCH_DBC) 9 #if defined(TARGET_ARCH_DBC)
10 10
(...skipping 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after
2222 2222
2223 { 2223 {
2224 BYTECODE(FloatToDouble, A_D); 2224 BYTECODE(FloatToDouble, A_D);
2225 const float valuef = *reinterpret_cast<float*>(&FP[rD]); 2225 const float valuef = *reinterpret_cast<float*>(&FP[rD]);
2226 const double value = static_cast<double>(valuef); 2226 const double value = static_cast<double>(valuef);
2227 FP[rA] = bit_cast<RawObject*, double>(value); 2227 FP[rA] = bit_cast<RawObject*, double>(value);
2228 DISPATCH(); 2228 DISPATCH();
2229 } 2229 }
2230 2230
2231 { 2231 {
2232 BYTECODE(DoubleIsNaN, A_D); 2232 BYTECODE(DoubleIsNaN, A);
2233 const double v = bit_cast<double, RawObject*>(FP[rD]); 2233 const double v = bit_cast<double, RawObject*>(FP[rA]);
2234 FP[rA] = isnan(v) ? true_value : false_value; 2234 if (!isnan(v)) {
2235 pc++;
2236 }
2235 DISPATCH(); 2237 DISPATCH();
2236 } 2238 }
2237 2239
2238 { 2240 {
2239 BYTECODE(DoubleIsInfinite, A_D); 2241 BYTECODE(DoubleIsInfinite, A);
2240 const double v = bit_cast<double, RawObject*>(FP[rD]); 2242 const double v = bit_cast<double, RawObject*>(FP[rA]);
2241 FP[rA] = isinf(v) ? true_value : false_value; 2243 if (!isinf(v)) {
2244 pc++;
2245 }
2242 DISPATCH(); 2246 DISPATCH();
2243 } 2247 }
2244 2248
2245 { 2249 {
2246 BYTECODE(LoadIndexedFloat32, A_B_C); 2250 BYTECODE(LoadIndexedFloat32, A_B_C);
2247 uint8_t* data = SimulatorHelpers::GetTypedData(FP[rB], FP[rC]); 2251 uint8_t* data = SimulatorHelpers::GetTypedData(FP[rB], FP[rC]);
2248 const uint32_t value = *reinterpret_cast<uint32_t*>(data); 2252 const uint32_t value = *reinterpret_cast<uint32_t*>(data);
2249 const uint64_t value64 = value; 2253 const uint64_t value64 = value;
2250 FP[rA] = reinterpret_cast<RawObject*>(value64); 2254 FP[rA] = reinterpret_cast<RawObject*>(value64);
2251 DISPATCH(); 2255 DISPATCH();
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after
3738 pc_ = pc; 3742 pc_ = pc;
3739 special_[kExceptionSpecialIndex] = raw_exception; 3743 special_[kExceptionSpecialIndex] = raw_exception;
3740 special_[kStacktraceSpecialIndex] = raw_stacktrace; 3744 special_[kStacktraceSpecialIndex] = raw_stacktrace;
3741 buf->Longjmp(); 3745 buf->Longjmp();
3742 UNREACHABLE(); 3746 UNREACHABLE();
3743 } 3747 }
3744 3748
3745 } // namespace dart 3749 } // namespace dart
3746 3750
3747 #endif // defined TARGET_ARCH_DBC 3751 #endif // defined TARGET_ARCH_DBC
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698