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

Side by Side Diff: src/ia32/lithium-codegen-ia32.cc

Issue 553843002: Replace our home-grown BitCast with bit_cast from Chrome/Google3. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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/ia32/code-stubs-ia32.cc ('k') | src/ia32/lithium-gap-resolver-ia32.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 #if V8_TARGET_ARCH_IA32 7 #if V8_TARGET_ARCH_IA32
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after
1708 } 1708 }
1709 1709
1710 1710
1711 void LCodeGen::DoConstantS(LConstantS* instr) { 1711 void LCodeGen::DoConstantS(LConstantS* instr) {
1712 __ Move(ToRegister(instr->result()), Immediate(instr->value())); 1712 __ Move(ToRegister(instr->result()), Immediate(instr->value()));
1713 } 1713 }
1714 1714
1715 1715
1716 void LCodeGen::DoConstantD(LConstantD* instr) { 1716 void LCodeGen::DoConstantD(LConstantD* instr) {
1717 double v = instr->value(); 1717 double v = instr->value();
1718 uint64_t int_val = BitCast<uint64_t, double>(v); 1718 uint64_t int_val = bit_cast<uint64_t, double>(v);
1719 int32_t lower = static_cast<int32_t>(int_val); 1719 int32_t lower = static_cast<int32_t>(int_val);
1720 int32_t upper = static_cast<int32_t>(int_val >> (kBitsPerInt)); 1720 int32_t upper = static_cast<int32_t>(int_val >> (kBitsPerInt));
1721 DCHECK(instr->result()->IsDoubleRegister()); 1721 DCHECK(instr->result()->IsDoubleRegister());
1722 1722
1723 XMMRegister res = ToDoubleRegister(instr->result()); 1723 XMMRegister res = ToDoubleRegister(instr->result());
1724 if (int_val == 0) { 1724 if (int_val == 0) {
1725 __ xorps(res, res); 1725 __ xorps(res, res);
1726 } else { 1726 } else {
1727 Register temp = ToRegister(instr->temp()); 1727 Register temp = ToRegister(instr->temp());
1728 if (CpuFeatures::IsSupported(SSE4_1)) { 1728 if (CpuFeatures::IsSupported(SSE4_1)) {
(...skipping 3941 matching lines...) Expand 10 before | Expand all | Expand 10 after
5670 CallRuntime(Runtime::kPushBlockContext, 2, instr); 5670 CallRuntime(Runtime::kPushBlockContext, 2, instr);
5671 RecordSafepoint(Safepoint::kNoLazyDeopt); 5671 RecordSafepoint(Safepoint::kNoLazyDeopt);
5672 } 5672 }
5673 5673
5674 5674
5675 #undef __ 5675 #undef __
5676 5676
5677 } } // namespace v8::internal 5677 } } // namespace v8::internal
5678 5678
5679 #endif // V8_TARGET_ARCH_IA32 5679 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « src/ia32/code-stubs-ia32.cc ('k') | src/ia32/lithium-gap-resolver-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698