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

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

Issue 1485833003: MIPS:[turbofan] Use Nor instruction for bit negation instead of xori. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | « src/compiler/mips/code-generator-mips.cc ('k') | src/compiler/mips64/code-generator-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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 m.right().Is(-1)) { 299 m.right().Is(-1)) {
300 Int32BinopMatcher mleft(m.left().node()); 300 Int32BinopMatcher mleft(m.left().node());
301 if (!mleft.right().HasValue()) { 301 if (!mleft.right().HasValue()) {
302 MipsOperandGenerator g(this); 302 MipsOperandGenerator g(this);
303 Emit(kMipsNor, g.DefineAsRegister(node), 303 Emit(kMipsNor, g.DefineAsRegister(node),
304 g.UseRegister(mleft.left().node()), 304 g.UseRegister(mleft.left().node()),
305 g.UseRegister(mleft.right().node())); 305 g.UseRegister(mleft.right().node()));
306 return; 306 return;
307 } 307 }
308 } 308 }
309 if (m.right().Is(-1)) {
310 // Use Nor for bit negation and eliminate constant loading for xori.
311 MipsOperandGenerator g(this);
312 Emit(kMipsNor, g.DefineAsRegister(node), g.UseRegister(m.left().node()),
313 g.TempImmediate(0));
314 return;
315 }
309 VisitBinop(this, node, kMipsXor); 316 VisitBinop(this, node, kMipsXor);
310 } 317 }
311 318
312 319
313 void InstructionSelector::VisitWord32Shl(Node* node) { 320 void InstructionSelector::VisitWord32Shl(Node* node) {
314 VisitRRO(this, kMipsShl, node); 321 VisitRRO(this, kMipsShl, node);
315 } 322 }
316 323
317 324
318 void InstructionSelector::VisitWord32Shr(Node* node) { 325 void InstructionSelector::VisitWord32Shr(Node* node) {
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 MachineOperatorBuilder::kFloat32Max | 1213 MachineOperatorBuilder::kFloat32Max |
1207 MachineOperatorBuilder::kFloat32RoundDown | 1214 MachineOperatorBuilder::kFloat32RoundDown |
1208 MachineOperatorBuilder::kFloat32RoundUp | 1215 MachineOperatorBuilder::kFloat32RoundUp |
1209 MachineOperatorBuilder::kFloat32RoundTruncate | 1216 MachineOperatorBuilder::kFloat32RoundTruncate |
1210 MachineOperatorBuilder::kFloat32RoundTiesEven; 1217 MachineOperatorBuilder::kFloat32RoundTiesEven;
1211 } 1218 }
1212 1219
1213 } // namespace compiler 1220 } // namespace compiler
1214 } // namespace internal 1221 } // namespace internal
1215 } // namespace v8 1222 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/mips/code-generator-mips.cc ('k') | src/compiler/mips64/code-generator-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698