1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

[mips] In the integrated assembler, select the default feature bits by changing the CPU value.

This is consistent with the way CodeGen acheives this. However, CodeGen
always selects mips32 (even when the architecture is mips64).

llvm-svn: 201694
This commit is contained in:
Daniel Sanders 2014-02-19 16:13:26 +00:00
parent be6d8a86fb
commit b1311110b0

View File

@ -39,27 +39,6 @@
using namespace llvm; using namespace llvm;
static std::string ParseMipsTriple(StringRef TT, StringRef CPU) {
std::string MipsArchFeature;
Triple TheTriple(TT);
if (TheTriple.getArch() == Triple::mips ||
TheTriple.getArch() == Triple::mipsel) {
if (CPU.empty() || CPU == "mips32") {
MipsArchFeature = "+mips32";
} else if (CPU == "mips32r2") {
MipsArchFeature = "+mips32r2";
}
} else {
if (CPU.empty() || CPU == "mips64") {
MipsArchFeature = "+mips64";
} else if (CPU == "mips64r2") {
MipsArchFeature = "+mips64r2";
}
}
return MipsArchFeature;
}
static MCInstrInfo *createMipsMCInstrInfo() { static MCInstrInfo *createMipsMCInstrInfo() {
MCInstrInfo *X = new MCInstrInfo(); MCInstrInfo *X = new MCInstrInfo();
InitMipsMCInstrInfo(X); InitMipsMCInstrInfo(X);
@ -74,15 +53,17 @@ static MCRegisterInfo *createMipsMCRegisterInfo(StringRef TT) {
static MCSubtargetInfo *createMipsMCSubtargetInfo(StringRef TT, StringRef CPU, static MCSubtargetInfo *createMipsMCSubtargetInfo(StringRef TT, StringRef CPU,
StringRef FS) { StringRef FS) {
std::string ArchFS = ParseMipsTriple(TT,CPU); if (CPU.empty()) {
if (!FS.empty()) { Triple TheTriple(TT);
if (!ArchFS.empty()) // FIXME: CodeGen picks mips32 in both cases.
ArchFS = ArchFS + "," + FS.str(); if (TheTriple.getArch() == Triple::mips ||
TheTriple.getArch() == Triple::mipsel)
CPU = "mips32";
else else
ArchFS = FS; CPU = "mips64";
} }
MCSubtargetInfo *X = new MCSubtargetInfo(); MCSubtargetInfo *X = new MCSubtargetInfo();
InitMipsMCSubtargetInfo(X, TT, CPU, ArchFS); InitMipsMCSubtargetInfo(X, TT, CPU, FS);
return X; return X;
} }