summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-01-15 18:31:29 +0000
committerReid Kleckner <rnk@google.com>2016-01-15 18:31:29 +0000
commit47f2452da84f820addf92cb003e7d4905d4aa1bc (patch)
tree99e240e8c16e486417128e744d8ea633c3588e14 /llvm/lib/Target/ARM
parent79db917139bb0314b5e53a18996d84c57eeeb2fb (diff)
downloadbcm5719-llvm-47f2452da84f820addf92cb003e7d4905d4aa1bc.tar.gz
bcm5719-llvm-47f2452da84f820addf92cb003e7d4905d4aa1bc.zip
# This is a combination of 2 commits.
# The first commit's message is: Revert "[ARM] Add DSP build attribute and extension targeting" This reverts commit b11cc50c0b4a7c8cdb628abc50b7dc226ff583dc. # This is the 2nd commit message: Revert "[ARM] Add new system registers to ARMv8-M Baseline/Mainline" This reverts commit 837d08454e3e5beb8581951ac26b22fa07df3cd5. llvm-svn: 257916
Diffstat (limited to 'llvm/lib/Target/ARM')
-rw-r--r--llvm/lib/Target/ARM/ARMAsmPrinter.cpp3
-rw-r--r--llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp39
-rw-r--r--llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp26
-rw-r--r--llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp18
-rw-r--r--llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp36
5 files changed, 7 insertions, 115 deletions
diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
index 9247160dd75..84b494a88f6 100644
--- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -807,9 +807,6 @@ void ARMAsmPrinter::emitAttributes() {
if (STI.hasDivideInARMMode() && !STI.hasV8Ops())
ATS.emitAttribute(ARMBuildAttrs::DIV_use, ARMBuildAttrs::AllowDIVExt);
- if (STI.hasDSP() && isV8M(&STI))
- ATS.emitAttribute(ARMBuildAttrs::DSP_extension, ARMBuildAttrs::Allowed);
-
if (MMI) {
if (const Module *SourceModule = MMI->getModule()) {
// ABI_PCS_wchar_t to indicate wchar_t width
diff --git a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
index 9ffed031059..4cb80da4839 100644
--- a/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
+++ b/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp
@@ -3444,9 +3444,6 @@ static inline int getMClassRegisterSYSmValueMask(StringRef RegString) {
.Case("basepri_max", 0x12)
.Case("faultmask", 0x13)
.Case("control", 0x14)
- .Case("msplim", 0x0a)
- .Case("psplim", 0x0b)
- .Case("sp", 0x18)
.Default(-1);
}
@@ -3476,27 +3473,11 @@ static int getMClassRegisterMask(StringRef Reg, StringRef Flags, bool IsRead,
if (!Subtarget->hasV7Ops() && SYSmvalue >= 0x11 && SYSmvalue <= 0x13)
return -1;
- if (Subtarget->has8MSecExt() && Flags.lower() == "ns") {
- Flags = "";
- SYSmvalue |= 0x80;
- }
-
- if (!Subtarget->has8MSecExt() &&
- (SYSmvalue == 0xa || SYSmvalue == 0xb || SYSmvalue > 0x14))
- return -1;
-
- if (!Subtarget->hasV8MMainlineOps() &&
- (SYSmvalue == 0x8a || SYSmvalue == 0x8b || SYSmvalue == 0x91 ||
- SYSmvalue == 0x93))
- return -1;
-
// If it was a read then we won't be expecting flags and so at this point
// we can return the mask.
if (IsRead) {
- if (Flags.empty())
- return SYSmvalue;
- else
- return -1;
+ assert (Flags.empty() && "Unexpected flags for reading M class register.");
+ return SYSmvalue;
}
// We know we are now handling a write so need to get the mask for the flags.
@@ -3655,13 +3636,7 @@ SDNode *ARMDAGToDAGISel::SelectReadRegister(SDNode *N){
// is an acceptable value, so check that a mask can be constructed from the
// string.
if (Subtarget->isMClass()) {
- StringRef Flags = "", Reg = SpecialReg;
- if (Reg.endswith("_ns")) {
- Flags = "ns";
- Reg = Reg.drop_back(3);
- }
-
- int SYSmValue = getMClassRegisterMask(Reg, Flags, true, Subtarget);
+ int SYSmValue = getMClassRegisterMask(SpecialReg, "", true, Subtarget);
if (SYSmValue == -1)
return nullptr;
@@ -3755,10 +3730,10 @@ SDNode *ARMDAGToDAGISel::SelectWriteRegister(SDNode *N){
return CurDAG->getMachineNode(Opcode, DL, MVT::Other, Ops);
}
- std::pair<StringRef, StringRef> Fields;
- Fields = StringRef(SpecialReg).rsplit('_');
- std::string Reg = Fields.first.str();
- StringRef Flags = Fields.second;
+ SmallVector<StringRef, 5> Fields;
+ StringRef(SpecialReg).split(Fields, '_', 1, false);
+ std::string Reg = Fields[0].str();
+ StringRef Flags = Fields.size() == 2 ? Fields[1] : "";
// If the target was M Class then need to validate the special register value
// and retrieve the mask for use in the instruction node.
diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index fb72b20154f..277304d5634 100644
--- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -272,12 +272,6 @@ class ARMAsmParser : public MCTargetAsmParser {
bool hasV8MBaseline() const {
return getSTI().getFeatureBits()[ARM::HasV8MBaselineOps];
}
- bool hasV8MMainline() const {
- return getSTI().getFeatureBits()[ARM::HasV8MMainlineOps];
- }
- bool has8MSecExt() const {
- return getSTI().getFeatureBits()[ARM::Feature8MSecExt];
- }
bool hasARM() const {
return !getSTI().getFeatureBits()[ARM::FeatureNoARM];
}
@@ -3978,18 +3972,6 @@ ARMAsmParser::parseMSRMaskOperand(OperandVector &Operands) {
.Case("basepri_max", 0x812)
.Case("faultmask", 0x813)
.Case("control", 0x814)
- .Case("msplim", 0x80a)
- .Case("psplim", 0x80b)
- .Case("msp_ns", 0x888)
- .Case("psp_ns", 0x889)
- .Case("msplim_ns", 0x88a)
- .Case("psplim_ns", 0x88b)
- .Case("primask_ns", 0x890)
- .Case("basepri_ns", 0x891)
- .Case("basepri_max_ns", 0x892)
- .Case("faultmask_ns", 0x893)
- .Case("control_ns", 0x894)
- .Case("sp_ns", 0x898)
.Default(~0U);
if (FlagsVal == ~0U)
@@ -4004,14 +3986,6 @@ ARMAsmParser::parseMSRMaskOperand(OperandVector &Operands) {
// basepri, basepri_max and faultmask only valid for V7m.
return MatchOperand_NoMatch;
- if (!has8MSecExt() && (FlagsVal == 0x80a || FlagsVal == 0x80b ||
- (FlagsVal > 0x814 && FlagsVal < 0xc00)))
- return MatchOperand_NoMatch;
-
- if (!hasV8MMainline() && (FlagsVal == 0x88a || FlagsVal == 0x88b ||
- (FlagsVal > 0x890 && FlagsVal <= 0x893)))
- return MatchOperand_NoMatch;
-
Parser.Lex(); // Eat identifier token.
Operands.push_back(ARMOperand::CreateMSRMask(FlagsVal, S));
return MatchOperand_Success;
diff --git a/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp b/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
index db255cf2233..e63defed228 100644
--- a/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
+++ b/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
@@ -4096,24 +4096,6 @@ static DecodeStatus DecodeMSRMask(MCInst &Inst, unsigned Val,
// Values basepri, basepri_max and faultmask are only valid for v7m.
return MCDisassembler::Fail;
break;
- case 0x8a: // msplim_ns
- case 0x8b: // psplim_ns
- case 0x91: // basepri_ns
- case 0x92: // basepri_max_ns
- case 0x93: // faultmask_ns
- if (!(FeatureBits[ARM::HasV8MMainlineOps]))
- return MCDisassembler::Fail;
- // fall through
- case 10: // msplim
- case 11: // psplim
- case 0x88: // msp_ns
- case 0x89: // psp_ns
- case 0x90: // primask_ns
- case 0x94: // control_ns
- case 0x98: // sp_ns
- if (!(FeatureBits[ARM::Feature8MSecExt]))
- return MCDisassembler::Fail;
- break;
default:
return MCDisassembler::Fail;
}
diff --git a/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp b/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
index a18c24c1107..33fc85af9b1 100644
--- a/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
+++ b/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
@@ -901,42 +901,6 @@ void ARMInstPrinter::printMSRMaskOperand(const MCInst *MI, unsigned OpNum,
case 20:
O << "control";
return;
- case 10:
- O << "msplim";
- return;
- case 11:
- O << "psplim";
- return;
- case 0x88:
- O << "msp_ns";
- return;
- case 0x89:
- O << "psp_ns";
- return;
- case 0x8a:
- O << "msplim_ns";
- return;
- case 0x8b:
- O << "psplim_ns";
- return;
- case 0x90:
- O << "primask_ns";
- return;
- case 0x91:
- O << "basepri_ns";
- return;
- case 0x92:
- O << "basepri_max_ns";
- return;
- case 0x93:
- O << "faultmask_ns";
- return;
- case 0x94:
- O << "control_ns";
- return;
- case 0x98:
- O << "sp_ns";
- return;
}
}
OpenPOWER on IntegriCloud