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/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/arm64/macro-assembler-arm64.h" | 8 #include "src/arm64/macro-assembler-arm64.h" |
9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
10 #include "src/compiler/code-generator-impl.h" | 10 #include "src/compiler/code-generator-impl.h" |
(...skipping 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1949 } | 1949 } |
1950 if (destination->IsStackSlot()) { | 1950 if (destination->IsStackSlot()) { |
1951 __ Str(dst, g.ToMemOperand(destination, masm())); | 1951 __ Str(dst, g.ToMemOperand(destination, masm())); |
1952 } | 1952 } |
1953 } else if (src.type() == Constant::kFloat32) { | 1953 } else if (src.type() == Constant::kFloat32) { |
1954 if (destination->IsFPRegister()) { | 1954 if (destination->IsFPRegister()) { |
1955 FPRegister dst = g.ToDoubleRegister(destination).S(); | 1955 FPRegister dst = g.ToDoubleRegister(destination).S(); |
1956 __ Fmov(dst, src.ToFloat32()); | 1956 __ Fmov(dst, src.ToFloat32()); |
1957 } else { | 1957 } else { |
1958 DCHECK(destination->IsFPStackSlot()); | 1958 DCHECK(destination->IsFPStackSlot()); |
1959 UseScratchRegisterScope scope(masm()); | 1959 if (bit_cast<int32_t>(src.ToFloat32()) == 0) { |
1960 FPRegister temp = scope.AcquireS(); | 1960 __ Str(wzr, g.ToMemOperand(destination, masm())); |
1961 __ Fmov(temp, src.ToFloat32()); | 1961 } else { |
1962 __ Str(temp, g.ToMemOperand(destination, masm())); | 1962 UseScratchRegisterScope scope(masm()); |
| 1963 FPRegister temp = scope.AcquireS(); |
| 1964 __ Fmov(temp, src.ToFloat32()); |
| 1965 __ Str(temp, g.ToMemOperand(destination, masm())); |
| 1966 } |
1963 } | 1967 } |
1964 } else { | 1968 } else { |
1965 DCHECK_EQ(Constant::kFloat64, src.type()); | 1969 DCHECK_EQ(Constant::kFloat64, src.type()); |
1966 if (destination->IsFPRegister()) { | 1970 if (destination->IsFPRegister()) { |
1967 FPRegister dst = g.ToDoubleRegister(destination); | 1971 FPRegister dst = g.ToDoubleRegister(destination); |
1968 __ Fmov(dst, src.ToFloat64()); | 1972 __ Fmov(dst, src.ToFloat64()); |
1969 } else { | 1973 } else { |
1970 DCHECK(destination->IsFPStackSlot()); | 1974 DCHECK(destination->IsFPStackSlot()); |
1971 UseScratchRegisterScope scope(masm()); | 1975 if (bit_cast<int64_t>(src.ToFloat64()) == 0) { |
1972 FPRegister temp = scope.AcquireD(); | 1976 __ Str(xzr, g.ToMemOperand(destination, masm())); |
1973 __ Fmov(temp, src.ToFloat64()); | 1977 } else { |
1974 __ Str(temp, g.ToMemOperand(destination, masm())); | 1978 UseScratchRegisterScope scope(masm()); |
| 1979 FPRegister temp = scope.AcquireD(); |
| 1980 __ Fmov(temp, src.ToFloat64()); |
| 1981 __ Str(temp, g.ToMemOperand(destination, masm())); |
| 1982 } |
1975 } | 1983 } |
1976 } | 1984 } |
1977 } else if (source->IsFPRegister()) { | 1985 } else if (source->IsFPRegister()) { |
1978 FPRegister src = g.ToDoubleRegister(source); | 1986 FPRegister src = g.ToDoubleRegister(source); |
1979 if (destination->IsFPRegister()) { | 1987 if (destination->IsFPRegister()) { |
1980 FPRegister dst = g.ToDoubleRegister(destination); | 1988 FPRegister dst = g.ToDoubleRegister(destination); |
1981 __ Fmov(dst, src); | 1989 __ Fmov(dst, src); |
1982 } else { | 1990 } else { |
1983 DCHECK(destination->IsFPStackSlot()); | 1991 DCHECK(destination->IsFPStackSlot()); |
1984 __ Str(src, g.ToMemOperand(destination, masm())); | 1992 __ Str(src, g.ToMemOperand(destination, masm())); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2082 padding_size -= kInstructionSize; | 2090 padding_size -= kInstructionSize; |
2083 } | 2091 } |
2084 } | 2092 } |
2085 } | 2093 } |
2086 | 2094 |
2087 #undef __ | 2095 #undef __ |
2088 | 2096 |
2089 } // namespace compiler | 2097 } // namespace compiler |
2090 } // namespace internal | 2098 } // namespace internal |
2091 } // namespace v8 | 2099 } // namespace v8 |
OLD | NEW |