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 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 } | 780 } |
781 __ adc(i.InputRegister(1), Operand(i.InputRegister(3))); | 781 __ adc(i.InputRegister(1), Operand(i.InputRegister(3))); |
782 if (i.OutputRegister(1).code() != i.InputRegister(1).code()) { | 782 if (i.OutputRegister(1).code() != i.InputRegister(1).code()) { |
783 __ Move(i.OutputRegister(1), i.InputRegister(1)); | 783 __ Move(i.OutputRegister(1), i.InputRegister(1)); |
784 } | 784 } |
785 if (use_temp) { | 785 if (use_temp) { |
786 __ Move(i.OutputRegister(0), i.TempRegister(0)); | 786 __ Move(i.OutputRegister(0), i.TempRegister(0)); |
787 } | 787 } |
788 break; | 788 break; |
789 } | 789 } |
| 790 case kX87SubPair: { |
| 791 // i.OutputRegister(0) == i.InputRegister(0) ... left low word. |
| 792 // i.InputRegister(1) ... left high word. |
| 793 // i.InputRegister(2) ... right low word. |
| 794 // i.InputRegister(3) ... right high word. |
| 795 bool use_temp = false; |
| 796 if (i.OutputRegister(0).code() == i.InputRegister(1).code() || |
| 797 i.OutputRegister(0).code() == i.InputRegister(3).code()) { |
| 798 // We cannot write to the output register directly, because it would |
| 799 // overwrite an input for adc. We have to use the temp register. |
| 800 use_temp = true; |
| 801 __ Move(i.TempRegister(0), i.InputRegister(0)); |
| 802 __ sub(i.TempRegister(0), i.InputRegister(2)); |
| 803 } else { |
| 804 __ sub(i.OutputRegister(0), i.InputRegister(2)); |
| 805 } |
| 806 __ sbb(i.InputRegister(1), Operand(i.InputRegister(3))); |
| 807 if (i.OutputRegister(1).code() != i.InputRegister(1).code()) { |
| 808 __ Move(i.OutputRegister(1), i.InputRegister(1)); |
| 809 } |
| 810 if (use_temp) { |
| 811 __ Move(i.OutputRegister(0), i.TempRegister(0)); |
| 812 } |
| 813 break; |
| 814 } |
790 case kX87ShlPair: | 815 case kX87ShlPair: |
791 if (HasImmediateInput(instr, 2)) { | 816 if (HasImmediateInput(instr, 2)) { |
792 __ ShlPair(i.InputRegister(1), i.InputRegister(0), i.InputInt6(2)); | 817 __ ShlPair(i.InputRegister(1), i.InputRegister(0), i.InputInt6(2)); |
793 } else { | 818 } else { |
794 // Shift has been loaded into CL by the register allocator. | 819 // Shift has been loaded into CL by the register allocator. |
795 __ ShlPair_cl(i.InputRegister(1), i.InputRegister(0)); | 820 __ ShlPair_cl(i.InputRegister(1), i.InputRegister(0)); |
796 } | 821 } |
797 break; | 822 break; |
798 case kX87ShrPair: | 823 case kX87ShrPair: |
799 if (HasImmediateInput(instr, 2)) { | 824 if (HasImmediateInput(instr, 2)) { |
(...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2379 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2404 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
2380 __ Nop(padding_size); | 2405 __ Nop(padding_size); |
2381 } | 2406 } |
2382 } | 2407 } |
2383 | 2408 |
2384 #undef __ | 2409 #undef __ |
2385 | 2410 |
2386 } // namespace compiler | 2411 } // namespace compiler |
2387 } // namespace internal | 2412 } // namespace internal |
2388 } // namespace v8 | 2413 } // namespace v8 |
OLD | NEW |