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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |