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

Unified Diff: runtime/vm/simulator_dbc.cc

Issue 2341683003: DBC: Double converstion instructions (Closed)
Patch Set: Fix FloatToDouble Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/simulator_dbc.cc
diff --git a/runtime/vm/simulator_dbc.cc b/runtime/vm/simulator_dbc.cc
index 53f637ad7ca3075b145ebcf47ff7bbc63c74f3f5..e05abeaf6e2c7f19ddbef129012e7650ef73ffd7 100644
--- a/runtime/vm/simulator_dbc.cc
+++ b/runtime/vm/simulator_dbc.cc
@@ -1969,6 +1969,43 @@ RawObject* Simulator::Call(const Code& code,
}
{
+ BYTECODE(DTruncate, A_D);
+ const double value = bit_cast<double, RawObject*>(FP[rD]);
+ FP[rA] = bit_cast<RawObject*, double>(trunc(value));
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(DFloor, A_D);
+ const double value = bit_cast<double, RawObject*>(FP[rD]);
+ FP[rA] = bit_cast<RawObject*, double>(floor(value));
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(DCeil, A_D);
+ const double value = bit_cast<double, RawObject*>(FP[rD]);
+ FP[rA] = bit_cast<RawObject*, double>(ceil(value));
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(DoubleToFloat, A_D);
+ const double value = bit_cast<double, RawObject*>(FP[rD]);
+ const float valuef = static_cast<float>(value);
+ *reinterpret_cast<float*>(&FP[rA]) = valuef;
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(FloatToDouble, A_D);
+ const float valuef = *reinterpret_cast<float*>(&FP[rD]);
+ const double value = static_cast<double>(valuef);
+ FP[rA] = bit_cast<RawObject*, double>(value);
+ DISPATCH();
+ }
+
+ {
BYTECODE(LoadIndexedFloat64, A_B_C);
uint8_t* data = SimulatorHelpers::GetTypedData(FP[rB], FP[rC], 3);
*reinterpret_cast<uint64_t*>(&FP[rA]) = *reinterpret_cast<uint64_t*>(data);
@@ -2126,6 +2163,36 @@ RawObject* Simulator::Call(const Code& code,
}
{
+ BYTECODE(DTruncate, A_D);
+ UNREACHABLE();
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(DFloor, A_D);
+ UNREACHABLE();
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(DCeil, A_D);
+ UNREACHABLE();
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(DoubleToFloat, A_D);
+ UNREACHABLE();
+ DISPATCH();
+ }
+
+ {
+ BYTECODE(FloatToDouble, A_D);
+ UNREACHABLE();
+ DISPATCH();
+ }
+
+ {
BYTECODE(LoadIndexedFloat64, A_B_C);
UNREACHABLE();
DISPATCH();
« runtime/vm/intermediate_language_dbc.cc ('K') | « runtime/vm/intermediate_language_dbc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698