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

Side by Side Diff: src/hydrogen-instructions.cc

Issue 494633002: Fix implementation of bit count functions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 | « src/heap/mark-compact.cc ('k') | src/mips/simulator-mips.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/base/bits.h"
7 #include "src/double.h" 8 #include "src/double.h"
8 #include "src/factory.h" 9 #include "src/factory.h"
9 #include "src/hydrogen-infer-representation.h" 10 #include "src/hydrogen-infer-representation.h"
10 #include "src/property-details-inl.h" 11 #include "src/property-details-inl.h"
11 12
12 #if V8_TARGET_ARCH_IA32 13 #if V8_TARGET_ARCH_IA32
13 #include "src/ia32/lithium-ia32.h" // NOLINT 14 #include "src/ia32/lithium-ia32.h" // NOLINT
14 #elif V8_TARGET_ARCH_X64 15 #elif V8_TARGET_ARCH_X64
15 #include "src/x64/lithium-x64.h" // NOLINT 16 #include "src/x64/lithium-x64.h" // NOLINT
16 #elif V8_TARGET_ARCH_ARM64 17 #elif V8_TARGET_ARCH_ARM64
(...skipping 4155 matching lines...) Expand 10 before | Expand all | Expand 10 after
4172 // Doubles are represented as Significant * 2 ^ Exponent. If the 4173 // Doubles are represented as Significant * 2 ^ Exponent. If the
4173 // Exponent is not negative, the double value is already an integer. 4174 // Exponent is not negative, the double value is already an integer.
4174 if (Double(d).Exponent() >= 0) return H_CONSTANT_DOUBLE(d); 4175 if (Double(d).Exponent() >= 0) return H_CONSTANT_DOUBLE(d);
4175 return H_CONSTANT_DOUBLE(Floor(d + 0.5)); 4176 return H_CONSTANT_DOUBLE(Floor(d + 0.5));
4176 case kMathFround: 4177 case kMathFround:
4177 return H_CONSTANT_DOUBLE(static_cast<double>(static_cast<float>(d))); 4178 return H_CONSTANT_DOUBLE(static_cast<double>(static_cast<float>(d)));
4178 case kMathFloor: 4179 case kMathFloor:
4179 return H_CONSTANT_DOUBLE(Floor(d)); 4180 return H_CONSTANT_DOUBLE(Floor(d));
4180 case kMathClz32: { 4181 case kMathClz32: {
4181 uint32_t i = DoubleToUint32(d); 4182 uint32_t i = DoubleToUint32(d);
4182 return H_CONSTANT_INT( 4183 return H_CONSTANT_INT(base::bits::CountLeadingZeros32(i));
4183 (i == 0) ? 32 : CompilerIntrinsics::CountLeadingZeros(i));
4184 } 4184 }
4185 default: 4185 default:
4186 UNREACHABLE(); 4186 UNREACHABLE();
4187 break; 4187 break;
4188 } 4188 }
4189 } while (false); 4189 } while (false);
4190 return new(zone) HUnaryMathOperation(context, value, op); 4190 return new(zone) HUnaryMathOperation(context, value, op);
4191 } 4191 }
4192 4192
4193 4193
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
4782 break; 4782 break;
4783 case HObjectAccess::kExternalMemory: 4783 case HObjectAccess::kExternalMemory:
4784 os << "[external-memory]"; 4784 os << "[external-memory]";
4785 break; 4785 break;
4786 } 4786 }
4787 4787
4788 return os << "@" << access.offset(); 4788 return os << "@" << access.offset();
4789 } 4789 }
4790 4790
4791 } } // namespace v8::internal 4791 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/mips/simulator-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698