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

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

Issue 2647283009: [mips] Fix code generation bug in handling of immediates (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | src/compiler/mips64/instruction-selector-mips64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 Int32BinopMatcher m(node); 166 Int32BinopMatcher m(node);
167 InstructionOperand inputs[4]; 167 InstructionOperand inputs[4];
168 size_t input_count = 0; 168 size_t input_count = 0;
169 InstructionOperand outputs[2]; 169 InstructionOperand outputs[2];
170 size_t output_count = 0; 170 size_t output_count = 0;
171 171
172 if (TryMatchImmediate(selector, &opcode, m.right().node(), &input_count, 172 if (TryMatchImmediate(selector, &opcode, m.right().node(), &input_count,
173 &inputs[1])) { 173 &inputs[1])) {
174 inputs[0] = g.UseRegister(m.left().node()); 174 inputs[0] = g.UseRegister(m.left().node());
175 input_count++; 175 input_count++;
176 } 176 } else if (has_reverse_opcode &&
177 if (has_reverse_opcode && 177 TryMatchImmediate(selector, &reverse_opcode, m.left().node(),
178 TryMatchImmediate(selector, &reverse_opcode, m.left().node(), 178 &input_count, &inputs[1])) {
179 &input_count, &inputs[1])) {
180 inputs[0] = g.UseRegister(m.right().node()); 179 inputs[0] = g.UseRegister(m.right().node());
181 opcode = reverse_opcode; 180 opcode = reverse_opcode;
182 input_count++; 181 input_count++;
183 } else { 182 } else {
184 inputs[input_count++] = g.UseRegister(m.left().node()); 183 inputs[input_count++] = g.UseRegister(m.left().node());
185 inputs[input_count++] = g.UseOperand(m.right().node(), opcode); 184 inputs[input_count++] = g.UseOperand(m.right().node(), opcode);
186 } 185 }
187 186
188 if (cont->IsBranch()) { 187 if (cont->IsBranch()) {
189 inputs[input_count++] = g.Label(cont->true_block()); 188 inputs[input_count++] = g.Label(cont->true_block());
(...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1900 DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) || 1899 DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) ||
1901 IsMipsArchVariant(kMips32r2)); 1900 IsMipsArchVariant(kMips32r2));
1902 return MachineOperatorBuilder::AlignmentRequirements:: 1901 return MachineOperatorBuilder::AlignmentRequirements::
1903 NoUnalignedAccessSupport(); 1902 NoUnalignedAccessSupport();
1904 } 1903 }
1905 } 1904 }
1906 1905
1907 } // namespace compiler 1906 } // namespace compiler
1908 } // namespace internal 1907 } // namespace internal
1909 } // namespace v8 1908 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/mips64/instruction-selector-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698