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

Side by Side Diff: src/compiler/ia32/code-generator-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/compiler/common-node-cache.h ('k') | src/compiler/instruction.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 #include "src/compiler/code-generator.h" 5 #include "src/compiler/code-generator.h"
6 6
7 #include "src/compiler/code-generator-impl.h" 7 #include "src/compiler/code-generator-impl.h"
8 #include "src/compiler/gap-resolver.h" 8 #include "src/compiler/gap-resolver.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/node-properties-inl.h" 10 #include "src/compiler/node-properties-inl.h"
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 } 840 }
841 } 841 }
842 } else if (destination->IsRegister()) { 842 } else if (destination->IsRegister()) {
843 Register dst = g.ToRegister(destination); 843 Register dst = g.ToRegister(destination);
844 __ mov(dst, g.ToImmediate(source)); 844 __ mov(dst, g.ToImmediate(source));
845 } else if (destination->IsStackSlot()) { 845 } else if (destination->IsStackSlot()) {
846 Operand dst = g.ToOperand(destination); 846 Operand dst = g.ToOperand(destination);
847 __ mov(dst, g.ToImmediate(source)); 847 __ mov(dst, g.ToImmediate(source));
848 } else { 848 } else {
849 double v = g.ToDouble(source); 849 double v = g.ToDouble(source);
850 uint64_t int_val = BitCast<uint64_t, double>(v); 850 uint64_t int_val = bit_cast<uint64_t, double>(v);
851 int32_t lower = static_cast<int32_t>(int_val); 851 int32_t lower = static_cast<int32_t>(int_val);
852 int32_t upper = static_cast<int32_t>(int_val >> kBitsPerInt); 852 int32_t upper = static_cast<int32_t>(int_val >> kBitsPerInt);
853 if (destination->IsDoubleRegister()) { 853 if (destination->IsDoubleRegister()) {
854 XMMRegister dst = g.ToDoubleRegister(destination); 854 XMMRegister dst = g.ToDoubleRegister(destination);
855 __ Move(dst, v); 855 __ Move(dst, v);
856 } else { 856 } else {
857 DCHECK(destination->IsDoubleStackSlot()); 857 DCHECK(destination->IsDoubleStackSlot());
858 Operand dst0 = g.ToOperand(destination); 858 Operand dst0 = g.ToOperand(destination);
859 Operand dst1 = g.HighOperand(destination); 859 Operand dst1 = g.HighOperand(destination);
860 __ mov(dst0, Immediate(lower)); 860 __ mov(dst0, Immediate(lower));
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 } 945 }
946 946
947 947
948 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); } 948 void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); }
949 949
950 #undef __ 950 #undef __
951 951
952 } // namespace compiler 952 } // namespace compiler
953 } // namespace internal 953 } // namespace internal
954 } // namespace v8 954 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/common-node-cache.h ('k') | src/compiler/instruction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698