From: Chris Lattner Date: Wed, 22 Sep 2010 04:04:03 +0000 (+0000) Subject: fix rdar://8456389 - llvm-mc mismatch with 'as' on 'fstp' X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0c289c140ee7a68e3d06b9d8ae6060758345ad4e;p=oota-llvm.git fix rdar://8456389 - llvm-mc mismatch with 'as' on 'fstp' -This line, and those below, will be ignored-- M test/MC/AsmParser/X86/x86_instructions.s M lib/Target/X86/AsmParser/X86AsmParser.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114527 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp index 4c51ed674e3..d8650e06045 100644 --- a/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -1015,6 +1015,14 @@ ParseInstruction(StringRef Name, SMLoc NameLoc, Operands[0] = X86Operand::CreateToken("movsl", NameLoc); } + // fstp -> fstps . Without this, we'll default to fstpl due to + // suffix searching. + if (Name == "fstp" && Operands.size() == 2 && + static_cast(Operands[1])->isMem()) { + delete Operands[0]; + Operands[0] = X86Operand::CreateToken("fstps", NameLoc); + } + return false; } diff --git a/test/MC/AsmParser/X86/x86_instructions.s b/test/MC/AsmParser/X86/x86_instructions.s index 7f8a401c076..207de850e7d 100644 --- a/test/MC/AsmParser/X86/x86_instructions.s +++ b/test/MC/AsmParser/X86/x86_instructions.s @@ -310,3 +310,9 @@ enter $0x7ace,$0 enter $0x7ace,$1 enter $0x7ace,$0x7f + +// rdar://8456389 +// CHECK: fstps (%eax) +// CHECK: encoding: [0xd9,0x18] +fstp (%eax) +