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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 } | 470 } |
471 } | 471 } |
472 } | 472 } |
473 if (mb >= me) { | 473 if (mb >= me) { |
474 Emit(kS390_RotLeftAndMask32, g.DefineAsRegister(node), | 474 Emit(kS390_RotLeftAndMask32, g.DefineAsRegister(node), |
475 g.UseRegister(left), g.TempImmediate(sh), g.TempImmediate(mb), | 475 g.UseRegister(left), g.TempImmediate(sh), g.TempImmediate(mb), |
476 g.TempImmediate(me)); | 476 g.TempImmediate(me)); |
477 return; | 477 return; |
478 } | 478 } |
479 } | 479 } |
480 VisitBinop<Int32BinopMatcher>(this, node, kS390_And, kInt16Imm_Unsigned); | 480 VisitBinop<Int32BinopMatcher>(this, node, kS390_And32, kInt16Imm_Unsigned); |
481 } | 481 } |
482 | 482 |
483 #if V8_TARGET_ARCH_S390X | 483 #if V8_TARGET_ARCH_S390X |
484 void InstructionSelector::VisitWord64And(Node* node) { | 484 void InstructionSelector::VisitWord64And(Node* node) { |
485 S390OperandGenerator g(this); | 485 S390OperandGenerator g(this); |
486 Int64BinopMatcher m(node); | 486 Int64BinopMatcher m(node); |
487 int mb = 0; | 487 int mb = 0; |
488 int me = 0; | 488 int me = 0; |
489 if (m.right().HasValue() && IsContiguousMask64(m.right().Value(), &mb, &me)) { | 489 if (m.right().HasValue() && IsContiguousMask64(m.right().Value(), &mb, &me)) { |
490 int sh = 0; | 490 int sh = 0; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 opcode = kS390_RotLeftAndClear64; | 522 opcode = kS390_RotLeftAndClear64; |
523 mask = mb; | 523 mask = mb; |
524 } | 524 } |
525 if (match) { | 525 if (match) { |
526 Emit(opcode, g.DefineAsRegister(node), g.UseRegister(left), | 526 Emit(opcode, g.DefineAsRegister(node), g.UseRegister(left), |
527 g.TempImmediate(sh), g.TempImmediate(mask)); | 527 g.TempImmediate(sh), g.TempImmediate(mask)); |
528 return; | 528 return; |
529 } | 529 } |
530 } | 530 } |
531 } | 531 } |
532 VisitBinop<Int64BinopMatcher>(this, node, kS390_And, kInt16Imm_Unsigned); | 532 VisitBinop<Int64BinopMatcher>(this, node, kS390_And64, kInt16Imm_Unsigned); |
533 } | 533 } |
534 #endif | 534 #endif |
535 | 535 |
536 void InstructionSelector::VisitWord32Or(Node* node) { | 536 void InstructionSelector::VisitWord32Or(Node* node) { |
537 Int32BinopMatcher m(node); | 537 Int32BinopMatcher m(node); |
538 VisitBinop<Int32BinopMatcher>(this, node, kS390_Or, kInt16Imm_Unsigned); | 538 VisitBinop<Int32BinopMatcher>(this, node, kS390_Or32, kInt16Imm_Unsigned); |
539 } | 539 } |
540 | 540 |
541 #if V8_TARGET_ARCH_S390X | 541 #if V8_TARGET_ARCH_S390X |
542 void InstructionSelector::VisitWord64Or(Node* node) { | 542 void InstructionSelector::VisitWord64Or(Node* node) { |
543 Int64BinopMatcher m(node); | 543 Int64BinopMatcher m(node); |
544 VisitBinop<Int64BinopMatcher>(this, node, kS390_Or, kInt16Imm_Unsigned); | 544 VisitBinop<Int64BinopMatcher>(this, node, kS390_Or64, kInt16Imm_Unsigned); |
545 } | 545 } |
546 #endif | 546 #endif |
547 | 547 |
548 void InstructionSelector::VisitWord32Xor(Node* node) { | 548 void InstructionSelector::VisitWord32Xor(Node* node) { |
549 S390OperandGenerator g(this); | 549 S390OperandGenerator g(this); |
550 Int32BinopMatcher m(node); | 550 Int32BinopMatcher m(node); |
551 if (m.right().Is(-1)) { | 551 if (m.right().Is(-1)) { |
552 Emit(kS390_Not, g.DefineAsRegister(node), g.UseRegister(m.left().node())); | 552 Emit(kS390_Not32, g.DefineAsRegister(node), g.UseRegister(m.left().node())); |
553 } else { | 553 } else { |
554 VisitBinop<Int32BinopMatcher>(this, node, kS390_Xor, kInt16Imm_Unsigned); | 554 VisitBinop<Int32BinopMatcher>(this, node, kS390_Xor32, kInt16Imm_Unsigned); |
555 } | 555 } |
556 } | 556 } |
557 | 557 |
558 #if V8_TARGET_ARCH_S390X | 558 #if V8_TARGET_ARCH_S390X |
559 void InstructionSelector::VisitWord64Xor(Node* node) { | 559 void InstructionSelector::VisitWord64Xor(Node* node) { |
560 S390OperandGenerator g(this); | 560 S390OperandGenerator g(this); |
561 Int64BinopMatcher m(node); | 561 Int64BinopMatcher m(node); |
562 if (m.right().Is(-1)) { | 562 if (m.right().Is(-1)) { |
563 Emit(kS390_Not, g.DefineAsRegister(node), g.UseRegister(m.left().node())); | 563 Emit(kS390_Not64, g.DefineAsRegister(node), g.UseRegister(m.left().node())); |
564 } else { | 564 } else { |
565 VisitBinop<Int64BinopMatcher>(this, node, kS390_Xor, kInt16Imm_Unsigned); | 565 VisitBinop<Int64BinopMatcher>(this, node, kS390_Xor64, kInt16Imm_Unsigned); |
566 } | 566 } |
567 } | 567 } |
568 #endif | 568 #endif |
569 | 569 |
570 void InstructionSelector::VisitWord32Shl(Node* node) { | 570 void InstructionSelector::VisitWord32Shl(Node* node) { |
571 S390OperandGenerator g(this); | 571 S390OperandGenerator g(this); |
572 Int32BinopMatcher m(node); | 572 Int32BinopMatcher m(node); |
573 if (m.left().IsWord32And() && m.right().IsInRange(0, 31)) { | 573 if (m.left().IsWord32And() && m.right().IsInRange(0, 31)) { |
574 Int32BinopMatcher mleft(m.left().node()); | 574 Int32BinopMatcher mleft(m.left().node()); |
575 int sh = m.right().Value(); | 575 int sh = m.right().Value(); |
(...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1885 // static | 1885 // static |
1886 MachineOperatorBuilder::AlignmentRequirements | 1886 MachineOperatorBuilder::AlignmentRequirements |
1887 InstructionSelector::AlignmentRequirements() { | 1887 InstructionSelector::AlignmentRequirements() { |
1888 return MachineOperatorBuilder::AlignmentRequirements:: | 1888 return MachineOperatorBuilder::AlignmentRequirements:: |
1889 FullUnalignedAccessSupport(); | 1889 FullUnalignedAccessSupport(); |
1890 } | 1890 } |
1891 | 1891 |
1892 } // namespace compiler | 1892 } // namespace compiler |
1893 } // namespace internal | 1893 } // namespace internal |
1894 } // namespace v8 | 1894 } // namespace v8 |
OLD | NEW |