| 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 1775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1786 case Token::ADD: __ addsd(xmm0, xmm1); break; | 1786 case Token::ADD: __ addsd(xmm0, xmm1); break; |
| 1787 case Token::SUB: __ subsd(xmm0, xmm1); break; | 1787 case Token::SUB: __ subsd(xmm0, xmm1); break; |
| 1788 case Token::MUL: __ mulsd(xmm0, xmm1); break; | 1788 case Token::MUL: __ mulsd(xmm0, xmm1); break; |
| 1789 case Token::DIV: __ divsd(xmm0, xmm1); break; | 1789 case Token::DIV: __ divsd(xmm0, xmm1); break; |
| 1790 default: UNREACHABLE(); | 1790 default: UNREACHABLE(); |
| 1791 } | 1791 } |
| 1792 // Check result type if it is currently Int32. | 1792 // Check result type if it is currently Int32. |
| 1793 if (result_type_ <= BinaryOpIC::INT32) { | 1793 if (result_type_ <= BinaryOpIC::INT32) { |
| 1794 __ cvttsd2si(ecx, Operand(xmm0)); | 1794 __ cvttsd2si(ecx, Operand(xmm0)); |
| 1795 __ cvtsi2sd(xmm2, ecx); | 1795 __ cvtsi2sd(xmm2, ecx); |
| 1796 __ ucomisd(xmm0, xmm2); | 1796 __ pcmpeqd(xmm2, xmm0); |
| 1797 __ j(not_zero, ¬_int32); | 1797 __ movmskpd(ecx, xmm2); |
| 1798 __ j(carry, ¬_int32); | 1798 __ test(ecx, Immediate(1)); |
| 1799 __ j(zero, ¬_int32); |
| 1799 } | 1800 } |
| 1800 GenerateHeapResultAllocation(masm, &call_runtime); | 1801 GenerateHeapResultAllocation(masm, &call_runtime); |
| 1801 __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm0); | 1802 __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm0); |
| 1802 __ ret(0); | 1803 __ ret(0); |
| 1803 } | 1804 } |
| 1804 } else { // SSE2 not available, use FPU. | 1805 } else { // SSE2 not available, use FPU. |
| 1805 FloatingPointHelper::CheckFloatOperands(masm, ¬_floats, ebx); | 1806 FloatingPointHelper::CheckFloatOperands(masm, ¬_floats, ebx); |
| 1806 FloatingPointHelper::LoadFloatOperands( | 1807 FloatingPointHelper::LoadFloatOperands( |
| 1807 masm, | 1808 masm, |
| 1808 ecx, | 1809 ecx, |
| (...skipping 5702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7511 // Restore ecx. | 7512 // Restore ecx. |
| 7512 __ pop(ecx); | 7513 __ pop(ecx); |
| 7513 __ ret(0); | 7514 __ ret(0); |
| 7514 } | 7515 } |
| 7515 | 7516 |
| 7516 #undef __ | 7517 #undef __ |
| 7517 | 7518 |
| 7518 } } // namespace v8::internal | 7519 } } // namespace v8::internal |
| 7519 | 7520 |
| 7520 #endif // V8_TARGET_ARCH_IA32 | 7521 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |