OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1169 // handle here. | 1169 // handle here. |
1170 const uint32_t non_smi_exponent = | 1170 const uint32_t non_smi_exponent = |
1171 (HeapNumber::kExponentBias + 30) << HeapNumber::kExponentShift; | 1171 (HeapNumber::kExponentBias + 30) << HeapNumber::kExponentShift; |
1172 // If we have a match of the int32-but-not-Smi exponent then skip some logic. | 1172 // If we have a match of the int32-but-not-Smi exponent then skip some logic. |
1173 Branch(&right_exponent, eq, scratch2, Operand(non_smi_exponent)); | 1173 Branch(&right_exponent, eq, scratch2, Operand(non_smi_exponent)); |
1174 // If the exponent is higher than that then go to not_int32 case. This | 1174 // If the exponent is higher than that then go to not_int32 case. This |
1175 // catches numbers that don't fit in a signed int32, infinities and NaNs. | 1175 // catches numbers that don't fit in a signed int32, infinities and NaNs. |
1176 Branch(not_int32, gt, scratch2, Operand(non_smi_exponent)); | 1176 Branch(not_int32, gt, scratch2, Operand(non_smi_exponent)); |
1177 | 1177 |
1178 // We know the exponent is smaller than 30 (biased). If it is less than | 1178 // We know the exponent is smaller than 30 (biased). If it is less than |
1179 // 0 (biased) then the number is smaller in magnitude than 1.0 * 2^0, ie | 1179 // 0 (biased) then the number is smaller in magnitude than 1.0 * 2^0, i.e. |
1180 // it rounds to zero. | 1180 // it rounds to zero. |
1181 const uint32_t zero_exponent = | 1181 const uint32_t zero_exponent = |
1182 (HeapNumber::kExponentBias + 0) << HeapNumber::kExponentShift; | 1182 (HeapNumber::kExponentBias + 0) << HeapNumber::kExponentShift; |
1183 Subu(scratch2, scratch2, Operand(zero_exponent)); | 1183 Subu(scratch2, scratch2, Operand(zero_exponent)); |
1184 // Dest already has a Smi zero. | 1184 // Dest already has a Smi zero. |
1185 Branch(&done, lt, scratch2, Operand(zero_reg)); | 1185 Branch(&done, lt, scratch2, Operand(zero_reg)); |
1186 if (!CpuFeatures::IsSupported(FPU)) { | 1186 if (!CpuFeatures::IsSupported(FPU)) { |
1187 // We have a shifted exponent between 0 and 30 in scratch2. | 1187 // We have a shifted exponent between 0 and 30 in scratch2. |
1188 srl(dest, scratch2, HeapNumber::kExponentShift); | 1188 srl(dest, scratch2, HeapNumber::kExponentShift); |
1189 // We now have the exponent in dest. Subtract from 30 to get | 1189 // We now have the exponent in dest. Subtract from 30 to get |
(...skipping 3855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5045 opcode == BGTZL); | 5045 opcode == BGTZL); |
5046 opcode = (cond == eq) ? BEQ : BNE; | 5046 opcode = (cond == eq) ? BEQ : BNE; |
5047 instr = (instr & ~kOpcodeMask) | opcode; | 5047 instr = (instr & ~kOpcodeMask) | opcode; |
5048 masm_.emit(instr); | 5048 masm_.emit(instr); |
5049 } | 5049 } |
5050 | 5050 |
5051 | 5051 |
5052 } } // namespace v8::internal | 5052 } } // namespace v8::internal |
5053 | 5053 |
5054 #endif // V8_TARGET_ARCH_MIPS | 5054 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |