OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/crankshaft/x87/lithium-codegen-x87.h" | 7 #include "src/crankshaft/x87/lithium-codegen-x87.h" |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 2425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2436 bool is_unsigned = | 2436 bool is_unsigned = |
2437 instr->is_double() || | 2437 instr->is_double() || |
2438 instr->hydrogen()->left()->CheckFlag(HInstruction::kUint32) || | 2438 instr->hydrogen()->left()->CheckFlag(HInstruction::kUint32) || |
2439 instr->hydrogen()->right()->CheckFlag(HInstruction::kUint32); | 2439 instr->hydrogen()->right()->CheckFlag(HInstruction::kUint32); |
2440 Condition cc = TokenToCondition(instr->op(), is_unsigned); | 2440 Condition cc = TokenToCondition(instr->op(), is_unsigned); |
2441 | 2441 |
2442 if (left->IsConstantOperand() && right->IsConstantOperand()) { | 2442 if (left->IsConstantOperand() && right->IsConstantOperand()) { |
2443 // We can statically evaluate the comparison. | 2443 // We can statically evaluate the comparison. |
2444 double left_val = ToDouble(LConstantOperand::cast(left)); | 2444 double left_val = ToDouble(LConstantOperand::cast(left)); |
2445 double right_val = ToDouble(LConstantOperand::cast(right)); | 2445 double right_val = ToDouble(LConstantOperand::cast(right)); |
2446 int next_block = EvalComparison(instr->op(), left_val, right_val) ? | 2446 int next_block = Token::EvalComparison(instr->op(), left_val, right_val) |
2447 instr->TrueDestination(chunk_) : instr->FalseDestination(chunk_); | 2447 ? instr->TrueDestination(chunk_) |
| 2448 : instr->FalseDestination(chunk_); |
2448 EmitGoto(next_block); | 2449 EmitGoto(next_block); |
2449 } else { | 2450 } else { |
2450 if (instr->is_double()) { | 2451 if (instr->is_double()) { |
2451 X87LoadForUsage(ToX87Register(right), ToX87Register(left)); | 2452 X87LoadForUsage(ToX87Register(right), ToX87Register(left)); |
2452 __ FCmp(); | 2453 __ FCmp(); |
2453 // Don't base result on EFLAGS when a NaN is involved. Instead | 2454 // Don't base result on EFLAGS when a NaN is involved. Instead |
2454 // jump to the false block. | 2455 // jump to the false block. |
2455 __ j(parity_even, instr->FalseLabel(chunk_)); | 2456 __ j(parity_even, instr->FalseLabel(chunk_)); |
2456 } else { | 2457 } else { |
2457 if (right->IsConstantOperand()) { | 2458 if (right->IsConstantOperand()) { |
(...skipping 3571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6029 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6030 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6030 } | 6031 } |
6031 | 6032 |
6032 | 6033 |
6033 #undef __ | 6034 #undef __ |
6034 | 6035 |
6035 } // namespace internal | 6036 } // namespace internal |
6036 } // namespace v8 | 6037 } // namespace v8 |
6037 | 6038 |
6038 #endif // V8_TARGET_ARCH_X87 | 6039 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |