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

Side by Side Diff: src/ia32/code-stubs-ia32.cc

Issue 11666004: Refactoring only: Use CheckSSE2OperandIsInt32 instead of copy-n-paste code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 12 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after
1750 } else { 1750 } else {
1751 switch (op_) { 1751 switch (op_) {
1752 case Token::ADD: __ addsd(xmm0, xmm1); break; 1752 case Token::ADD: __ addsd(xmm0, xmm1); break;
1753 case Token::SUB: __ subsd(xmm0, xmm1); break; 1753 case Token::SUB: __ subsd(xmm0, xmm1); break;
1754 case Token::MUL: __ mulsd(xmm0, xmm1); break; 1754 case Token::MUL: __ mulsd(xmm0, xmm1); break;
1755 case Token::DIV: __ divsd(xmm0, xmm1); break; 1755 case Token::DIV: __ divsd(xmm0, xmm1); break;
1756 default: UNREACHABLE(); 1756 default: UNREACHABLE();
1757 } 1757 }
1758 // Check result type if it is currently Int32. 1758 // Check result type if it is currently Int32.
1759 if (result_type_ <= BinaryOpIC::INT32) { 1759 if (result_type_ <= BinaryOpIC::INT32) {
1760 __ cvttsd2si(ecx, Operand(xmm0)); 1760 FloatingPointHelper::CheckSSE2OperandIsInt32(
1761 __ cvtsi2sd(xmm2, ecx); 1761 masm, &not_int32, xmm0, ecx, xmm2);
1762 __ pcmpeqd(xmm2, xmm0);
1763 __ movmskpd(ecx, xmm2);
1764 __ test(ecx, Immediate(1));
1765 __ j(zero, &not_int32);
1766 } 1762 }
1767 BinaryOpStub_GenerateHeapResultAllocation(masm, &call_runtime, mode_); 1763 BinaryOpStub_GenerateHeapResultAllocation(masm, &call_runtime, mode_);
1768 __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm0); 1764 __ movdbl(FieldOperand(eax, HeapNumber::kValueOffset), xmm0);
1769 __ ret(0); 1765 __ ret(0);
1770 } 1766 }
1771 } else { // SSE2 not available, use FPU. 1767 } else { // SSE2 not available, use FPU.
1772 FloatingPointHelper::CheckFloatOperands(masm, &not_floats, ebx); 1768 FloatingPointHelper::CheckFloatOperands(masm, &not_floats, ebx);
1773 FloatingPointHelper::LoadFloatOperands( 1769 FloatingPointHelper::LoadFloatOperands(
1774 masm, 1770 masm,
1775 ecx, 1771 ecx,
(...skipping 5697 matching lines...) Expand 10 before | Expand all | Expand 10 after
7473 // Restore ecx. 7469 // Restore ecx.
7474 __ pop(ecx); 7470 __ pop(ecx);
7475 __ ret(0); 7471 __ ret(0);
7476 } 7472 }
7477 7473
7478 #undef __ 7474 #undef __
7479 7475
7480 } } // namespace v8::internal 7476 } } // namespace v8::internal
7481 7477
7482 #endif // V8_TARGET_ARCH_IA32 7478 #endif // V8_TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698