Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1468)

Side by Side Diff: src/mips/stub-cache-mips.cc

Issue 6993054: MIPS: Fixed FPU rounding checks and related errors in the Simulator. (Closed)
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2078 matching lines...) Expand 10 before | Expand all | Expand 10 after
2089 __ floor_w_d(f0, f0); 2089 __ floor_w_d(f0, f0);
2090 2090
2091 // Start checking for special cases. 2091 // Start checking for special cases.
2092 // Get the argument exponent and clear the sign bit. 2092 // Get the argument exponent and clear the sign bit.
2093 __ lw(t1, FieldMemOperand(v0, HeapNumber::kValueOffset + kPointerSize)); 2093 __ lw(t1, FieldMemOperand(v0, HeapNumber::kValueOffset + kPointerSize));
2094 __ And(t2, t1, Operand(~HeapNumber::kSignMask)); 2094 __ And(t2, t1, Operand(~HeapNumber::kSignMask));
2095 __ srl(t2, t2, HeapNumber::kMantissaBitsInTopWord); 2095 __ srl(t2, t2, HeapNumber::kMantissaBitsInTopWord);
2096 2096
2097 // Retrieve FCSR and check for fpu errors. 2097 // Retrieve FCSR and check for fpu errors.
2098 __ cfc1(t5, FCSR); 2098 __ cfc1(t5, FCSR);
2099 __ srl(t5, t5, kFCSRFlagShift); 2099 __ And(t5, t5, Operand(kFCSRExceptionFlagMask));
2100 // Flag 1 marks an inaccurate but still good result so we ignore it.
2101 __ And(t5, t5, Operand(kFCSRFlagMask ^ 1));
2102 __ Branch(&no_fpu_error, eq, t5, Operand(zero_reg)); 2100 __ Branch(&no_fpu_error, eq, t5, Operand(zero_reg));
2103 2101
2104 // Check for NaN, Infinity, and -Infinity. 2102 // Check for NaN, Infinity, and -Infinity.
2105 // They are invariant through a Math.Floor call, so just 2103 // They are invariant through a Math.Floor call, so just
2106 // return the original argument. 2104 // return the original argument.
2107 __ Subu(t3, t2, Operand(HeapNumber::kExponentMask 2105 __ Subu(t3, t2, Operand(HeapNumber::kExponentMask
2108 >> HeapNumber::kMantissaBitsInTopWord)); 2106 >> HeapNumber::kMantissaBitsInTopWord));
2109 __ Branch(&restore_fcsr_and_return, eq, t3, Operand(zero_reg)); 2107 __ Branch(&restore_fcsr_and_return, eq, t3, Operand(zero_reg));
2110 // We had an overflow or underflow in the conversion. Check if we 2108 // We had an overflow or underflow in the conversion. Check if we
2111 // have a big exponent. 2109 // have a big exponent.
(...skipping 2156 matching lines...) Expand 10 before | Expand all | Expand 10 after
4268 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric(); 4266 masm->isolate()->builtins()->KeyedStoreIC_MissForceGeneric();
4269 __ Jump(ic, RelocInfo::CODE_TARGET); 4267 __ Jump(ic, RelocInfo::CODE_TARGET);
4270 } 4268 }
4271 4269
4272 4270
4273 #undef __ 4271 #undef __
4274 4272
4275 } } // namespace v8::internal 4273 } } // namespace v8::internal
4276 4274
4277 #endif // V8_TARGET_ARCH_MIPS 4275 #endif // V8_TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698