| OLD | NEW |
| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 } | 129 } |
| 130 | 130 |
| 131 | 131 |
| 132 static void VisitRR(InstructionSelector* selector, ArchOpcode opcode, | 132 static void VisitRR(InstructionSelector* selector, ArchOpcode opcode, |
| 133 Node* node) { | 133 Node* node) { |
| 134 MipsOperandGenerator g(selector); | 134 MipsOperandGenerator g(selector); |
| 135 selector->Emit(opcode, g.DefineAsRegister(node), | 135 selector->Emit(opcode, g.DefineAsRegister(node), |
| 136 g.UseRegister(node->InputAt(0))); | 136 g.UseRegister(node->InputAt(0))); |
| 137 } | 137 } |
| 138 | 138 |
| 139 static void VisitRRI(InstructionSelector* selector, ArchOpcode opcode, |
| 140 Node* node) { |
| 141 MipsOperandGenerator g(selector); |
| 142 int32_t imm = OpParameter<int32_t>(node); |
| 143 selector->Emit(opcode, g.DefineAsRegister(node), |
| 144 g.UseRegister(node->InputAt(0)), g.UseImmediate(imm)); |
| 145 } |
| 146 |
| 147 static void VisitRRIR(InstructionSelector* selector, ArchOpcode opcode, |
| 148 Node* node) { |
| 149 MipsOperandGenerator g(selector); |
| 150 int32_t imm = OpParameter<int32_t>(node); |
| 151 selector->Emit(opcode, g.DefineAsRegister(node), |
| 152 g.UseRegister(node->InputAt(0)), g.UseImmediate(imm), |
| 153 g.UseRegister(node->InputAt(1))); |
| 154 } |
| 139 | 155 |
| 140 static void VisitRRO(InstructionSelector* selector, ArchOpcode opcode, | 156 static void VisitRRO(InstructionSelector* selector, ArchOpcode opcode, |
| 141 Node* node) { | 157 Node* node) { |
| 142 MipsOperandGenerator g(selector); | 158 MipsOperandGenerator g(selector); |
| 143 selector->Emit(opcode, g.DefineAsRegister(node), | 159 selector->Emit(opcode, g.DefineAsRegister(node), |
| 144 g.UseRegister(node->InputAt(0)), | 160 g.UseRegister(node->InputAt(0)), |
| 145 g.UseOperand(node->InputAt(1), opcode)); | 161 g.UseOperand(node->InputAt(1), opcode)); |
| 146 } | 162 } |
| 147 | 163 |
| 148 bool TryMatchImmediate(InstructionSelector* selector, | 164 bool TryMatchImmediate(InstructionSelector* selector, |
| (...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1892 } | 1908 } |
| 1893 | 1909 |
| 1894 void InstructionSelector::VisitInt32AbsWithOverflow(Node* node) { | 1910 void InstructionSelector::VisitInt32AbsWithOverflow(Node* node) { |
| 1895 UNREACHABLE(); | 1911 UNREACHABLE(); |
| 1896 } | 1912 } |
| 1897 | 1913 |
| 1898 void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) { | 1914 void InstructionSelector::VisitInt64AbsWithOverflow(Node* node) { |
| 1899 UNREACHABLE(); | 1915 UNREACHABLE(); |
| 1900 } | 1916 } |
| 1901 | 1917 |
| 1918 void InstructionSelector::VisitI32x4Splat(Node* node) { |
| 1919 VisitRR(this, kMipsI32x4Splat, node); |
| 1920 } |
| 1921 |
| 1922 void InstructionSelector::VisitI32x4ExtractLane(Node* node) { |
| 1923 VisitRRI(this, kMipsI32x4ExtractLane, node); |
| 1924 } |
| 1925 |
| 1926 void InstructionSelector::VisitI32x4ReplaceLane(Node* node) { |
| 1927 VisitRRIR(this, kMipsI32x4ReplaceLane, node); |
| 1928 } |
| 1929 |
| 1930 void InstructionSelector::VisitI32x4Add(Node* node) { |
| 1931 VisitRRR(this, kMipsI32x4Add, node); |
| 1932 } |
| 1933 |
| 1934 void InstructionSelector::VisitI32x4Sub(Node* node) { |
| 1935 VisitRRR(this, kMipsI32x4Sub, node); |
| 1936 } |
| 1937 |
| 1938 void InstructionSelector::VisitS128Zero(Node* node) { |
| 1939 MipsOperandGenerator g(this); |
| 1940 Emit(kMipsS128Zero, g.DefineSameAsFirst(node)); |
| 1941 } |
| 1942 |
| 1943 void InstructionSelector::VisitS1x4Zero(Node* node) { |
| 1944 MipsOperandGenerator g(this); |
| 1945 Emit(kMipsS128Zero, g.DefineSameAsFirst(node)); |
| 1946 } |
| 1947 |
| 1948 void InstructionSelector::VisitS1x8Zero(Node* node) { |
| 1949 MipsOperandGenerator g(this); |
| 1950 Emit(kMipsS128Zero, g.DefineSameAsFirst(node)); |
| 1951 } |
| 1952 |
| 1953 void InstructionSelector::VisitS1x16Zero(Node* node) { |
| 1954 MipsOperandGenerator g(this); |
| 1955 Emit(kMipsS128Zero, g.DefineSameAsFirst(node)); |
| 1956 } |
| 1957 |
| 1902 // static | 1958 // static |
| 1903 MachineOperatorBuilder::Flags | 1959 MachineOperatorBuilder::Flags |
| 1904 InstructionSelector::SupportedMachineOperatorFlags() { | 1960 InstructionSelector::SupportedMachineOperatorFlags() { |
| 1905 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; | 1961 MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::kNoFlags; |
| 1906 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && | 1962 if ((IsMipsArchVariant(kMips32r2) || IsMipsArchVariant(kMips32r6)) && |
| 1907 IsFp64Mode()) { | 1963 IsFp64Mode()) { |
| 1908 flags |= MachineOperatorBuilder::kFloat64RoundDown | | 1964 flags |= MachineOperatorBuilder::kFloat64RoundDown | |
| 1909 MachineOperatorBuilder::kFloat64RoundUp | | 1965 MachineOperatorBuilder::kFloat64RoundUp | |
| 1910 MachineOperatorBuilder::kFloat64RoundTruncate | | 1966 MachineOperatorBuilder::kFloat64RoundTruncate | |
| 1911 MachineOperatorBuilder::kFloat64RoundTiesEven; | 1967 MachineOperatorBuilder::kFloat64RoundTiesEven; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1934 DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) || | 1990 DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) || |
| 1935 IsMipsArchVariant(kMips32r2)); | 1991 IsMipsArchVariant(kMips32r2)); |
| 1936 return MachineOperatorBuilder::AlignmentRequirements:: | 1992 return MachineOperatorBuilder::AlignmentRequirements:: |
| 1937 NoUnalignedAccessSupport(); | 1993 NoUnalignedAccessSupport(); |
| 1938 } | 1994 } |
| 1939 } | 1995 } |
| 1940 | 1996 |
| 1941 } // namespace compiler | 1997 } // namespace compiler |
| 1942 } // namespace internal | 1998 } // namespace internal |
| 1943 } // namespace v8 | 1999 } // namespace v8 |
| OLD | NEW |