Commit feeaac40 authored by jacob.bramley's avatar jacob.bramley Committed by Commit bot

[arm] Remove CpuFeature::MLS.

The MLS instruction is available in all ARMv7 devices, and in no ARMv6
devices, aside from the usual ARMv6T2 caveat. We don't need a separate
feature flag for it.

BUG=

Review-Url: https://codereview.chromium.org/1988133004
Cr-Commit-Position: refs/heads/master@{#36378}
parent b114df1d
...@@ -57,7 +57,7 @@ static unsigned CpuFeaturesImpliedByCompiler() { ...@@ -57,7 +57,7 @@ static unsigned CpuFeaturesImpliedByCompiler() {
answer |= 1u << ARMv8; answer |= 1u << ARMv8;
// ARMv8 always features VFP and NEON. // ARMv8 always features VFP and NEON.
answer |= 1u << ARMv7 | 1u << VFP3 | 1u << NEON | 1u << VFP32DREGS; answer |= 1u << ARMv7 | 1u << VFP3 | 1u << NEON | 1u << VFP32DREGS;
answer |= 1u << SUDIV | 1u << MLS; answer |= 1u << SUDIV;
} }
#endif // CAN_USE_ARMV8_INSTRUCTIONS #endif // CAN_USE_ARMV8_INSTRUCTIONS
#ifdef CAN_USE_ARMV7_INSTRUCTIONS #ifdef CAN_USE_ARMV7_INSTRUCTIONS
...@@ -93,7 +93,7 @@ void CpuFeatures::ProbeImpl(bool cross_compile) { ...@@ -93,7 +93,7 @@ void CpuFeatures::ProbeImpl(bool cross_compile) {
supported_ |= 1u << ARMv8; supported_ |= 1u << ARMv8;
// ARMv8 always features VFP and NEON. // ARMv8 always features VFP and NEON.
supported_ |= 1u << ARMv7 | 1u << VFP3 | 1u << NEON | 1u << VFP32DREGS; supported_ |= 1u << ARMv7 | 1u << VFP3 | 1u << NEON | 1u << VFP32DREGS;
supported_ |= 1u << SUDIV | 1u << MLS; supported_ |= 1u << SUDIV;
if (FLAG_enable_movw_movt) supported_ |= 1u << MOVW_MOVT_IMMEDIATE_LOADS; if (FLAG_enable_movw_movt) supported_ |= 1u << MOVW_MOVT_IMMEDIATE_LOADS;
} }
if (FLAG_enable_armv7) { if (FLAG_enable_armv7) {
...@@ -104,7 +104,6 @@ void CpuFeatures::ProbeImpl(bool cross_compile) { ...@@ -104,7 +104,6 @@ void CpuFeatures::ProbeImpl(bool cross_compile) {
if (FLAG_enable_movw_movt) supported_ |= 1u << MOVW_MOVT_IMMEDIATE_LOADS; if (FLAG_enable_movw_movt) supported_ |= 1u << MOVW_MOVT_IMMEDIATE_LOADS;
if (FLAG_enable_32dregs) supported_ |= 1u << VFP32DREGS; if (FLAG_enable_32dregs) supported_ |= 1u << VFP32DREGS;
} }
if (FLAG_enable_mls) supported_ |= 1u << MLS;
if (FLAG_enable_unaligned_accesses) supported_ |= 1u << UNALIGNED_ACCESSES; if (FLAG_enable_unaligned_accesses) supported_ |= 1u << UNALIGNED_ACCESSES;
#else // __arm__ #else // __arm__
...@@ -119,7 +118,6 @@ void CpuFeatures::ProbeImpl(bool cross_compile) { ...@@ -119,7 +118,6 @@ void CpuFeatures::ProbeImpl(bool cross_compile) {
if (FLAG_enable_neon && cpu.has_neon()) supported_ |= 1u << NEON; if (FLAG_enable_neon && cpu.has_neon()) supported_ |= 1u << NEON;
if (FLAG_enable_sudiv && cpu.has_idiva()) supported_ |= 1u << SUDIV; if (FLAG_enable_sudiv && cpu.has_idiva()) supported_ |= 1u << SUDIV;
if (FLAG_enable_mls && cpu.has_thumb2()) supported_ |= 1u << MLS;
if (cpu.architecture() >= 7) { if (cpu.architecture() >= 7) {
if (FLAG_enable_armv7) supported_ |= 1u << ARMv7; if (FLAG_enable_armv7) supported_ |= 1u << ARMv7;
...@@ -203,12 +201,11 @@ void CpuFeatures::PrintTarget() { ...@@ -203,12 +201,11 @@ void CpuFeatures::PrintTarget() {
void CpuFeatures::PrintFeatures() { void CpuFeatures::PrintFeatures() {
printf( printf(
"ARMv8=%d ARMv7=%d VFP3=%d VFP32DREGS=%d NEON=%d SUDIV=%d MLS=%d" "ARMv8=%d ARMv7=%d VFP3=%d VFP32DREGS=%d NEON=%d SUDIV=%d "
"UNALIGNED_ACCESSES=%d MOVW_MOVT_IMMEDIATE_LOADS=%d", "UNALIGNED_ACCESSES=%d MOVW_MOVT_IMMEDIATE_LOADS=%d",
CpuFeatures::IsSupported(ARMv8), CpuFeatures::IsSupported(ARMv7), CpuFeatures::IsSupported(ARMv8), CpuFeatures::IsSupported(ARMv7),
CpuFeatures::IsSupported(VFP3), CpuFeatures::IsSupported(VFP32DREGS), CpuFeatures::IsSupported(VFP3), CpuFeatures::IsSupported(VFP32DREGS),
CpuFeatures::IsSupported(NEON), CpuFeatures::IsSupported(SUDIV), CpuFeatures::IsSupported(NEON), CpuFeatures::IsSupported(SUDIV),
CpuFeatures::IsSupported(MLS),
CpuFeatures::IsSupported(UNALIGNED_ACCESSES), CpuFeatures::IsSupported(UNALIGNED_ACCESSES),
CpuFeatures::IsSupported(MOVW_MOVT_IMMEDIATE_LOADS)); CpuFeatures::IsSupported(MOVW_MOVT_IMMEDIATE_LOADS));
#ifdef __arm__ #ifdef __arm__
...@@ -1609,7 +1606,7 @@ void Assembler::mla(Register dst, Register src1, Register src2, Register srcA, ...@@ -1609,7 +1606,7 @@ void Assembler::mla(Register dst, Register src1, Register src2, Register srcA,
void Assembler::mls(Register dst, Register src1, Register src2, Register srcA, void Assembler::mls(Register dst, Register src1, Register src2, Register srcA,
Condition cond) { Condition cond) {
DCHECK(!dst.is(pc) && !src1.is(pc) && !src2.is(pc) && !srcA.is(pc)); DCHECK(!dst.is(pc) && !src1.is(pc) && !src2.is(pc) && !srcA.is(pc));
DCHECK(IsEnabled(MLS)); DCHECK(IsEnabled(ARMv7));
emit(cond | B22 | B21 | dst.code()*B16 | srcA.code()*B12 | emit(cond | B22 | B21 | dst.code()*B16 | srcA.code()*B12 |
src2.code()*B8 | B7 | B4 | src1.code()); src2.code()*B8 | B7 | B4 | src1.code());
} }
......
...@@ -255,8 +255,8 @@ void MacroAssembler::Move(DwVfpRegister dst, DwVfpRegister src) { ...@@ -255,8 +255,8 @@ void MacroAssembler::Move(DwVfpRegister dst, DwVfpRegister src) {
void MacroAssembler::Mls(Register dst, Register src1, Register src2, void MacroAssembler::Mls(Register dst, Register src1, Register src2,
Register srcA, Condition cond) { Register srcA, Condition cond) {
if (CpuFeatures::IsSupported(MLS)) { if (CpuFeatures::IsSupported(ARMv7)) {
CpuFeatureScope scope(this, MLS); CpuFeatureScope scope(this, ARMv7);
mls(dst, src1, src2, srcA, cond); mls(dst, src1, src2, srcA, cond);
} else { } else {
DCHECK(!srcA.is(ip)); DCHECK(!srcA.is(ip));
......
...@@ -687,7 +687,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -687,7 +687,7 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
i.InputRegister(2), i.OutputSBit()); i.InputRegister(2), i.OutputSBit());
break; break;
case kArmMls: { case kArmMls: {
CpuFeatureScope scope(masm(), MLS); CpuFeatureScope scope(masm(), ARMv7);
__ mls(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1), __ mls(i.OutputRegister(), i.InputRegister(0), i.InputRegister(1),
i.InputRegister(2)); i.InputRegister(2));
DCHECK_EQ(LeaveCC, i.OutputSBit()); DCHECK_EQ(LeaveCC, i.OutputSBit());
......
...@@ -294,7 +294,7 @@ void VisitMod(InstructionSelector* selector, Node* node, ArchOpcode div_opcode, ...@@ -294,7 +294,7 @@ void VisitMod(InstructionSelector* selector, Node* node, ArchOpcode div_opcode,
InstructionOperand right_operand = g.UseRegister(m.right().node()); InstructionOperand right_operand = g.UseRegister(m.right().node());
EmitDiv(selector, div_opcode, f64i32_opcode, i32f64_opcode, div_operand, EmitDiv(selector, div_opcode, f64i32_opcode, i32f64_opcode, div_operand,
left_operand, right_operand); left_operand, right_operand);
if (selector->IsSupported(MLS)) { if (selector->IsSupported(ARMv7)) {
selector->Emit(kArmMls, result_operand, div_operand, right_operand, selector->Emit(kArmMls, result_operand, div_operand, right_operand,
left_operand); left_operand);
} else { } else {
...@@ -1022,7 +1022,7 @@ void InstructionSelector::VisitInt32Add(Node* node) { ...@@ -1022,7 +1022,7 @@ void InstructionSelector::VisitInt32Add(Node* node) {
void InstructionSelector::VisitInt32Sub(Node* node) { void InstructionSelector::VisitInt32Sub(Node* node) {
ArmOperandGenerator g(this); ArmOperandGenerator g(this);
Int32BinopMatcher m(node); Int32BinopMatcher m(node);
if (IsSupported(MLS) && m.right().IsInt32Mul() && if (IsSupported(ARMv7) && m.right().IsInt32Mul() &&
CanCover(node, m.right().node())) { CanCover(node, m.right().node())) {
Int32BinopMatcher mright(m.right().node()); Int32BinopMatcher mright(m.right().node());
Emit(kArmMls, g.DefineAsRegister(node), g.UseRegister(mright.left().node()), Emit(kArmMls, g.DefineAsRegister(node), g.UseRegister(mright.left().node()),
......
...@@ -543,8 +543,6 @@ DEFINE_BOOL(enable_neon, ENABLE_NEON_DEFAULT, ...@@ -543,8 +543,6 @@ DEFINE_BOOL(enable_neon, ENABLE_NEON_DEFAULT,
"enable use of NEON instructions if available (ARM only)") "enable use of NEON instructions if available (ARM only)")
DEFINE_BOOL(enable_sudiv, true, DEFINE_BOOL(enable_sudiv, true,
"enable use of SDIV and UDIV instructions if available (ARM only)") "enable use of SDIV and UDIV instructions if available (ARM only)")
DEFINE_BOOL(enable_mls, true,
"enable use of MLS instructions if available (ARM only)")
DEFINE_BOOL(enable_movw_movt, false, DEFINE_BOOL(enable_movw_movt, false,
"enable loading 32-bit constant by means of movw/movt " "enable loading 32-bit constant by means of movw/movt "
"instruction pairs (ARM only)") "instruction pairs (ARM only)")
...@@ -562,7 +560,6 @@ DEFINE_IMPLICATION(enable_armv8, enable_vfp3) ...@@ -562,7 +560,6 @@ DEFINE_IMPLICATION(enable_armv8, enable_vfp3)
DEFINE_IMPLICATION(enable_armv8, enable_neon) DEFINE_IMPLICATION(enable_armv8, enable_neon)
DEFINE_IMPLICATION(enable_armv8, enable_32dregs) DEFINE_IMPLICATION(enable_armv8, enable_32dregs)
DEFINE_IMPLICATION(enable_armv8, enable_sudiv) DEFINE_IMPLICATION(enable_armv8, enable_sudiv)
DEFINE_IMPLICATION(enable_armv8, enable_mls)
// bootstrapper.cc // bootstrapper.cc
DEFINE_STRING(expose_natives_as, NULL, "expose natives in global object") DEFINE_STRING(expose_natives_as, NULL, "expose natives in global object")
......
...@@ -697,7 +697,6 @@ enum CpuFeature { ...@@ -697,7 +697,6 @@ enum CpuFeature {
ARMv7, ARMv7,
ARMv8, ARMv8,
SUDIV, SUDIV,
MLS,
UNALIGNED_ACCESSES, UNALIGNED_ACCESSES,
MOVW_MOVT_IMMEDIATE_LOADS, MOVW_MOVT_IMMEDIATE_LOADS,
VFP32DREGS, VFP32DREGS,
......
...@@ -2228,7 +2228,7 @@ TEST_F(InstructionSelectorTest, Int32SubWithInt32MulForMLS) { ...@@ -2228,7 +2228,7 @@ TEST_F(InstructionSelectorTest, Int32SubWithInt32MulForMLS) {
MachineType::Int32(), MachineType::Int32()); MachineType::Int32(), MachineType::Int32());
m.Return( m.Return(
m.Int32Sub(m.Parameter(0), m.Int32Mul(m.Parameter(1), m.Parameter(2)))); m.Int32Sub(m.Parameter(0), m.Int32Mul(m.Parameter(1), m.Parameter(2))));
Stream s = m.Build(MLS); Stream s = m.Build(ARMv7);
ASSERT_EQ(1U, s.size()); ASSERT_EQ(1U, s.size());
EXPECT_EQ(kArmMls, s[0]->arch_opcode()); EXPECT_EQ(kArmMls, s[0]->arch_opcode());
EXPECT_EQ(1U, s[0]->OutputCount()); EXPECT_EQ(1U, s[0]->OutputCount());
...@@ -2324,7 +2324,7 @@ TEST_F(InstructionSelectorTest, Int32ModWithParametersForSUDIVAndMLS) { ...@@ -2324,7 +2324,7 @@ TEST_F(InstructionSelectorTest, Int32ModWithParametersForSUDIVAndMLS) {
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(), StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
MachineType::Int32()); MachineType::Int32());
m.Return(m.Int32Mod(m.Parameter(0), m.Parameter(1))); m.Return(m.Int32Mod(m.Parameter(0), m.Parameter(1)));
Stream s = m.Build(MLS, SUDIV); Stream s = m.Build(ARMv7, SUDIV);
ASSERT_EQ(2U, s.size()); ASSERT_EQ(2U, s.size());
EXPECT_EQ(kArmSdiv, s[0]->arch_opcode()); EXPECT_EQ(kArmSdiv, s[0]->arch_opcode());
ASSERT_EQ(1U, s[0]->OutputCount()); ASSERT_EQ(1U, s[0]->OutputCount());
...@@ -2530,7 +2530,7 @@ TEST_F(InstructionSelectorTest, Uint32ModWithParametersForSUDIVAndMLS) { ...@@ -2530,7 +2530,7 @@ TEST_F(InstructionSelectorTest, Uint32ModWithParametersForSUDIVAndMLS) {
StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(), StreamBuilder m(this, MachineType::Int32(), MachineType::Int32(),
MachineType::Int32()); MachineType::Int32());
m.Return(m.Uint32Mod(m.Parameter(0), m.Parameter(1))); m.Return(m.Uint32Mod(m.Parameter(0), m.Parameter(1)));
Stream s = m.Build(MLS, SUDIV); Stream s = m.Build(ARMv7, SUDIV);
ASSERT_EQ(2U, s.size()); ASSERT_EQ(2U, s.size());
EXPECT_EQ(kArmUdiv, s[0]->arch_opcode()); EXPECT_EQ(kArmUdiv, s[0]->arch_opcode());
ASSERT_EQ(1U, s[0]->OutputCount()); ASSERT_EQ(1U, s[0]->OutputCount());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment