Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 875 case kS390_SubPair: | 875 case kS390_SubPair: |
| 876 // i.InputRegister(0) ... left low word. | 876 // i.InputRegister(0) ... left low word. |
| 877 // i.InputRegister(1) ... left high word. | 877 // i.InputRegister(1) ... left high word. |
| 878 // i.InputRegister(2) ... right low word. | 878 // i.InputRegister(2) ... right low word. |
| 879 // i.InputRegister(3) ... right high word. | 879 // i.InputRegister(3) ... right high word. |
| 880 __ SubLogical32(i.OutputRegister(0), i.InputRegister(0), | 880 __ SubLogical32(i.OutputRegister(0), i.InputRegister(0), |
| 881 i.InputRegister(2)); | 881 i.InputRegister(2)); |
| 882 __ SubLogicalWithBorrow32(i.OutputRegister(1), i.InputRegister(1), | 882 __ SubLogicalWithBorrow32(i.OutputRegister(1), i.InputRegister(1), |
| 883 i.InputRegister(3)); | 883 i.InputRegister(3)); |
| 884 break; | 884 break; |
| 885 case kS390_MulPair: | |
|
JoranSiu
2016/03/30 21:23:19
Why don't we load the full 64-bit value in R0 and
john.yan
2016/03/31 03:50:36
OK.
| |
| 886 // r3 i.InputRegister(0) ... left low word. | |
| 887 // r2 i.InputRegister(1) ... left high word. | |
| 888 // r5 i.InputRegister(2) ... right low word. | |
| 889 // r4 i.InputRegister(3) ... right high word. | |
| 890 // The following sequence was inspired by gcc | |
| 891 // r1 = (I1 + (I0 >> 31)) * I2 | |
| 892 // r0 = (I3 + (I2 >> 31)) * I0 | |
| 893 // r1 += r0 | |
| 894 // push r1 | |
| 895 // r0:r1 = I0 * I2 | |
| 896 // O0 = r1 | |
| 897 // pop O1 | |
| 898 // O1 += r0 | |
| 899 __ lr(r1, i.InputRegister(0)); | |
| 900 __ lr(r0, i.InputRegister(2)); | |
| 901 __ srl(r1, Operand(31)); | |
| 902 __ srl(r0, Operand(31)); | |
| 903 __ ar(r1, i.InputRegister(1)); | |
| 904 __ ar(r0, i.InputRegister(3)); | |
| 905 __ msr(r1, i.InputRegister(2)); | |
| 906 __ msr(r0, i.InputRegister(0)); | |
| 907 __ ar(r1, r0); | |
| 908 __ push(r1); | |
| 909 __ lr(r1, i.InputRegister(0)); | |
| 910 __ mr_z(r0, i.InputRegister(2)); | |
| 911 __ lr(i.OutputRegister(0), r1); | |
| 912 __ pop(i.OutputRegister(1)); | |
| 913 __ ar(i.OutputRegister(1), r0); | |
| 914 break; | |
| 885 case kS390_ShiftLeftPair: | 915 case kS390_ShiftLeftPair: |
| 886 if (instr->InputAt(2)->IsImmediate()) { | 916 if (instr->InputAt(2)->IsImmediate()) { |
| 887 __ ShiftLeftPair(i.OutputRegister(0), i.OutputRegister(1), | 917 __ ShiftLeftPair(i.OutputRegister(0), i.OutputRegister(1), |
| 888 i.InputRegister(0), i.InputRegister(1), | 918 i.InputRegister(0), i.InputRegister(1), |
| 889 i.InputInt32(2)); | 919 i.InputInt32(2)); |
| 890 } else { | 920 } else { |
| 891 __ ShiftLeftPair(i.OutputRegister(0), i.OutputRegister(1), | 921 __ ShiftLeftPair(i.OutputRegister(0), i.OutputRegister(1), |
| 892 i.InputRegister(0), i.InputRegister(1), kScratchReg, | 922 i.InputRegister(0), i.InputRegister(1), kScratchReg, |
| 893 i.InputRegister(2)); | 923 i.InputRegister(2)); |
| 894 } | 924 } |
| (...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2067 padding_size -= 2; | 2097 padding_size -= 2; |
| 2068 } | 2098 } |
| 2069 } | 2099 } |
| 2070 } | 2100 } |
| 2071 | 2101 |
| 2072 #undef __ | 2102 #undef __ |
| 2073 | 2103 |
| 2074 } // namespace compiler | 2104 } // namespace compiler |
| 2075 } // namespace internal | 2105 } // namespace internal |
| 2076 } // namespace v8 | 2106 } // namespace v8 |
| OLD | NEW |