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

Side by Side Diff: src/compiler/x64/code-generator-x64.cc

Issue 658813003: [x64] simply tweak materialization of float/double constants (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | « no previous file | src/x64/assembler-x64.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 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 break; 888 break;
889 case Constant::kHeapObject: 889 case Constant::kHeapObject:
890 __ Move(dst, src.ToHeapObject()); 890 __ Move(dst, src.ToHeapObject());
891 break; 891 break;
892 } 892 }
893 if (destination->IsStackSlot()) { 893 if (destination->IsStackSlot()) {
894 __ movq(g.ToOperand(destination), kScratchRegister); 894 __ movq(g.ToOperand(destination), kScratchRegister);
895 } 895 }
896 } else if (src.type() == Constant::kFloat32) { 896 } else if (src.type() == Constant::kFloat32) {
897 // TODO(turbofan): Can we do better here? 897 // TODO(turbofan): Can we do better here?
898 __ movl(kScratchRegister, Immediate(bit_cast<int32_t>(src.ToFloat32()))); 898 uint32_t src_const = bit_cast<uint32_t>(src.ToFloat32());
899 if (destination->IsDoubleRegister()) { 899 if (destination->IsDoubleRegister()) {
900 XMMRegister dst = g.ToDoubleRegister(destination); 900 __ Move(g.ToDoubleRegister(destination), src_const);
901 __ movq(dst, kScratchRegister);
902 } else { 901 } else {
903 DCHECK(destination->IsDoubleStackSlot()); 902 DCHECK(destination->IsDoubleStackSlot());
904 Operand dst = g.ToOperand(destination); 903 Operand dst = g.ToOperand(destination);
905 __ movl(dst, kScratchRegister); 904 __ movl(dst, Immediate(src_const));
906 } 905 }
907 } else { 906 } else {
908 DCHECK_EQ(Constant::kFloat64, src.type()); 907 DCHECK_EQ(Constant::kFloat64, src.type());
909 __ movq(kScratchRegister, bit_cast<int64_t>(src.ToFloat64())); 908 uint64_t src_const = bit_cast<uint64_t>(src.ToFloat64());
910 if (destination->IsDoubleRegister()) { 909 if (destination->IsDoubleRegister()) {
911 __ movq(g.ToDoubleRegister(destination), kScratchRegister); 910 __ Move(g.ToDoubleRegister(destination), src_const);
912 } else { 911 } else {
913 DCHECK(destination->IsDoubleStackSlot()); 912 DCHECK(destination->IsDoubleStackSlot());
913 __ movq(kScratchRegister, src_const);
914 __ movq(g.ToOperand(destination), kScratchRegister); 914 __ movq(g.ToOperand(destination), kScratchRegister);
915 } 915 }
916 } 916 }
917 } else if (source->IsDoubleRegister()) { 917 } else if (source->IsDoubleRegister()) {
918 XMMRegister src = g.ToDoubleRegister(source); 918 XMMRegister src = g.ToDoubleRegister(source);
919 if (destination->IsDoubleRegister()) { 919 if (destination->IsDoubleRegister()) {
920 XMMRegister dst = g.ToDoubleRegister(destination); 920 XMMRegister dst = g.ToDoubleRegister(destination);
921 __ movsd(dst, src); 921 __ movsd(dst, src);
922 } else { 922 } else {
923 DCHECK(destination->IsDoubleStackSlot()); 923 DCHECK(destination->IsDoubleStackSlot());
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 } 1002 }
1003 } 1003 }
1004 MarkLazyDeoptSite(); 1004 MarkLazyDeoptSite();
1005 } 1005 }
1006 1006
1007 #undef __ 1007 #undef __
1008 1008
1009 } // namespace internal 1009 } // namespace internal
1010 } // namespace compiler 1010 } // namespace compiler
1011 } // namespace v8 1011 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/x64/assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698