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 2538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2549 | 2549 |
2550 if (left->IsConstantOperand() && right->IsConstantOperand()) { | 2550 if (left->IsConstantOperand() && right->IsConstantOperand()) { |
2551 // We can statically evaluate the comparison. | 2551 // We can statically evaluate the comparison. |
2552 double left_val = ToDouble(LConstantOperand::cast(left)); | 2552 double left_val = ToDouble(LConstantOperand::cast(left)); |
2553 double right_val = ToDouble(LConstantOperand::cast(right)); | 2553 double right_val = ToDouble(LConstantOperand::cast(right)); |
2554 int next_block = EvalComparison(instr->op(), left_val, right_val) ? | 2554 int next_block = EvalComparison(instr->op(), left_val, right_val) ? |
2555 instr->TrueDestination(chunk_) : instr->FalseDestination(chunk_); | 2555 instr->TrueDestination(chunk_) : instr->FalseDestination(chunk_); |
2556 EmitGoto(next_block); | 2556 EmitGoto(next_block); |
2557 } else { | 2557 } else { |
2558 if (instr->is_double()) { | 2558 if (instr->is_double()) { |
2559 CpuFeatureScope scope(masm(), SSE2); | 2559 if (CpuFeatures::IsSafeForSnapshot(SSE2)) { |
| 2560 CpuFeatureScope scope(masm(), SSE2); |
| 2561 __ ucomisd(ToDoubleRegister(left), ToDoubleRegister(right)); |
| 2562 } else { |
| 2563 X87Fxch(ToX87Register(right)); |
| 2564 X87Fxch(ToX87Register(left), 1); |
| 2565 __ fld(0); |
| 2566 __ fld(2); |
| 2567 __ FCmp(); |
| 2568 } |
2560 // Don't base result on EFLAGS when a NaN is involved. Instead | 2569 // Don't base result on EFLAGS when a NaN is involved. Instead |
2561 // jump to the false block. | 2570 // jump to the false block. |
2562 __ ucomisd(ToDoubleRegister(left), ToDoubleRegister(right)); | |
2563 __ j(parity_even, instr->FalseLabel(chunk_)); | 2571 __ j(parity_even, instr->FalseLabel(chunk_)); |
2564 } else { | 2572 } else { |
2565 if (right->IsConstantOperand()) { | 2573 if (right->IsConstantOperand()) { |
2566 __ cmp(ToOperand(left), | 2574 __ cmp(ToOperand(left), |
2567 ToImmediate(right, instr->hydrogen()->representation())); | 2575 ToImmediate(right, instr->hydrogen()->representation())); |
2568 } else if (left->IsConstantOperand()) { | 2576 } else if (left->IsConstantOperand()) { |
2569 __ cmp(ToOperand(right), | 2577 __ cmp(ToOperand(right), |
2570 ToImmediate(left, instr->hydrogen()->representation())); | 2578 ToImmediate(left, instr->hydrogen()->representation())); |
2571 // We transposed the operands. Reverse the condition. | 2579 // We transposed the operands. Reverse the condition. |
2572 cc = ReverseCondition(cc); | 2580 cc = ReverseCondition(cc); |
(...skipping 3786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6359 FixedArray::kHeaderSize - kPointerSize)); | 6367 FixedArray::kHeaderSize - kPointerSize)); |
6360 __ bind(&done); | 6368 __ bind(&done); |
6361 } | 6369 } |
6362 | 6370 |
6363 | 6371 |
6364 #undef __ | 6372 #undef __ |
6365 | 6373 |
6366 } } // namespace v8::internal | 6374 } } // namespace v8::internal |
6367 | 6375 |
6368 #endif // V8_TARGET_ARCH_IA32 | 6376 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |