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

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

Issue 2505003002: Revert of [Turbofan] CodeGenerator for ARM avoids moves from VFP to general regs. (Closed)
Patch Set: Created 4 years, 1 month 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/arm/macro-assembler-arm.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/arm/macro-assembler-arm.h" 7 #include "src/arm/macro-assembler-arm.h"
8 #include "src/compilation-info.h" 8 #include "src/compilation-info.h"
9 #include "src/compiler/code-generator-impl.h" 9 #include "src/compiler/code-generator-impl.h"
10 #include "src/compiler/gap-resolver.h" 10 #include "src/compiler/gap-resolver.h"
(...skipping 1880 matching lines...) Expand 10 before | Expand all | Expand 10 after
1891 DCHECK(destination->IsDoubleStackSlot()); 1891 DCHECK(destination->IsDoubleStackSlot());
1892 __ vstr(src, g.ToMemOperand(destination)); 1892 __ vstr(src, g.ToMemOperand(destination));
1893 } 1893 }
1894 } else { 1894 } else {
1895 DCHECK_EQ(MachineRepresentation::kFloat32, rep); 1895 DCHECK_EQ(MachineRepresentation::kFloat32, rep);
1896 // GapResolver may give us reg codes that don't map to actual s-registers. 1896 // GapResolver may give us reg codes that don't map to actual s-registers.
1897 // Generate code to work around those cases. 1897 // Generate code to work around those cases.
1898 int src_code = LocationOperand::cast(source)->register_code(); 1898 int src_code = LocationOperand::cast(source)->register_code();
1899 if (destination->IsFloatRegister()) { 1899 if (destination->IsFloatRegister()) {
1900 int dst_code = LocationOperand::cast(destination)->register_code(); 1900 int dst_code = LocationOperand::cast(destination)->register_code();
1901 __ VmovExtended(dst_code, src_code); 1901 __ VmovExtended(dst_code, src_code, kScratchReg);
1902 } else { 1902 } else {
1903 DCHECK(destination->IsFloatStackSlot()); 1903 DCHECK(destination->IsFloatStackSlot());
1904 __ VmovExtended(g.ToMemOperand(destination), src_code); 1904 __ VmovExtended(g.ToMemOperand(destination), src_code, kScratchReg);
1905 } 1905 }
1906 } 1906 }
1907 } else if (source->IsFPStackSlot()) { 1907 } else if (source->IsFPStackSlot()) {
1908 MemOperand src = g.ToMemOperand(source); 1908 MemOperand src = g.ToMemOperand(source);
1909 MachineRepresentation rep = 1909 MachineRepresentation rep =
1910 LocationOperand::cast(destination)->representation(); 1910 LocationOperand::cast(destination)->representation();
1911 if (destination->IsFPRegister()) { 1911 if (destination->IsFPRegister()) {
1912 if (rep == MachineRepresentation::kFloat64) { 1912 if (rep == MachineRepresentation::kFloat64) {
1913 __ vldr(g.ToDoubleRegister(destination), src); 1913 __ vldr(g.ToDoubleRegister(destination), src);
1914 } else { 1914 } else {
1915 DCHECK_EQ(MachineRepresentation::kFloat32, rep); 1915 DCHECK_EQ(MachineRepresentation::kFloat32, rep);
1916 // GapResolver may give us reg codes that don't map to actual 1916 // GapResolver may give us reg codes that don't map to actual
1917 // s-registers. Generate code to work around those cases. 1917 // s-registers. Generate code to work around those cases.
1918 int dst_code = LocationOperand::cast(destination)->register_code(); 1918 int dst_code = LocationOperand::cast(destination)->register_code();
1919 __ VmovExtended(dst_code, src); 1919 __ VmovExtended(dst_code, src, kScratchReg);
1920 } 1920 }
1921 } else { 1921 } else {
1922 DCHECK(destination->IsFPStackSlot()); 1922 DCHECK(destination->IsFPStackSlot());
1923 if (rep == MachineRepresentation::kFloat64) { 1923 if (rep == MachineRepresentation::kFloat64) {
1924 DwVfpRegister temp = kScratchDoubleReg; 1924 DwVfpRegister temp = kScratchDoubleReg;
1925 __ vldr(temp, src); 1925 __ vldr(temp, src);
1926 __ vstr(temp, g.ToMemOperand(destination)); 1926 __ vstr(temp, g.ToMemOperand(destination));
1927 } else { 1927 } else {
1928 DCHECK_EQ(MachineRepresentation::kFloat32, rep); 1928 DCHECK_EQ(MachineRepresentation::kFloat32, rep);
1929 SwVfpRegister temp = kScratchDoubleReg.low(); 1929 SwVfpRegister temp = kScratchDoubleReg.low();
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1981 MemOperand dst = g.ToMemOperand(destination); 1981 MemOperand dst = g.ToMemOperand(destination);
1982 __ Move(temp, src); 1982 __ Move(temp, src);
1983 __ vldr(src, dst); 1983 __ vldr(src, dst);
1984 __ vstr(temp, dst); 1984 __ vstr(temp, dst);
1985 } 1985 }
1986 } else { 1986 } else {
1987 DCHECK_EQ(MachineRepresentation::kFloat32, rep); 1987 DCHECK_EQ(MachineRepresentation::kFloat32, rep);
1988 int src_code = LocationOperand::cast(source)->register_code(); 1988 int src_code = LocationOperand::cast(source)->register_code();
1989 if (destination->IsFPRegister()) { 1989 if (destination->IsFPRegister()) {
1990 int dst_code = LocationOperand::cast(destination)->register_code(); 1990 int dst_code = LocationOperand::cast(destination)->register_code();
1991 __ VswpExtended(dst_code, src_code); 1991 __ VmovExtended(temp.low().code(), src_code, kScratchReg);
1992 __ VmovExtended(src_code, dst_code, kScratchReg);
1993 __ VmovExtended(dst_code, temp.low().code(), kScratchReg);
1992 } else { 1994 } else {
1993 DCHECK(destination->IsFPStackSlot()); 1995 DCHECK(destination->IsFPStackSlot());
1994 MemOperand dst = g.ToMemOperand(destination); 1996 MemOperand dst = g.ToMemOperand(destination);
1995 __ VswpExtended(dst, src_code); 1997 __ VmovExtended(temp.low().code(), src_code, kScratchReg);
1998 __ VmovExtended(src_code, dst, kScratchReg);
1999 __ vstr(temp.low(), dst);
1996 } 2000 }
1997 } 2001 }
1998 } else if (source->IsFPStackSlot()) { 2002 } else if (source->IsFPStackSlot()) {
1999 DCHECK(destination->IsFPStackSlot()); 2003 DCHECK(destination->IsFPStackSlot());
2000 Register temp_0 = kScratchReg; 2004 Register temp_0 = kScratchReg;
2001 LowDwVfpRegister temp_1 = kScratchDoubleReg; 2005 LowDwVfpRegister temp_1 = kScratchDoubleReg;
2002 MemOperand src0 = g.ToMemOperand(source); 2006 MemOperand src0 = g.ToMemOperand(source);
2003 MemOperand dst0 = g.ToMemOperand(destination); 2007 MemOperand dst0 = g.ToMemOperand(destination);
2004 MachineRepresentation rep = LocationOperand::cast(source)->representation(); 2008 MachineRepresentation rep = LocationOperand::cast(source)->representation();
2005 if (rep == MachineRepresentation::kFloat64) { 2009 if (rep == MachineRepresentation::kFloat64) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
2049 padding_size -= v8::internal::Assembler::kInstrSize; 2053 padding_size -= v8::internal::Assembler::kInstrSize;
2050 } 2054 }
2051 } 2055 }
2052 } 2056 }
2053 2057
2054 #undef __ 2058 #undef __
2055 2059
2056 } // namespace compiler 2060 } // namespace compiler
2057 } // namespace internal 2061 } // namespace internal
2058 } // namespace v8 2062 } // namespace v8
OLDNEW
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698