OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 __ shr_cl(i.OutputOperand()); | 755 __ shr_cl(i.OutputOperand()); |
756 } | 756 } |
757 break; | 757 break; |
758 case kX87Sar: | 758 case kX87Sar: |
759 if (HasImmediateInput(instr, 1)) { | 759 if (HasImmediateInput(instr, 1)) { |
760 __ sar(i.OutputOperand(), i.InputInt5(1)); | 760 __ sar(i.OutputOperand(), i.InputInt5(1)); |
761 } else { | 761 } else { |
762 __ sar_cl(i.OutputOperand()); | 762 __ sar_cl(i.OutputOperand()); |
763 } | 763 } |
764 break; | 764 break; |
| 765 case kX87AddPair: { |
| 766 // i.OutputRegister(0) == i.InputRegister(0) ... left low word. |
| 767 // i.InputRegister(1) ... left high word. |
| 768 // i.InputRegister(2) ... right low word. |
| 769 // i.InputRegister(3) ... right high word. |
| 770 bool use_temp = false; |
| 771 if (i.OutputRegister(0).code() == i.InputRegister(1).code() || |
| 772 i.OutputRegister(0).code() == i.InputRegister(3).code()) { |
| 773 // We cannot write to the output register directly, because it would |
| 774 // overwrite an input for adc. We have to use the temp register. |
| 775 use_temp = true; |
| 776 __ Move(i.TempRegister(0), i.InputRegister(0)); |
| 777 __ add(i.TempRegister(0), i.InputRegister(2)); |
| 778 } else { |
| 779 __ add(i.OutputRegister(0), i.InputRegister(2)); |
| 780 } |
| 781 __ adc(i.InputRegister(1), Operand(i.InputRegister(3))); |
| 782 if (i.OutputRegister(1).code() != i.InputRegister(1).code()) { |
| 783 __ Move(i.OutputRegister(1), i.InputRegister(1)); |
| 784 } |
| 785 if (use_temp) { |
| 786 __ Move(i.OutputRegister(0), i.TempRegister(0)); |
| 787 } |
| 788 break; |
| 789 } |
765 case kX87ShlPair: | 790 case kX87ShlPair: |
766 if (HasImmediateInput(instr, 2)) { | 791 if (HasImmediateInput(instr, 2)) { |
767 __ ShlPair(i.InputRegister(1), i.InputRegister(0), i.InputInt6(2)); | 792 __ ShlPair(i.InputRegister(1), i.InputRegister(0), i.InputInt6(2)); |
768 } else { | 793 } else { |
769 // Shift has been loaded into CL by the register allocator. | 794 // Shift has been loaded into CL by the register allocator. |
770 __ ShlPair_cl(i.InputRegister(1), i.InputRegister(0)); | 795 __ ShlPair_cl(i.InputRegister(1), i.InputRegister(0)); |
771 } | 796 } |
772 break; | 797 break; |
773 case kX87ShrPair: | 798 case kX87ShrPair: |
774 if (HasImmediateInput(instr, 2)) { | 799 if (HasImmediateInput(instr, 2)) { |
(...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2354 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2379 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
2355 __ Nop(padding_size); | 2380 __ Nop(padding_size); |
2356 } | 2381 } |
2357 } | 2382 } |
2358 | 2383 |
2359 #undef __ | 2384 #undef __ |
2360 | 2385 |
2361 } // namespace compiler | 2386 } // namespace compiler |
2362 } // namespace internal | 2387 } // namespace internal |
2363 } // namespace v8 | 2388 } // namespace v8 |
OLD | NEW |