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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 1670113004: VM: Optimized calls to asin, acos, tan. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/flow_graph_optimizer.cc ('k') | runtime/vm/method_recognizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index ba426c8594450daaf4584da1ad841e63fc96bc0f..bcc0a91645e63a4a334e9748e4b805b408bef76d 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -3544,6 +3544,9 @@ intptr_t InvokeMathCFunctionInstr::ArgumentCountFor(
}
case MethodRecognizer::kDoubleRound:
case MethodRecognizer::kMathAtan:
+ case MethodRecognizer::kMathTan:
+ case MethodRecognizer::kMathAcos:
+ case MethodRecognizer::kMathAsin:
return 1;
case MethodRecognizer::kDoubleMod:
case MethodRecognizer::kMathDoublePow:
@@ -3587,6 +3590,30 @@ DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcRound, 1, true /* is_float */,
reinterpret_cast<RuntimeFunction>(
static_cast<UnaryMathCFunction>(&round)));
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcCos, 1, true /* is_float */,
+ reinterpret_cast<RuntimeFunction>(
+ static_cast<UnaryMathCFunction>(&cos)));
+
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcSin, 1, true /* is_float */,
+ reinterpret_cast<RuntimeFunction>(
+ static_cast<UnaryMathCFunction>(&sin)));
+
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcAsin, 1, true /* is_float */,
+ reinterpret_cast<RuntimeFunction>(
+ static_cast<UnaryMathCFunction>(&asin)));
+
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcAcos, 1, true /* is_float */,
+ reinterpret_cast<RuntimeFunction>(
+ static_cast<UnaryMathCFunction>(&acos)));
+
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcTan, 1, true /* is_float */,
+ reinterpret_cast<RuntimeFunction>(
+ static_cast<UnaryMathCFunction>(&tan)));
+
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcAtan, 1, true /* is_float */,
+ reinterpret_cast<RuntimeFunction>(
+ static_cast<UnaryMathCFunction>(&atan)));
+
const RuntimeEntry& InvokeMathCFunctionInstr::TargetFunction() const {
switch (recognized_kind_) {
@@ -3602,6 +3629,12 @@ const RuntimeEntry& InvokeMathCFunctionInstr::TargetFunction() const {
return kLibcPowRuntimeEntry;
case MethodRecognizer::kDoubleMod:
return kDartModuloRuntimeEntry;
+ case MethodRecognizer::kMathTan:
+ return kLibcTanRuntimeEntry;
+ case MethodRecognizer::kMathAsin:
+ return kLibcAsinRuntimeEntry;
+ case MethodRecognizer::kMathAcos:
+ return kLibcAcosRuntimeEntry;
case MethodRecognizer::kMathAtan:
return kLibcAtanRuntimeEntry;
case MethodRecognizer::kMathAtan2:
@@ -3613,18 +3646,6 @@ const RuntimeEntry& InvokeMathCFunctionInstr::TargetFunction() const {
}
-DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcCos, 1, true /* is_float */,
- reinterpret_cast<RuntimeFunction>(
- static_cast<UnaryMathCFunction>(&cos)));
-
-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()) {
case MathUnaryInstr::kSin:
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/method_recognizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698