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

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

Issue 438563002: Fix detection of UBFX in case of Word32And with immediate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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/compiler/instruction-selector-impl.h" 5 #include "src/compiler/instruction-selector-impl.h"
6 #include "src/compiler/node-matchers.h" 6 #include "src/compiler/node-matchers.h"
7 #include "src/compiler-intrinsics.h" 7 #include "src/compiler-intrinsics.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 Int32BinopMatcher mright(m.right().node()); 411 Int32BinopMatcher mright(m.right().node());
412 if (mright.right().Is(-1)) { 412 if (mright.right().Is(-1)) {
413 EmitBic(this, node, m.left().node(), mright.left().node()); 413 EmitBic(this, node, m.left().node(), mright.left().node());
414 return; 414 return;
415 } 415 }
416 } 416 }
417 if (CpuFeatures::IsSupported(ARMv7) && m.right().HasValue()) { 417 if (CpuFeatures::IsSupported(ARMv7) && m.right().HasValue()) {
418 uint32_t value = m.right().Value(); 418 uint32_t value = m.right().Value();
419 uint32_t width = CompilerIntrinsics::CountSetBits(value); 419 uint32_t width = CompilerIntrinsics::CountSetBits(value);
420 uint32_t msb = CompilerIntrinsics::CountLeadingZeros(value); 420 uint32_t msb = CompilerIntrinsics::CountLeadingZeros(value);
421 if (msb + width == 32) { 421 if (width != 0 && msb + width == 32) {
422 ASSERT_EQ(0, CompilerIntrinsics::CountTrailingZeros(value)); 422 ASSERT_EQ(0, CompilerIntrinsics::CountTrailingZeros(value));
423 if (m.left().IsWord32Shr()) { 423 if (m.left().IsWord32Shr()) {
424 Int32BinopMatcher mleft(m.left().node()); 424 Int32BinopMatcher mleft(m.left().node());
425 if (mleft.right().IsInRange(0, 31)) { 425 if (mleft.right().IsInRange(0, 31)) {
426 Emit(kArmUbfx, g.DefineAsRegister(node), 426 Emit(kArmUbfx, g.DefineAsRegister(node),
427 g.UseRegister(mleft.left().node()), 427 g.UseRegister(mleft.left().node()),
428 g.UseImmediate(mleft.right().node()), g.TempImmediate(width)); 428 g.UseImmediate(mleft.right().node()), g.TempImmediate(width));
429 return; 429 return;
430 } 430 }
431 } 431 }
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 ASSERT(cont->IsSet()); 880 ASSERT(cont->IsSet());
881 Emit(cont->Encode(kArmVcmpF64), g.DefineAsRegister(cont->result()), 881 Emit(cont->Encode(kArmVcmpF64), g.DefineAsRegister(cont->result()),
882 g.UseDoubleRegister(m.left().node()), 882 g.UseDoubleRegister(m.left().node()),
883 g.UseDoubleRegister(m.right().node())); 883 g.UseDoubleRegister(m.right().node()));
884 } 884 }
885 } 885 }
886 886
887 } // namespace compiler 887 } // namespace compiler
888 } // namespace internal 888 } // namespace internal
889 } // namespace v8 889 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698