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

Side by Side Diff: src/ia32/codegen-ia32.cc

Issue 391051: Allow a platform to indicate that some CPU features are always... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 1 month 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
OLDNEW
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 6733 matching lines...) Expand 10 before | Expand all | Expand 10 after
6744 6744
6745 // Floating point case. 6745 // Floating point case.
6746 switch (op_) { 6746 switch (op_) {
6747 case Token::ADD: 6747 case Token::ADD:
6748 case Token::SUB: 6748 case Token::SUB:
6749 case Token::MUL: 6749 case Token::MUL:
6750 case Token::DIV: { 6750 case Token::DIV: {
6751 // eax: y 6751 // eax: y
6752 // edx: x 6752 // edx: x
6753 6753
6754 if (CpuFeatures::IsSupported(CpuFeatures::SSE2)) { 6754 if (CpuFeatures::IsSupported(SSE2)) {
6755 CpuFeatures::Scope use_sse2(CpuFeatures::SSE2); 6755 CpuFeatures::Scope use_sse2(SSE2);
6756 FloatingPointHelper::LoadSse2Operands(masm, &call_runtime); 6756 FloatingPointHelper::LoadSse2Operands(masm, &call_runtime);
6757 6757
6758 switch (op_) { 6758 switch (op_) {
6759 case Token::ADD: __ addsd(xmm0, xmm1); break; 6759 case Token::ADD: __ addsd(xmm0, xmm1); break;
6760 case Token::SUB: __ subsd(xmm0, xmm1); break; 6760 case Token::SUB: __ subsd(xmm0, xmm1); break;
6761 case Token::MUL: __ mulsd(xmm0, xmm1); break; 6761 case Token::MUL: __ mulsd(xmm0, xmm1); break;
6762 case Token::DIV: __ divsd(xmm0, xmm1); break; 6762 case Token::DIV: __ divsd(xmm0, xmm1); break;
6763 default: UNREACHABLE(); 6763 default: UNREACHABLE();
6764 } 6764 }
6765 // Allocate a heap number, if needed. 6765 // Allocate a heap number, if needed.
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
6840 FloatingPointHelper::LoadFloatOperands(masm, ecx); 6840 FloatingPointHelper::LoadFloatOperands(masm, ecx);
6841 6841
6842 Label skip_allocation, non_smi_result, operand_conversion_failure; 6842 Label skip_allocation, non_smi_result, operand_conversion_failure;
6843 6843
6844 // Reserve space for converted numbers. 6844 // Reserve space for converted numbers.
6845 __ sub(Operand(esp), Immediate(2 * kPointerSize)); 6845 __ sub(Operand(esp), Immediate(2 * kPointerSize));
6846 6846
6847 if (use_sse3_) { 6847 if (use_sse3_) {
6848 // Truncate the operands to 32-bit integers and check for 6848 // Truncate the operands to 32-bit integers and check for
6849 // exceptions in doing so. 6849 // exceptions in doing so.
6850 CpuFeatures::Scope scope(CpuFeatures::SSE3); 6850 CpuFeatures::Scope scope(SSE3);
6851 __ fisttp_s(Operand(esp, 0 * kPointerSize)); 6851 __ fisttp_s(Operand(esp, 0 * kPointerSize));
6852 __ fisttp_s(Operand(esp, 1 * kPointerSize)); 6852 __ fisttp_s(Operand(esp, 1 * kPointerSize));
6853 __ fnstsw_ax(); 6853 __ fnstsw_ax();
6854 __ test(eax, Immediate(1)); 6854 __ test(eax, Immediate(1));
6855 __ j(not_zero, &operand_conversion_failure); 6855 __ j(not_zero, &operand_conversion_failure);
6856 } else { 6856 } else {
6857 // Check if right operand is int32. 6857 // Check if right operand is int32.
6858 __ fist_s(Operand(esp, 0 * kPointerSize)); 6858 __ fist_s(Operand(esp, 0 * kPointerSize));
6859 __ fild_s(Operand(esp, 0 * kPointerSize)); 6859 __ fild_s(Operand(esp, 0 * kPointerSize));
6860 __ FCmp(); 6860 __ FCmp();
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
7467 // Push arguments below the return address. 7467 // Push arguments below the return address.
7468 __ pop(ecx); 7468 __ pop(ecx);
7469 __ push(eax); 7469 __ push(eax);
7470 __ push(edx); 7470 __ push(edx);
7471 __ push(ecx); 7471 __ push(ecx);
7472 7472
7473 // Inlined floating point compare. 7473 // Inlined floating point compare.
7474 // Call builtin if operands are not floating point or smi. 7474 // Call builtin if operands are not floating point or smi.
7475 Label check_for_symbols; 7475 Label check_for_symbols;
7476 Label unordered; 7476 Label unordered;
7477 if (CpuFeatures::IsSupported(CpuFeatures::SSE2)) { 7477 if (CpuFeatures::IsSupported(SSE2)) {
7478 CpuFeatures::Scope use_sse2(CpuFeatures::SSE2); 7478 CpuFeatures::Scope use_sse2(SSE2);
7479 CpuFeatures::Scope use_cmov(CpuFeatures::CMOV); 7479 CpuFeatures::Scope use_cmov(CMOV);
7480 7480
7481 FloatingPointHelper::LoadSse2Operands(masm, &check_for_symbols); 7481 FloatingPointHelper::LoadSse2Operands(masm, &check_for_symbols);
7482 __ comisd(xmm0, xmm1); 7482 __ comisd(xmm0, xmm1);
7483 7483
7484 // Jump to builtin for NaN. 7484 // Jump to builtin for NaN.
7485 __ j(parity_even, &unordered, not_taken); 7485 __ j(parity_even, &unordered, not_taken);
7486 __ mov(eax, 0); // equal 7486 __ mov(eax, 0); // equal
7487 __ mov(ecx, Immediate(Smi::FromInt(1))); 7487 __ mov(ecx, Immediate(Smi::FromInt(1)));
7488 __ cmov(above, eax, Operand(ecx)); 7488 __ cmov(above, eax, Operand(ecx));
7489 __ mov(ecx, Immediate(Smi::FromInt(-1))); 7489 __ mov(ecx, Immediate(Smi::FromInt(-1)));
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
8107 8107
8108 int CompareStub::MinorKey() { 8108 int CompareStub::MinorKey() {
8109 // Encode the two parameters in a unique 16 bit value. 8109 // Encode the two parameters in a unique 16 bit value.
8110 ASSERT(static_cast<unsigned>(cc_) < (1 << 15)); 8110 ASSERT(static_cast<unsigned>(cc_) < (1 << 15));
8111 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0); 8111 return (static_cast<unsigned>(cc_) << 1) | (strict_ ? 1 : 0);
8112 } 8112 }
8113 8113
8114 #undef __ 8114 #undef __
8115 8115
8116 } } // namespace v8::internal 8116 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698