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/base/adapters.h" | 5 #include "src/base/adapters.h" |
6 #include "src/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 #include "src/s390/frames-s390.h" | 9 #include "src/s390/frames-s390.h" |
10 | 10 |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
382 // return true; | 382 // return true; |
383 // default: | 383 // default: |
384 // return false; | 384 // return false; |
385 // } | 385 // } |
386 // } | 386 // } |
387 case IrOpcode::kLoad: { | 387 case IrOpcode::kLoad: { |
388 LoadRepresentation load_rep = LoadRepresentationOf(node->op()); | 388 LoadRepresentation load_rep = LoadRepresentationOf(node->op()); |
389 switch (load_rep.representation()) { | 389 switch (load_rep.representation()) { |
390 case MachineRepresentation::kWord32: | 390 case MachineRepresentation::kWord32: |
391 return true; | 391 return true; |
392 case MachineRepresentation::kWord8: | |
393 if (load_rep.IsSigned()) | |
394 return false; | |
395 else | |
396 return true; | |
392 default: | 397 default: |
393 return false; | 398 return false; |
394 } | 399 } |
395 } | 400 } |
396 default: | 401 default: |
397 return false; | 402 return false; |
398 } | 403 } |
399 #endif | 404 #endif |
400 } | 405 } |
401 | 406 |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1235 #if V8_TARGET_ARCH_S390X | 1240 #if V8_TARGET_ARCH_S390X |
1236 void InstructionSelector::VisitWord64Ctz(Node* node) { UNREACHABLE(); } | 1241 void InstructionSelector::VisitWord64Ctz(Node* node) { UNREACHABLE(); } |
1237 #endif | 1242 #endif |
1238 | 1243 |
1239 void InstructionSelector::VisitWord32ReverseBits(Node* node) { UNREACHABLE(); } | 1244 void InstructionSelector::VisitWord32ReverseBits(Node* node) { UNREACHABLE(); } |
1240 | 1245 |
1241 #if V8_TARGET_ARCH_S390X | 1246 #if V8_TARGET_ARCH_S390X |
1242 void InstructionSelector::VisitWord64ReverseBits(Node* node) { UNREACHABLE(); } | 1247 void InstructionSelector::VisitWord64ReverseBits(Node* node) { UNREACHABLE(); } |
1243 #endif | 1248 #endif |
1244 | 1249 |
1250 void InstructionSelector::VisitInt32AbsWithOverflow(Node* node) { | |
1251 UNREACHABLE(); | |
Benedikt Meurer
2017/03/31 04:33:08
Can you also provide a baseline implementation of
| |
1252 } | |
1253 | |
1254 void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) { | |
1255 UNREACHABLE(); | |
Benedikt Meurer
2017/03/31 04:33:08
Same here.
| |
1256 } | |
1257 | |
1245 void InstructionSelector::VisitWord64ReverseBytes(Node* node) { | 1258 void InstructionSelector::VisitWord64ReverseBytes(Node* node) { |
1246 S390OperandGenerator g(this); | 1259 S390OperandGenerator g(this); |
1247 Emit(kS390_LoadReverse64RR, g.DefineAsRegister(node), | 1260 Emit(kS390_LoadReverse64RR, g.DefineAsRegister(node), |
1248 g.UseRegister(node->InputAt(0))); | 1261 g.UseRegister(node->InputAt(0))); |
1249 } | 1262 } |
1250 | 1263 |
1251 void InstructionSelector::VisitWord32ReverseBytes(Node* node) { | 1264 void InstructionSelector::VisitWord32ReverseBytes(Node* node) { |
1252 S390OperandGenerator g(this); | 1265 S390OperandGenerator g(this); |
1253 NodeMatcher input(node->InputAt(0)); | 1266 NodeMatcher input(node->InputAt(0)); |
1254 if (CanCover(node, input.node()) && input.IsLoad()) { | 1267 if (CanCover(node, input.node()) && input.IsLoad()) { |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2030 case IrOpcode::kInt32SubWithOverflow: | 2043 case IrOpcode::kInt32SubWithOverflow: |
2031 cont->OverwriteAndNegateIfEqual(kOverflow); | 2044 cont->OverwriteAndNegateIfEqual(kOverflow); |
2032 return VisitWord32BinOp(selector, node, kS390_Sub32, | 2045 return VisitWord32BinOp(selector, node, kS390_Sub32, |
2033 SubOperandMode, cont); | 2046 SubOperandMode, cont); |
2034 case IrOpcode::kInt32MulWithOverflow: | 2047 case IrOpcode::kInt32MulWithOverflow: |
2035 cont->OverwriteAndNegateIfEqual(kNotEqual); | 2048 cont->OverwriteAndNegateIfEqual(kNotEqual); |
2036 return VisitWord32BinOp( | 2049 return VisitWord32BinOp( |
2037 selector, node, kS390_Mul32WithOverflow, | 2050 selector, node, kS390_Mul32WithOverflow, |
2038 OperandMode::kInt32Imm | OperandMode::kAllowDistinctOps, | 2051 OperandMode::kInt32Imm | OperandMode::kAllowDistinctOps, |
2039 cont); | 2052 cont); |
2053 case IrOpcode::kInt32AbsWithOverflow: | |
2054 cont->OverwriteAndNegateIfEqual(kOverflow); | |
2055 return VisitWord32UnaryOp(selector, node, kS390_Abs32, | |
2056 OperandMode::kNone, cont); | |
2040 #if V8_TARGET_ARCH_S390X | 2057 #if V8_TARGET_ARCH_S390X |
2058 case IrOpcode::kInt64AbsWithOverflow: | |
2059 cont->OverwriteAndNegateIfEqual(kOverflow); | |
2060 return VisitWord64UnaryOp(selector, node, kS390_Abs64, | |
2061 OperandMode::kNone, cont); | |
2041 case IrOpcode::kInt64AddWithOverflow: | 2062 case IrOpcode::kInt64AddWithOverflow: |
2042 cont->OverwriteAndNegateIfEqual(kOverflow); | 2063 cont->OverwriteAndNegateIfEqual(kOverflow); |
2043 return VisitWord64BinOp(selector, node, kS390_Add64, | 2064 return VisitWord64BinOp(selector, node, kS390_Add64, |
2044 AddOperandMode, cont); | 2065 AddOperandMode, cont); |
2045 case IrOpcode::kInt64SubWithOverflow: | 2066 case IrOpcode::kInt64SubWithOverflow: |
2046 cont->OverwriteAndNegateIfEqual(kOverflow); | 2067 cont->OverwriteAndNegateIfEqual(kOverflow); |
2047 return VisitWord64BinOp(selector, node, kS390_Sub64, | 2068 return VisitWord64BinOp(selector, node, kS390_Sub64, |
2048 SubOperandMode, cont); | 2069 SubOperandMode, cont); |
2049 #endif | 2070 #endif |
2050 default: | 2071 default: |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2443 return MachineOperatorBuilder::kFloat32RoundDown | | 2464 return MachineOperatorBuilder::kFloat32RoundDown | |
2444 MachineOperatorBuilder::kFloat64RoundDown | | 2465 MachineOperatorBuilder::kFloat64RoundDown | |
2445 MachineOperatorBuilder::kFloat32RoundUp | | 2466 MachineOperatorBuilder::kFloat32RoundUp | |
2446 MachineOperatorBuilder::kFloat64RoundUp | | 2467 MachineOperatorBuilder::kFloat64RoundUp | |
2447 MachineOperatorBuilder::kFloat32RoundTruncate | | 2468 MachineOperatorBuilder::kFloat32RoundTruncate | |
2448 MachineOperatorBuilder::kFloat64RoundTruncate | | 2469 MachineOperatorBuilder::kFloat64RoundTruncate | |
2449 MachineOperatorBuilder::kFloat64RoundTiesAway | | 2470 MachineOperatorBuilder::kFloat64RoundTiesAway | |
2450 MachineOperatorBuilder::kWord32Popcnt | | 2471 MachineOperatorBuilder::kWord32Popcnt | |
2451 MachineOperatorBuilder::kWord32ReverseBytes | | 2472 MachineOperatorBuilder::kWord32ReverseBytes | |
2452 MachineOperatorBuilder::kWord64ReverseBytes | | 2473 MachineOperatorBuilder::kWord64ReverseBytes | |
2474 MachineOperatorBuilder::kInt32AbsWithOverflow | | |
2475 MachineOperatorBuilder::kInt64AbsWithOverflow | | |
2453 MachineOperatorBuilder::kWord64Popcnt; | 2476 MachineOperatorBuilder::kWord64Popcnt; |
2454 } | 2477 } |
2455 | 2478 |
2456 // static | 2479 // static |
2457 MachineOperatorBuilder::AlignmentRequirements | 2480 MachineOperatorBuilder::AlignmentRequirements |
2458 InstructionSelector::AlignmentRequirements() { | 2481 InstructionSelector::AlignmentRequirements() { |
2459 return MachineOperatorBuilder::AlignmentRequirements:: | 2482 return MachineOperatorBuilder::AlignmentRequirements:: |
2460 FullUnalignedAccessSupport(); | 2483 FullUnalignedAccessSupport(); |
2461 } | 2484 } |
2462 | 2485 |
2463 } // namespace compiler | 2486 } // namespace compiler |
2464 } // namespace internal | 2487 } // namespace internal |
2465 } // namespace v8 | 2488 } // namespace v8 |
OLD | NEW |