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

Side by Side Diff: src/arm64/utils-arm64.cc

Issue 1131573006: ARM64: Enable shorten-64-to-32 warning (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « src/arm64/utils-arm64.h ('k') | src/base/bits.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_ARM64 5 #if V8_TARGET_ARCH_ARM64
6 6
7 #include "src/arm64/utils-arm64.h" 7 #include "src/arm64/utils-arm64.h"
8 8
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // value = h+g+f+e d+c+b+a 67 // value = h+g+f+e d+c+b+a
68 // \ | 68 // \ |
69 // value = h+g+f+e+d+c+b+a 69 // value = h+g+f+e+d+c+b+a
70 value = ((value >> 1) & 0x5555555555555555) + (value & 0x5555555555555555); 70 value = ((value >> 1) & 0x5555555555555555) + (value & 0x5555555555555555);
71 value = ((value >> 2) & 0x3333333333333333) + (value & 0x3333333333333333); 71 value = ((value >> 2) & 0x3333333333333333) + (value & 0x3333333333333333);
72 value = ((value >> 4) & 0x0f0f0f0f0f0f0f0f) + (value & 0x0f0f0f0f0f0f0f0f); 72 value = ((value >> 4) & 0x0f0f0f0f0f0f0f0f) + (value & 0x0f0f0f0f0f0f0f0f);
73 value = ((value >> 8) & 0x00ff00ff00ff00ff) + (value & 0x00ff00ff00ff00ff); 73 value = ((value >> 8) & 0x00ff00ff00ff00ff) + (value & 0x00ff00ff00ff00ff);
74 value = ((value >> 16) & 0x0000ffff0000ffff) + (value & 0x0000ffff0000ffff); 74 value = ((value >> 16) & 0x0000ffff0000ffff) + (value & 0x0000ffff0000ffff);
75 value = ((value >> 32) & 0x00000000ffffffff) + (value & 0x00000000ffffffff); 75 value = ((value >> 32) & 0x00000000ffffffff) + (value & 0x00000000ffffffff);
76 76
77 return value; 77 return static_cast<int>(value);
78 } 78 }
79 79
80 80
81 uint64_t LargestPowerOf2Divisor(uint64_t value) { 81 uint64_t LargestPowerOf2Divisor(uint64_t value) {
82 return value & -value; 82 return value & -value;
83 } 83 }
84 84
85 85
86 int MaskToBit(uint64_t mask) { 86 int MaskToBit(uint64_t mask) {
87 DCHECK(CountSetBits(mask, 64) == 1); 87 DCHECK(CountSetBits(mask, 64) == 1);
88 return CountTrailingZeros(mask, 64); 88 return CountTrailingZeros(mask, 64);
89 } 89 }
90 90
91 91
92 } } // namespace v8::internal 92 } } // namespace v8::internal
93 93
94 #endif // V8_TARGET_ARCH_ARM64 94 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/arm64/utils-arm64.h ('k') | src/base/bits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698