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

Side by Side Diff: src/compiler/int64-lowering.cc

Issue 2045943002: [compiler] [wasm] Introduce Word32/64ReverseBytes as TF Optional Opcode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use ByteReverse in simulator Created 4 years, 5 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/compiler/int64-lowering.h" 5 #include "src/compiler/int64-lowering.h"
6 #include "src/compiler/common-operator.h" 6 #include "src/compiler/common-operator.h"
7 #include "src/compiler/diamond.h" 7 #include "src/compiler/diamond.h"
8 #include "src/compiler/graph.h" 8 #include "src/compiler/graph.h"
9 #include "src/compiler/linkage.h" 9 #include "src/compiler/linkage.h"
10 #include "src/compiler/machine-operator.h" 10 #include "src/compiler/machine-operator.h"
(...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 Node* high_node = GetReplacementHigh(node); 742 Node* high_node = GetReplacementHigh(node);
743 for (int i = 0; i < node->op()->ValueInputCount(); i++) { 743 for (int i = 0; i < node->op()->ValueInputCount(); i++) {
744 low_node->ReplaceInput(i, GetReplacementLow(node->InputAt(i))); 744 low_node->ReplaceInput(i, GetReplacementLow(node->InputAt(i)));
745 high_node->ReplaceInput(i, GetReplacementHigh(node->InputAt(i))); 745 high_node->ReplaceInput(i, GetReplacementHigh(node->InputAt(i)));
746 } 746 }
747 } else { 747 } else {
748 DefaultLowering(node); 748 DefaultLowering(node);
749 } 749 }
750 break; 750 break;
751 } 751 }
752 case IrOpcode::kWord64ReverseBytes: {
753 DCHECK(machine()->Word64ReverseBytes().IsSupported());
754 DCHECK(machine()->Word32ReverseBytes().IsSupported());
755 Node* input = node->InputAt(0);
756 ReplaceNode(node, graph()->NewNode(machine()->Word32ReverseBytes().op(),
757 GetReplacementHigh(input)),
758 graph()->NewNode(machine()->Word32ReverseBytes().op(),
759 GetReplacementLow(input)));
760 break;
761 }
752 762
753 default: { DefaultLowering(node); } 763 default: { DefaultLowering(node); }
754 } 764 }
755 } // NOLINT(readability/fn_size) 765 } // NOLINT(readability/fn_size)
756 766
757 void Int64Lowering::LowerComparison(Node* node, const Operator* high_word_op, 767 void Int64Lowering::LowerComparison(Node* node, const Operator* high_word_op,
758 const Operator* low_word_op) { 768 const Operator* low_word_op) {
759 DCHECK(node->InputCount() == 2); 769 DCHECK(node->InputCount() == 2);
760 Node* left = node->InputAt(0); 770 Node* left = node->InputAt(0);
761 Node* right = node->InputAt(1); 771 Node* right = node->InputAt(1);
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 common()->Phi(MachineRepresentation::kWord32, value_count), 847 common()->Phi(MachineRepresentation::kWord32, value_count),
838 value_count + 1, inputs_low, false), 848 value_count + 1, inputs_low, false),
839 graph()->NewNode( 849 graph()->NewNode(
840 common()->Phi(MachineRepresentation::kWord32, value_count), 850 common()->Phi(MachineRepresentation::kWord32, value_count),
841 value_count + 1, inputs_high, false)); 851 value_count + 1, inputs_high, false));
842 } 852 }
843 } 853 }
844 } // namespace compiler 854 } // namespace compiler
845 } // namespace internal 855 } // namespace internal
846 } // namespace v8 856 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698