[llvm] r243630 - [X86] Recognize "flags" as an identifier, not a register in Intel-syntax inline asm
Michael Kuperstein
michael.m.kuperstein at intel.com
Thu Jul 30 03:10:25 PDT 2015
Author: mkuper
Date: Thu Jul 30 05:10:25 2015
New Revision: 243630
URL: http://llvm.org/viewvc/llvm-project?rev=243630&view=rev
Log:
[X86] Recognize "flags" as an identifier, not a register in Intel-syntax inline asm
Patch by: marina.yatsina at intel.com
Differential Revision: http://reviews.llvm.org/D11512
Modified:
llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=243630&r1=243629&r2=243630&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Thu Jul 30 05:10:25 2015
@@ -912,6 +912,11 @@ bool X86AsmParser::ParseRegister(unsigne
if (RegNo == 0)
RegNo = MatchRegisterName(Tok.getString().lower());
+ // The "flags" register cannot be referenced directly.
+ // Treat it as an identifier instead.
+ if (isParsingInlineAsm() && isParsingIntelSyntax() && RegNo == X86::EFLAGS)
+ RegNo = 0;
+
if (!is64BitMode()) {
// FIXME: This should be done using Requires<Not64BitMode> and
// Requires<In64BitMode> so "eiz" usage in 64-bit instructions can be also
More information about the llvm-commits
mailing list