OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 <limits.h> // For LONG_MIN, LONG_MAX. | 5 #include <limits.h> // For LONG_MIN, LONG_MAX. |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/base/division-by-constant.h" | 9 #include "src/base/division-by-constant.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1953 Register rs, | 1953 Register rs, |
1954 uint16_t pos, | 1954 uint16_t pos, |
1955 uint16_t size) { | 1955 uint16_t size) { |
1956 DCHECK(pos < 32); | 1956 DCHECK(pos < 32); |
1957 DCHECK(pos + size <= 32); | 1957 DCHECK(pos + size <= 32); |
1958 DCHECK(size != 0); | 1958 DCHECK(size != 0); |
1959 ins_(rt, rs, pos, size); | 1959 ins_(rt, rs, pos, size); |
1960 } | 1960 } |
1961 | 1961 |
1962 void MacroAssembler::Neg_s(FPURegister fd, FPURegister fs) { | 1962 void MacroAssembler::Neg_s(FPURegister fd, FPURegister fs) { |
1963 if (kArchVariant == kMips64r2) { | 1963 if (kArchVariant == kMips64r6) { |
| 1964 // r6 neg_s changes the sign for NaN-like operands as well. |
| 1965 neg_s(fd, fs); |
| 1966 } else { |
| 1967 DCHECK(kArchVariant == kMips64r2); |
1964 Label is_nan, done; | 1968 Label is_nan, done; |
1965 Register scratch1 = t8; | 1969 Register scratch1 = t8; |
1966 Register scratch2 = t9; | 1970 Register scratch2 = t9; |
1967 BranchF32(nullptr, &is_nan, eq, fs, fs); | 1971 BranchF32(nullptr, &is_nan, eq, fs, fs); |
1968 Branch(USE_DELAY_SLOT, &done); | 1972 Branch(USE_DELAY_SLOT, &done); |
1969 // For NaN input, neg_s will return the same NaN value, | 1973 // For NaN input, neg_s will return the same NaN value, |
1970 // while the sign has to be changed separately. | 1974 // while the sign has to be changed separately. |
1971 neg_s(fd, fs); // In delay slot. | 1975 neg_s(fd, fs); // In delay slot. |
1972 bind(&is_nan); | 1976 bind(&is_nan); |
1973 mfc1(scratch1, fs); | 1977 mfc1(scratch1, fs); |
1974 And(scratch2, scratch1, Operand(~kBinary32SignMask)); | 1978 And(scratch2, scratch1, Operand(~kBinary32SignMask)); |
1975 And(scratch1, scratch1, Operand(kBinary32SignMask)); | 1979 And(scratch1, scratch1, Operand(kBinary32SignMask)); |
1976 Xor(scratch1, scratch1, Operand(kBinary32SignMask)); | 1980 Xor(scratch1, scratch1, Operand(kBinary32SignMask)); |
1977 Or(scratch2, scratch2, scratch1); | 1981 Or(scratch2, scratch2, scratch1); |
1978 mtc1(scratch2, fd); | 1982 mtc1(scratch2, fd); |
1979 bind(&done); | 1983 bind(&done); |
1980 } else { | |
1981 // r6 neg_s changes the sign for NaN-like operands as well. | |
1982 neg_s(fd, fs); | |
1983 } | 1984 } |
1984 } | 1985 } |
1985 | 1986 |
1986 void MacroAssembler::Neg_d(FPURegister fd, FPURegister fs) { | 1987 void MacroAssembler::Neg_d(FPURegister fd, FPURegister fs) { |
1987 if (kArchVariant == kMips64r2) { | 1988 if (kArchVariant == kMips64r6) { |
| 1989 // r6 neg_d changes the sign for NaN-like operands as well. |
| 1990 neg_d(fd, fs); |
| 1991 } else { |
| 1992 DCHECK(kArchVariant == kMips64r2); |
1988 Label is_nan, done; | 1993 Label is_nan, done; |
1989 Register scratch1 = t8; | 1994 Register scratch1 = t8; |
1990 Register scratch2 = t9; | 1995 Register scratch2 = t9; |
1991 BranchF64(nullptr, &is_nan, eq, fs, fs); | 1996 BranchF64(nullptr, &is_nan, eq, fs, fs); |
1992 Branch(USE_DELAY_SLOT, &done); | 1997 Branch(USE_DELAY_SLOT, &done); |
1993 // For NaN input, neg_d will return the same NaN value, | 1998 // For NaN input, neg_d will return the same NaN value, |
1994 // while the sign has to be changed separately. | 1999 // while the sign has to be changed separately. |
1995 neg_d(fd, fs); // In delay slot. | 2000 neg_d(fd, fs); // In delay slot. |
1996 bind(&is_nan); | 2001 bind(&is_nan); |
1997 dmfc1(scratch1, fs); | 2002 dmfc1(scratch1, fs); |
1998 And(scratch2, scratch1, Operand(~Double::kSignMask)); | 2003 And(scratch2, scratch1, Operand(~Double::kSignMask)); |
1999 And(scratch1, scratch1, Operand(Double::kSignMask)); | 2004 And(scratch1, scratch1, Operand(Double::kSignMask)); |
2000 Xor(scratch1, scratch1, Operand(Double::kSignMask)); | 2005 Xor(scratch1, scratch1, Operand(Double::kSignMask)); |
2001 Or(scratch2, scratch2, scratch1); | 2006 Or(scratch2, scratch2, scratch1); |
2002 dmtc1(scratch2, fd); | 2007 dmtc1(scratch2, fd); |
2003 bind(&done); | 2008 bind(&done); |
2004 } else { | |
2005 // r6 neg_d changes the sign for NaN-like operands as well. | |
2006 neg_d(fd, fs); | |
2007 } | 2009 } |
2008 } | 2010 } |
2009 | 2011 |
2010 void MacroAssembler::Cvt_d_uw(FPURegister fd, FPURegister fs) { | 2012 void MacroAssembler::Cvt_d_uw(FPURegister fd, FPURegister fs) { |
2011 // Move the data from fs to t8. | 2013 // Move the data from fs to t8. |
2012 mfc1(t8, fs); | 2014 mfc1(t8, fs); |
2013 Cvt_d_uw(fd, t8); | 2015 Cvt_d_uw(fd, t8); |
2014 } | 2016 } |
2015 | 2017 |
2016 | 2018 |
(...skipping 5390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7407 if (mag.shift > 0) sra(result, result, mag.shift); | 7409 if (mag.shift > 0) sra(result, result, mag.shift); |
7408 srl(at, dividend, 31); | 7410 srl(at, dividend, 31); |
7409 Addu(result, result, Operand(at)); | 7411 Addu(result, result, Operand(at)); |
7410 } | 7412 } |
7411 | 7413 |
7412 | 7414 |
7413 } // namespace internal | 7415 } // namespace internal |
7414 } // namespace v8 | 7416 } // namespace v8 |
7415 | 7417 |
7416 #endif // V8_TARGET_ARCH_MIPS64 | 7418 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |