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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 1662153002: VM: Support fast calls to atan and atan2 in optimized code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: cleanup Created 4 years, 11 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/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 9aa7cd5d10e11a570dc91fc0a9d07ec9f3fca82d..604417eb08655d160af4abe1772aefe05a4c7934 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -3543,9 +3543,11 @@ intptr_t InvokeMathCFunctionInstr::ArgumentCountFor(
return 1;
}
case MethodRecognizer::kDoubleRound:
+ case MethodRecognizer::kMathAtan:
return 1;
case MethodRecognizer::kDoubleMod:
case MethodRecognizer::kMathDoublePow:
+ case MethodRecognizer::kMathAtan2:
return 2;
default:
UNREACHABLE();
@@ -3565,6 +3567,10 @@ DEFINE_RAW_LEAF_RUNTIME_ENTRY(DartModulo, 2, true /* is_float */,
reinterpret_cast<RuntimeFunction>(
static_cast<BinaryMathCFunction>(&DartModulo)));
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcAtan2, 2, true /* is_float */,
+ reinterpret_cast<RuntimeFunction>(
+ static_cast<BinaryMathCFunction>(&atan2)));
Vyacheslav Egorov (Google) 2016/02/04 10:30:58 I think this has to call to atan2_ieee to workarou
Florian Schneider 2016/02/04 21:41:49 Yes. Done.
+
DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcFloor, 1, true /* is_float */,
reinterpret_cast<RuntimeFunction>(
static_cast<UnaryMathCFunction>(&floor)));
@@ -3596,6 +3602,10 @@ const RuntimeEntry& InvokeMathCFunctionInstr::TargetFunction() const {
return kLibcPowRuntimeEntry;
case MethodRecognizer::kDoubleMod:
return kDartModuloRuntimeEntry;
+ case MethodRecognizer::kMathAtan:
+ return kLibcAtanRuntimeEntry;
+ case MethodRecognizer::kMathAtan2:
+ return kLibcAtan2RuntimeEntry;
default:
UNREACHABLE();
}
@@ -3611,6 +3621,9 @@ DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcSin, 1, true /* is_float */,
reinterpret_cast<RuntimeFunction>(
static_cast<UnaryMathCFunction>(&sin)));
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcAtan, 1, true /* is_float */,
+ reinterpret_cast<RuntimeFunction>(
+ static_cast<UnaryMathCFunction>(&atan)));
const RuntimeEntry& MathUnaryInstr::TargetFunction() const {
switch (kind()) {

Powered by Google App Engine
This is Rietveld 408576698