OLD | NEW |
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 Loading... |
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, kScratchReg); | 1901 __ VmovExtended(dst_code, src_code); |
1902 } else { | 1902 } else { |
1903 DCHECK(destination->IsFloatStackSlot()); | 1903 DCHECK(destination->IsFloatStackSlot()); |
1904 __ VmovExtended(g.ToMemOperand(destination), src_code, kScratchReg); | 1904 __ VmovExtended(g.ToMemOperand(destination), src_code); |
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, kScratchReg); | 1919 __ VmovExtended(dst_code, src); |
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 Loading... |
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 __ VmovExtended(temp.low().code(), src_code, kScratchReg); | 1991 __ VswpExtended(dst_code, src_code); |
1992 __ VmovExtended(src_code, dst_code, kScratchReg); | |
1993 __ VmovExtended(dst_code, temp.low().code(), kScratchReg); | |
1994 } else { | 1992 } else { |
1995 DCHECK(destination->IsFPStackSlot()); | 1993 DCHECK(destination->IsFPStackSlot()); |
1996 MemOperand dst = g.ToMemOperand(destination); | 1994 MemOperand dst = g.ToMemOperand(destination); |
1997 __ VmovExtended(temp.low().code(), src_code, kScratchReg); | 1995 __ VswpExtended(dst, src_code); |
1998 __ VmovExtended(src_code, dst, kScratchReg); | |
1999 __ vstr(temp.low(), dst); | |
2000 } | 1996 } |
2001 } | 1997 } |
2002 } else if (source->IsFPStackSlot()) { | 1998 } else if (source->IsFPStackSlot()) { |
2003 DCHECK(destination->IsFPStackSlot()); | 1999 DCHECK(destination->IsFPStackSlot()); |
2004 Register temp_0 = kScratchReg; | 2000 Register temp_0 = kScratchReg; |
2005 LowDwVfpRegister temp_1 = kScratchDoubleReg; | 2001 LowDwVfpRegister temp_1 = kScratchDoubleReg; |
2006 MemOperand src0 = g.ToMemOperand(source); | 2002 MemOperand src0 = g.ToMemOperand(source); |
2007 MemOperand dst0 = g.ToMemOperand(destination); | 2003 MemOperand dst0 = g.ToMemOperand(destination); |
2008 MachineRepresentation rep = LocationOperand::cast(source)->representation(); | 2004 MachineRepresentation rep = LocationOperand::cast(source)->representation(); |
2009 if (rep == MachineRepresentation::kFloat64) { | 2005 if (rep == MachineRepresentation::kFloat64) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2053 padding_size -= v8::internal::Assembler::kInstrSize; | 2049 padding_size -= v8::internal::Assembler::kInstrSize; |
2054 } | 2050 } |
2055 } | 2051 } |
2056 } | 2052 } |
2057 | 2053 |
2058 #undef __ | 2054 #undef __ |
2059 | 2055 |
2060 } // namespace compiler | 2056 } // namespace compiler |
2061 } // namespace internal | 2057 } // namespace internal |
2062 } // namespace v8 | 2058 } // namespace v8 |
OLD | NEW |