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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
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 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 Label nan; | 1015 Label nan; |
1016 __ li(t0, Operand(LESS)); | 1016 __ li(t0, Operand(LESS)); |
1017 __ li(t1, Operand(GREATER)); | 1017 __ li(t1, Operand(GREATER)); |
1018 __ li(t2, Operand(EQUAL)); | 1018 __ li(t2, Operand(EQUAL)); |
1019 | 1019 |
1020 // Check if either rhs or lhs is NaN. | 1020 // Check if either rhs or lhs is NaN. |
1021 __ BranchF(NULL, &nan, eq, f12, f14); | 1021 __ BranchF(NULL, &nan, eq, f12, f14); |
1022 | 1022 |
1023 // Check if LESS condition is satisfied. If true, move conditionally | 1023 // Check if LESS condition is satisfied. If true, move conditionally |
1024 // result to v0. | 1024 // result to v0. |
1025 if (!IsMipsArchVariant(kMips32r6)) { | 1025 __ c(OLT, D, f12, f14); |
1026 __ c(OLT, D, f12, f14); | 1026 __ Movt(v0, t0); |
1027 __ Movt(v0, t0); | 1027 // Use previous check to store conditionally to v0 oposite condition |
1028 // Use previous check to store conditionally to v0 oposite condition | 1028 // (GREATER). If rhs is equal to lhs, this will be corrected in next |
1029 // (GREATER). If rhs is equal to lhs, this will be corrected in next | 1029 // check. |
1030 // check. | 1030 __ Movf(v0, t1); |
1031 __ Movf(v0, t1); | 1031 // Check if EQUAL condition is satisfied. If true, move conditionally |
1032 // Check if EQUAL condition is satisfied. If true, move conditionally | 1032 // result to v0. |
1033 // result to v0. | 1033 __ c(EQ, D, f12, f14); |
1034 __ c(EQ, D, f12, f14); | 1034 __ Movt(v0, t2); |
1035 __ Movt(v0, t2); | |
1036 } else { | |
1037 Label skip; | |
1038 __ BranchF(USE_DELAY_SLOT, &skip, NULL, lt, f12, f14); | |
1039 __ mov(v0, t0); // Return LESS as result. | |
1040 | |
1041 __ BranchF(USE_DELAY_SLOT, &skip, NULL, eq, f12, f14); | |
1042 __ mov(v0, t2); // Return EQUAL as result. | |
1043 | |
1044 __ mov(v0, t1); // Return GREATER as result. | |
1045 __ bind(&skip); | |
1046 } | |
1047 | 1035 |
1048 __ Ret(); | 1036 __ Ret(); |
1049 | 1037 |
1050 __ bind(&nan); | 1038 __ bind(&nan); |
1051 // NaN comparisons always fail. | 1039 // NaN comparisons always fail. |
1052 // Load whatever we need in v0 to make the comparison fail. | 1040 // Load whatever we need in v0 to make the comparison fail. |
1053 DCHECK(is_int16(GREATER) && is_int16(LESS)); | 1041 DCHECK(is_int16(GREATER) && is_int16(LESS)); |
1054 __ Ret(USE_DELAY_SLOT); | 1042 __ Ret(USE_DELAY_SLOT); |
1055 if (cc == lt || cc == le) { | 1043 if (cc == lt || cc == le) { |
1056 __ li(v0, Operand(GREATER)); | 1044 __ li(v0, Operand(GREATER)); |
(...skipping 4226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5283 MemOperand(fp, 6 * kPointerSize), | 5271 MemOperand(fp, 6 * kPointerSize), |
5284 NULL); | 5272 NULL); |
5285 } | 5273 } |
5286 | 5274 |
5287 | 5275 |
5288 #undef __ | 5276 #undef __ |
5289 | 5277 |
5290 } } // namespace v8::internal | 5278 } } // namespace v8::internal |
5291 | 5279 |
5292 #endif // V8_TARGET_ARCH_MIPS | 5280 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |