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

Side by Side Diff: runtime/platform/utils_win.h

Issue 10806078: Improve the performance of bit set searches with a compiler intrinsic. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address review comments Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/platform/utils_macos.h ('k') | runtime/vm/bit_set.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 #ifndef PLATFORM_UTILS_WIN_H_
6 #define PLATFORM_UTILS_WIN_H_
7
8 #include <intrin.h>
9
10 namespace dart {
11
12 inline int Utils::CountTrailingZeros(uint32_t x) {
13 unsigned long result; // NOLINT
14 _BitScanReverse(&result, x);
15 return reinterpret_cast<int>(result);
16 };
17
18 inline int Utils::CountTrailingZeros(uint64_t x) {
19 unsigned long result; // NOLINT
20 _BitScanReverse64(&result, x);
21 return reinterpret_cast<int>(result);
22 };
23
24 } // namespace dart
25
26 #endif // PLATFORM_UTILS_WIN_H_
OLDNEW
« no previous file with comments | « runtime/platform/utils_macos.h ('k') | runtime/vm/bit_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698