OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1727 __ ret(0); | 1727 __ ret(0); |
1728 } | 1728 } |
1729 } else { // SSE2 not available, use FPU. | 1729 } else { // SSE2 not available, use FPU. |
1730 FloatingPointHelper::CheckFloatOperands(masm, ¬_floats, ebx); | 1730 FloatingPointHelper::CheckFloatOperands(masm, ¬_floats, ebx); |
1731 FloatingPointHelper::LoadFloatOperands( | 1731 FloatingPointHelper::LoadFloatOperands( |
1732 masm, | 1732 masm, |
1733 ecx, | 1733 ecx, |
1734 FloatingPointHelper::ARGS_IN_REGISTERS); | 1734 FloatingPointHelper::ARGS_IN_REGISTERS); |
1735 FloatingPointHelper::CheckFloatOperandsAreInt32(masm, ¬_int32); | 1735 FloatingPointHelper::CheckFloatOperandsAreInt32(masm, ¬_int32); |
1736 if (op_ == Token::MOD) { | 1736 if (op_ == Token::MOD) { |
| 1737 // The operands are now on the FPU stack, but we don't need them. |
| 1738 __ fstp(0); |
| 1739 __ fstp(0); |
1737 GenerateRegisterArgsPush(masm); | 1740 GenerateRegisterArgsPush(masm); |
1738 __ InvokeBuiltin(Builtins::MOD, JUMP_FUNCTION); | 1741 __ InvokeBuiltin(Builtins::MOD, JUMP_FUNCTION); |
1739 } else { | 1742 } else { |
1740 switch (op_) { | 1743 switch (op_) { |
1741 case Token::ADD: __ faddp(1); break; | 1744 case Token::ADD: __ faddp(1); break; |
1742 case Token::SUB: __ fsubp(1); break; | 1745 case Token::SUB: __ fsubp(1); break; |
1743 case Token::MUL: __ fmulp(1); break; | 1746 case Token::MUL: __ fmulp(1); break; |
1744 case Token::DIV: __ fdivp(1); break; | 1747 case Token::DIV: __ fdivp(1); break; |
1745 default: UNREACHABLE(); | 1748 default: UNREACHABLE(); |
1746 } | 1749 } |
(...skipping 5641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7388 false); | 7391 false); |
7389 __ pop(edx); | 7392 __ pop(edx); |
7390 __ ret(0); | 7393 __ ret(0); |
7391 } | 7394 } |
7392 | 7395 |
7393 #undef __ | 7396 #undef __ |
7394 | 7397 |
7395 } } // namespace v8::internal | 7398 } } // namespace v8::internal |
7396 | 7399 |
7397 #endif // V8_TARGET_ARCH_IA32 | 7400 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |