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

Unified Diff: runtime/platform/utils_fuchsia.h

Issue 2158673002: Fuchsia: Hello, Fuchsia! (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge, cleanup Created 4 years, 5 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/bin/fuchsia_test.cc ('k') | runtime/vm/os_fuchsia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/utils_fuchsia.h
diff --git a/runtime/platform/utils_fuchsia.h b/runtime/platform/utils_fuchsia.h
index 705422587974855b16149d441460869dd6b08558..a44fcb8b4869e17a43485bf5671cfbece9343122 100644
--- a/runtime/platform/utils_fuchsia.h
+++ b/runtime/platform/utils_fuchsia.h
@@ -10,14 +10,24 @@
namespace dart {
inline int Utils::CountLeadingZeros(uword x) {
- UNIMPLEMENTED();
- return 0;
+#if defined(ARCH_IS_32_BIT)
+ return __builtin_clzl(x);
+#elif defined(ARCH_IS_64_BIT)
+ return __builtin_clzll(x);
+#else
+#error Architecture is not 32-bit or 64-bit.
+#endif
}
inline int Utils::CountTrailingZeros(uword x) {
- UNIMPLEMENTED();
- return 0;
+#if defined(ARCH_IS_32_BIT)
+ return __builtin_ctzl(x);
+#elif defined(ARCH_IS_64_BIT)
+ return __builtin_ctzll(x);
+#else
+#error Architecture is not 32-bit or 64-bit.
+#endif
}
« no previous file with comments | « runtime/bin/fuchsia_test.cc ('k') | runtime/vm/os_fuchsia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698