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 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1624 HMathMinMax::Operation operation = instr->hydrogen()->operation(); | 1624 HMathMinMax::Operation operation = instr->hydrogen()->operation(); |
1625 if (instr->hydrogen()->representation().IsInteger32()) { | 1625 if (instr->hydrogen()->representation().IsInteger32()) { |
1626 Label return_left; | 1626 Label return_left; |
1627 Condition condition = (operation == HMathMinMax::kMathMin) | 1627 Condition condition = (operation == HMathMinMax::kMathMin) |
1628 ? less_equal | 1628 ? less_equal |
1629 : greater_equal; | 1629 : greater_equal; |
1630 Register left_reg = ToRegister(left); | 1630 Register left_reg = ToRegister(left); |
1631 if (right->IsConstantOperand()) { | 1631 if (right->IsConstantOperand()) { |
1632 Immediate right_imm = | 1632 Immediate right_imm = |
1633 Immediate(ToInteger32(LConstantOperand::cast(right))); | 1633 Immediate(ToInteger32(LConstantOperand::cast(right))); |
1634 __ cmpq(left_reg, right_imm); | 1634 __ cmpl(left_reg, right_imm); |
1635 __ j(condition, &return_left, Label::kNear); | 1635 __ j(condition, &return_left, Label::kNear); |
1636 __ movq(left_reg, right_imm); | 1636 __ movq(left_reg, right_imm); |
1637 } else if (right->IsRegister()) { | 1637 } else if (right->IsRegister()) { |
1638 Register right_reg = ToRegister(right); | 1638 Register right_reg = ToRegister(right); |
1639 __ cmpq(left_reg, right_reg); | 1639 __ cmpl(left_reg, right_reg); |
1640 __ j(condition, &return_left, Label::kNear); | 1640 __ j(condition, &return_left, Label::kNear); |
1641 __ movq(left_reg, right_reg); | 1641 __ movq(left_reg, right_reg); |
1642 } else { | 1642 } else { |
1643 Operand right_op = ToOperand(right); | 1643 Operand right_op = ToOperand(right); |
1644 __ cmpq(left_reg, right_op); | 1644 __ cmpl(left_reg, right_op); |
1645 __ j(condition, &return_left, Label::kNear); | 1645 __ j(condition, &return_left, Label::kNear); |
1646 __ movq(left_reg, right_op); | 1646 __ movq(left_reg, right_op); |
1647 } | 1647 } |
1648 __ bind(&return_left); | 1648 __ bind(&return_left); |
1649 } else { | 1649 } else { |
1650 ASSERT(instr->hydrogen()->representation().IsDouble()); | 1650 ASSERT(instr->hydrogen()->representation().IsDouble()); |
1651 Label check_nan_left, check_zero, return_left, return_right; | 1651 Label check_nan_left, check_zero, return_left, return_right; |
1652 Condition condition = (operation == HMathMinMax::kMathMin) ? below : above; | 1652 Condition condition = (operation == HMathMinMax::kMathMin) ? below : above; |
1653 XMMRegister left_reg = ToDoubleRegister(left); | 1653 XMMRegister left_reg = ToDoubleRegister(left); |
1654 XMMRegister right_reg = ToDoubleRegister(right); | 1654 XMMRegister right_reg = ToDoubleRegister(right); |
(...skipping 3873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5528 FixedArray::kHeaderSize - kPointerSize)); | 5528 FixedArray::kHeaderSize - kPointerSize)); |
5529 __ bind(&done); | 5529 __ bind(&done); |
5530 } | 5530 } |
5531 | 5531 |
5532 | 5532 |
5533 #undef __ | 5533 #undef __ |
5534 | 5534 |
5535 } } // namespace v8::internal | 5535 } } // namespace v8::internal |
5536 | 5536 |
5537 #endif // V8_TARGET_ARCH_X64 | 5537 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |