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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 Label nan; | 1009 Label nan; |
1010 __ li(a4, Operand(LESS)); | 1010 __ li(a4, Operand(LESS)); |
1011 __ li(a5, Operand(GREATER)); | 1011 __ li(a5, Operand(GREATER)); |
1012 __ li(a6, Operand(EQUAL)); | 1012 __ li(a6, Operand(EQUAL)); |
1013 | 1013 |
1014 // Check if either rhs or lhs is NaN. | 1014 // Check if either rhs or lhs is NaN. |
1015 __ BranchF(NULL, &nan, eq, f12, f14); | 1015 __ BranchF(NULL, &nan, eq, f12, f14); |
1016 | 1016 |
1017 // Check if LESS condition is satisfied. If true, move conditionally | 1017 // Check if LESS condition is satisfied. If true, move conditionally |
1018 // result to v0. | 1018 // result to v0. |
1019 __ c(OLT, D, f12, f14); | 1019 if (kArchVariant != kMips64r6) { |
1020 __ Movt(v0, a4); | 1020 __ c(OLT, D, f12, f14); |
1021 // Use previous check to store conditionally to v0 oposite condition | 1021 __ Movt(v0, a4); |
1022 // (GREATER). If rhs is equal to lhs, this will be corrected in next | 1022 // Use previous check to store conditionally to v0 oposite condition |
1023 // check. | 1023 // (GREATER). If rhs is equal to lhs, this will be corrected in next |
1024 __ Movf(v0, a5); | 1024 // check. |
1025 // Check if EQUAL condition is satisfied. If true, move conditionally | 1025 __ Movf(v0, a5); |
1026 // result to v0. | 1026 // Check if EQUAL condition is satisfied. If true, move conditionally |
1027 __ c(EQ, D, f12, f14); | 1027 // result to v0. |
1028 __ Movt(v0, a6); | 1028 __ c(EQ, D, f12, f14); |
| 1029 __ Movt(v0, a6); |
| 1030 } else { |
| 1031 Label skip; |
| 1032 __ BranchF(USE_DELAY_SLOT, &skip, NULL, lt, f12, f14); |
| 1033 __ mov(v0, a4); // Return LESS as result. |
1029 | 1034 |
| 1035 __ BranchF(USE_DELAY_SLOT, &skip, NULL, eq, f12, f14); |
| 1036 __ mov(v0, a6); // Return EQUAL as result. |
| 1037 |
| 1038 __ mov(v0, a5); // Return GREATER as result. |
| 1039 __ bind(&skip); |
| 1040 } |
1030 __ Ret(); | 1041 __ Ret(); |
1031 | 1042 |
1032 __ bind(&nan); | 1043 __ bind(&nan); |
1033 // NaN comparisons always fail. | 1044 // NaN comparisons always fail. |
1034 // Load whatever we need in v0 to make the comparison fail. | 1045 // Load whatever we need in v0 to make the comparison fail. |
1035 ASSERT(is_int16(GREATER) && is_int16(LESS)); | 1046 ASSERT(is_int16(GREATER) && is_int16(LESS)); |
1036 __ Ret(USE_DELAY_SLOT); | 1047 __ Ret(USE_DELAY_SLOT); |
1037 if (cc == lt || cc == le) { | 1048 if (cc == lt || cc == le) { |
1038 __ li(v0, Operand(GREATER)); | 1049 __ li(v0, Operand(GREATER)); |
1039 } else { | 1050 } else { |
(...skipping 4259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5299 MemOperand(fp, 6 * kPointerSize), | 5310 MemOperand(fp, 6 * kPointerSize), |
5300 NULL); | 5311 NULL); |
5301 } | 5312 } |
5302 | 5313 |
5303 | 5314 |
5304 #undef __ | 5315 #undef __ |
5305 | 5316 |
5306 } } // namespace v8::internal | 5317 } } // namespace v8::internal |
5307 | 5318 |
5308 #endif // V8_TARGET_ARCH_MIPS64 | 5319 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |