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/compilation-info.h" | 7 #include "src/compilation-info.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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 // fall through | 302 // fall through |
303 case kSignedGreaterThan: | 303 case kSignedGreaterThan: |
304 return gt; | 304 return gt; |
305 case kOverflow: | 305 case kOverflow: |
306 // Overflow checked for AddP/SubP only. | 306 // Overflow checked for AddP/SubP only. |
307 switch (op) { | 307 switch (op) { |
308 case kS390_Add32: | 308 case kS390_Add32: |
309 case kS390_Add64: | 309 case kS390_Add64: |
310 case kS390_Sub32: | 310 case kS390_Sub32: |
311 case kS390_Sub64: | 311 case kS390_Sub64: |
| 312 case kS390_Abs64: |
| 313 case kS390_Abs32: |
312 return overflow; | 314 return overflow; |
313 default: | 315 default: |
314 break; | 316 break; |
315 } | 317 } |
316 break; | 318 break; |
317 case kNotOverflow: | 319 case kNotOverflow: |
318 switch (op) { | 320 switch (op) { |
319 case kS390_Add32: | 321 case kS390_Add32: |
320 case kS390_Add64: | 322 case kS390_Add64: |
321 case kS390_Sub32: | 323 case kS390_Sub32: |
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1340 __ bind(ool->exit()); | 1342 __ bind(ool->exit()); |
1341 break; | 1343 break; |
1342 } | 1344 } |
1343 case kArchStackSlot: { | 1345 case kArchStackSlot: { |
1344 FrameOffset offset = | 1346 FrameOffset offset = |
1345 frame_access_state()->GetFrameOffset(i.InputInt32(0)); | 1347 frame_access_state()->GetFrameOffset(i.InputInt32(0)); |
1346 __ AddP(i.OutputRegister(), offset.from_stack_pointer() ? sp : fp, | 1348 __ AddP(i.OutputRegister(), offset.from_stack_pointer() ? sp : fp, |
1347 Operand(offset.offset())); | 1349 Operand(offset.offset())); |
1348 break; | 1350 break; |
1349 } | 1351 } |
| 1352 case kS390_Abs32: |
| 1353 // TODO(john.yan): zero-ext |
| 1354 __ lpr(i.OutputRegister(0), i.InputRegister(0)); |
| 1355 break; |
| 1356 case kS390_Abs64: |
| 1357 __ lpgr(i.OutputRegister(0), i.InputRegister(0)); |
| 1358 break; |
1350 case kS390_And32: | 1359 case kS390_And32: |
1351 // zero-ext | 1360 // zero-ext |
1352 if (CpuFeatures::IsSupported(DISTINCT_OPS)) { | 1361 if (CpuFeatures::IsSupported(DISTINCT_OPS)) { |
1353 ASSEMBLE_BIN32_OP(RRRInstr(nrk), RM32Instr(And), RIInstr(nilf)); | 1362 ASSEMBLE_BIN32_OP(RRRInstr(nrk), RM32Instr(And), RIInstr(nilf)); |
1354 } else { | 1363 } else { |
1355 ASSEMBLE_BIN32_OP(RRInstr(nr), RM32Instr(And), RIInstr(nilf)); | 1364 ASSEMBLE_BIN32_OP(RRInstr(nr), RM32Instr(And), RIInstr(nilf)); |
1356 } | 1365 } |
1357 break; | 1366 break; |
1358 case kS390_And64: | 1367 case kS390_And64: |
1359 if (CpuFeatures::IsSupported(DISTINCT_OPS)) { | 1368 if (CpuFeatures::IsSupported(DISTINCT_OPS)) { |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1848 // __ cebr(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); | 1857 // __ cebr(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); |
1849 break; | 1858 break; |
1850 case kS390_CmpDouble: | 1859 case kS390_CmpDouble: |
1851 ASSEMBLE_FLOAT_COMPARE(cdbr, cdb, ldy); | 1860 ASSEMBLE_FLOAT_COMPARE(cdbr, cdb, ldy); |
1852 // __ cdbr(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); | 1861 // __ cdbr(i.InputDoubleRegister(0), i.InputDoubleRegister(1)); |
1853 break; | 1862 break; |
1854 case kS390_Tst32: | 1863 case kS390_Tst32: |
1855 if (HasRegisterInput(instr, 1)) { | 1864 if (HasRegisterInput(instr, 1)) { |
1856 __ And(r0, i.InputRegister(0), i.InputRegister(1)); | 1865 __ And(r0, i.InputRegister(0), i.InputRegister(1)); |
1857 } else { | 1866 } else { |
| 1867 // detect tmlh/tmhl/tmhh case |
1858 Operand opnd = i.InputImmediate(1); | 1868 Operand opnd = i.InputImmediate(1); |
1859 if (is_uint16(opnd.immediate())) { | 1869 if (is_uint16(opnd.immediate())) { |
1860 __ tmll(i.InputRegister(0), opnd); | 1870 __ tmll(i.InputRegister(0), opnd); |
1861 } else { | 1871 } else { |
1862 __ lr(r0, i.InputRegister(0)); | 1872 __ lr(r0, i.InputRegister(0)); |
1863 __ nilf(r0, opnd); | 1873 __ nilf(r0, opnd); |
1864 } | 1874 } |
1865 } | 1875 } |
1866 break; | 1876 break; |
1867 case kS390_Tst64: | 1877 case kS390_Tst64: |
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2961 padding_size -= 2; | 2971 padding_size -= 2; |
2962 } | 2972 } |
2963 } | 2973 } |
2964 } | 2974 } |
2965 | 2975 |
2966 #undef __ | 2976 #undef __ |
2967 | 2977 |
2968 } // namespace compiler | 2978 } // namespace compiler |
2969 } // namespace internal | 2979 } // namespace internal |
2970 } // namespace v8 | 2980 } // namespace v8 |
OLD | NEW |