Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: src/compiler/mips/instruction-selector-mips.cc

Issue 2235703002: MIPS: [compiler] [wasm] Introduce Word32/64ReverseBytes as TF Optional Opcode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/base/bits.h" 6 #include "src/base/bits.h"
7 #include "src/compiler/instruction-selector-impl.h" 7 #include "src/compiler/instruction-selector-impl.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 10
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 475
476 void InstructionSelector::VisitWord32Clz(Node* node) { 476 void InstructionSelector::VisitWord32Clz(Node* node) {
477 VisitRR(this, kMipsClz, node); 477 VisitRR(this, kMipsClz, node);
478 } 478 }
479 479
480 480
481 void InstructionSelector::VisitWord32ReverseBits(Node* node) { UNREACHABLE(); } 481 void InstructionSelector::VisitWord32ReverseBits(Node* node) { UNREACHABLE(); }
482 482
483 void InstructionSelector::VisitWord64ReverseBytes(Node* node) { UNREACHABLE(); } 483 void InstructionSelector::VisitWord64ReverseBytes(Node* node) { UNREACHABLE(); }
484 484
485 void InstructionSelector::VisitWord32ReverseBytes(Node* node) { UNREACHABLE(); } 485 void InstructionSelector::VisitWord32ReverseBytes(Node* node) {
486 MipsOperandGenerator g(this);
487 Emit(kMipsByteSwap32, g.DefineAsRegister(node),
488 g.UseRegister(node->InputAt(0)));
489 }
486 490
487 void InstructionSelector::VisitWord32Ctz(Node* node) { 491 void InstructionSelector::VisitWord32Ctz(Node* node) {
488 MipsOperandGenerator g(this); 492 MipsOperandGenerator g(this);
489 Emit(kMipsCtz, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0))); 493 Emit(kMipsCtz, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)));
490 } 494 }
491 495
492 496
493 void InstructionSelector::VisitWord32Popcnt(Node* node) { 497 void InstructionSelector::VisitWord32Popcnt(Node* node) {
494 MipsOperandGenerator g(this); 498 MipsOperandGenerator g(this);
495 Emit(kMipsPopcnt, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0))); 499 Emit(kMipsPopcnt, g.DefineAsRegister(node), g.UseRegister(node->InputAt(0)));
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1612 } 1616 }
1613 1617
1614 return flags | MachineOperatorBuilder::kWord32Ctz | 1618 return flags | MachineOperatorBuilder::kWord32Ctz |
1615 MachineOperatorBuilder::kWord32Popcnt | 1619 MachineOperatorBuilder::kWord32Popcnt |
1616 MachineOperatorBuilder::kInt32DivIsSafe | 1620 MachineOperatorBuilder::kInt32DivIsSafe |
1617 MachineOperatorBuilder::kUint32DivIsSafe | 1621 MachineOperatorBuilder::kUint32DivIsSafe |
1618 MachineOperatorBuilder::kWord32ShiftIsSafe | 1622 MachineOperatorBuilder::kWord32ShiftIsSafe |
1619 MachineOperatorBuilder::kFloat32RoundDown | 1623 MachineOperatorBuilder::kFloat32RoundDown |
1620 MachineOperatorBuilder::kFloat32RoundUp | 1624 MachineOperatorBuilder::kFloat32RoundUp |
1621 MachineOperatorBuilder::kFloat32RoundTruncate | 1625 MachineOperatorBuilder::kFloat32RoundTruncate |
1622 MachineOperatorBuilder::kFloat32RoundTiesEven; 1626 MachineOperatorBuilder::kFloat32RoundTiesEven |
1627 MachineOperatorBuilder::kWord32ReverseBytes |
1628 MachineOperatorBuilder::kWord64ReverseBytes;
1623 } 1629 }
1624 1630
1625 // static 1631 // static
1626 MachineOperatorBuilder::AlignmentRequirements 1632 MachineOperatorBuilder::AlignmentRequirements
1627 InstructionSelector::AlignmentRequirements() { 1633 InstructionSelector::AlignmentRequirements() {
1628 if (IsMipsArchVariant(kMips32r6)) { 1634 if (IsMipsArchVariant(kMips32r6)) {
1629 return MachineOperatorBuilder::AlignmentRequirements:: 1635 return MachineOperatorBuilder::AlignmentRequirements::
1630 FullUnalignedAccessSupport(); 1636 FullUnalignedAccessSupport();
1631 } else { 1637 } else {
1632 DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) || 1638 DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) ||
1633 IsMipsArchVariant(kMips32r2)); 1639 IsMipsArchVariant(kMips32r2));
1634 return MachineOperatorBuilder::AlignmentRequirements:: 1640 return MachineOperatorBuilder::AlignmentRequirements::
1635 NoUnalignedAccessSupport(); 1641 NoUnalignedAccessSupport();
1636 } 1642 }
1637 } 1643 }
1638 1644
1639 } // namespace compiler 1645 } // namespace compiler
1640 } // namespace internal 1646 } // namespace internal
1641 } // namespace v8 1647 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips/instruction-codes-mips.h ('k') | src/compiler/mips64/code-generator-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698