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/node-properties.h" | 7 #include "src/compiler/node-properties.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 namespace { | 1059 namespace { |
1060 | 1060 |
1061 bool TryEmitBitfieldExtract32(InstructionSelector* selector, Node* node) { | 1061 bool TryEmitBitfieldExtract32(InstructionSelector* selector, Node* node) { |
1062 Arm64OperandGenerator g(selector); | 1062 Arm64OperandGenerator g(selector); |
1063 Int32BinopMatcher m(node); | 1063 Int32BinopMatcher m(node); |
1064 if (selector->CanCover(node, m.left().node()) && m.left().IsWord32Shl()) { | 1064 if (selector->CanCover(node, m.left().node()) && m.left().IsWord32Shl()) { |
1065 // Select Ubfx or Sbfx for (x << (K & 0x1f)) OP (K & 0x1f), where | 1065 // Select Ubfx or Sbfx for (x << (K & 0x1f)) OP (K & 0x1f), where |
1066 // OP is >>> or >> and (K & 0x1f) != 0. | 1066 // OP is >>> or >> and (K & 0x1f) != 0. |
1067 Int32BinopMatcher mleft(m.left().node()); | 1067 Int32BinopMatcher mleft(m.left().node()); |
1068 if (mleft.right().HasValue() && m.right().HasValue() && | 1068 if (mleft.right().HasValue() && m.right().HasValue() && |
| 1069 (mleft.right().Value() & 0x1f) != 0 && |
1069 (mleft.right().Value() & 0x1f) == (m.right().Value() & 0x1f)) { | 1070 (mleft.right().Value() & 0x1f) == (m.right().Value() & 0x1f)) { |
1070 DCHECK(m.IsWord32Shr() || m.IsWord32Sar()); | 1071 DCHECK(m.IsWord32Shr() || m.IsWord32Sar()); |
1071 ArchOpcode opcode = m.IsWord32Sar() ? kArm64Sbfx32 : kArm64Ubfx32; | 1072 ArchOpcode opcode = m.IsWord32Sar() ? kArm64Sbfx32 : kArm64Ubfx32; |
1072 | 1073 |
1073 int right_val = m.right().Value() & 0x1f; | 1074 int right_val = m.right().Value() & 0x1f; |
1074 DCHECK_NE(right_val, 0); | 1075 DCHECK_NE(right_val, 0); |
1075 | 1076 |
1076 selector->Emit(opcode, g.DefineAsRegister(node), | 1077 selector->Emit(opcode, g.DefineAsRegister(node), |
1077 g.UseRegister(mleft.left().node()), g.TempImmediate(0), | 1078 g.UseRegister(mleft.left().node()), g.TempImmediate(0), |
1078 g.TempImmediate(32 - right_val)); | 1079 g.TempImmediate(32 - right_val)); |
(...skipping 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2919 // static | 2920 // static |
2920 MachineOperatorBuilder::AlignmentRequirements | 2921 MachineOperatorBuilder::AlignmentRequirements |
2921 InstructionSelector::AlignmentRequirements() { | 2922 InstructionSelector::AlignmentRequirements() { |
2922 return MachineOperatorBuilder::AlignmentRequirements:: | 2923 return MachineOperatorBuilder::AlignmentRequirements:: |
2923 FullUnalignedAccessSupport(); | 2924 FullUnalignedAccessSupport(); |
2924 } | 2925 } |
2925 | 2926 |
2926 } // namespace compiler | 2927 } // namespace compiler |
2927 } // namespace internal | 2928 } // namespace internal |
2928 } // namespace v8 | 2929 } // namespace v8 |
OLD | NEW |