From 6ca3ccf519290ba7ec0776fad89c7dab5a8c4f78 Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Thu, 14 Feb 2008 23:35:16 +0000 Subject: Rewrite tblgen handling of subtarget features so it follows the order of the enum, not alphabetical. The motivation is to make -mattr=+ssse3,+sse41 select SSE41 as it ought to. Added "ignored" enum values of 0 to PPC and SPU to avoid compiler warnings. llvm-svn: 47143 --- llvm/utils/TableGen/SubtargetEmitter.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'llvm/utils/TableGen/SubtargetEmitter.cpp') diff --git a/llvm/utils/TableGen/SubtargetEmitter.cpp b/llvm/utils/TableGen/SubtargetEmitter.cpp index 1f34bcc2177..5e7688a6196 100644 --- a/llvm/utils/TableGen/SubtargetEmitter.cpp +++ b/llvm/utils/TableGen/SubtargetEmitter.cpp @@ -482,8 +482,12 @@ void SubtargetEmitter::ParseFeaturesFunction(std::ostream &OS) { const std::string &Value = R->getValueAsString("Value"); const std::string &Attribute = R->getValueAsString("Attribute"); - OS << " if ((Bits & " << Instance << ") != 0) " - << Attribute << " = " << Value << ";\n"; + if (Value=="true" || Value=="false") + OS << " if ((Bits & " << Instance << ") != 0) " + << Attribute << " = " << Value << ";\n"; + else + OS << " if ((Bits & " << Instance << ") != 0 && " << Attribute << + " < " << Value << ") " << Attribute << " = " << Value << ";\n"; } if (HasItineraries) { -- cgit v1.2.3