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

Unified Diff: runtime/vm/intermediate_language_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
« no previous file with comments | « runtime/vm/constants_dbc.h ('k') | runtime/vm/simulator_dbc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_dbc.cc
diff --git a/runtime/vm/intermediate_language_dbc.cc b/runtime/vm/intermediate_language_dbc.cc
index 3566b6c4aeea2d93e78152b22c0c0335b9af7c4e..0c7aec875d911344cc62bb88e77409a530e8f666 100644
--- a/runtime/vm/intermediate_language_dbc.cc
+++ b/runtime/vm/intermediate_language_dbc.cc
@@ -34,9 +34,6 @@ DECLARE_FLAG(int, optimization_counter_threshold);
M(BinaryInt32Op) \
M(Int32ToDouble) \
M(DoubleToInteger) \
- M(DoubleToDouble) \
- M(DoubleToFloat) \
- M(FloatToDouble) \
M(BoxInt64) \
M(MergedMath) \
M(GuardFieldClass) \
@@ -1597,6 +1594,39 @@ EMIT_NATIVE_CODE(MathUnary, 1, Location::RequiresRegister()) {
}
+EMIT_NATIVE_CODE(DoubleToDouble, 1, Location::RequiresRegister()) {
+ const Register in = locs()->in(0).reg();
+ const Register result = locs()->out(0).reg();
+ switch (recognized_kind()) {
+ case MethodRecognizer::kDoubleTruncate:
+ __ DTruncate(result, in);
+ break;
+ case MethodRecognizer::kDoubleFloor:
+ __ DFloor(result, in);
+ break;
+ case MethodRecognizer::kDoubleCeil:
+ __ DCeil(result, in);
+ break;
+ default:
+ UNREACHABLE();
+ }
+}
+
+
+EMIT_NATIVE_CODE(DoubleToFloat, 1, Location::RequiresRegister()) {
Florian Schneider 2016/09/15 02:02:26 This won't be tested until you have support for op
zra 2016/09/15 15:09:31 Done.
+ const Register in = locs()->in(0).reg();
+ const Register result = locs()->out(0).reg();
+ __ DoubleToFloat(result, in);
+}
+
+
+EMIT_NATIVE_CODE(FloatToDouble, 1, Location::RequiresRegister()) {
Florian Schneider 2016/09/15 02:02:26 Same comment as above.
zra 2016/09/15 15:09:30 Done.
+ const Register in = locs()->in(0).reg();
+ const Register result = locs()->out(0).reg();
+ __ FloatToDouble(result, in);
+}
+
+
EMIT_NATIVE_CODE(InvokeMathCFunction,
InputCount(), Location::RequiresRegister()) {
const Register left = locs()->in(0).reg();
« no previous file with comments | « runtime/vm/constants_dbc.h ('k') | runtime/vm/simulator_dbc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698