diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-28 20:23:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-28 20:23:50 +0000 |
commit | d8f717911dcdccb1a60b3049ea22c7767970dcb7 (patch) | |
tree | 44b89ec80eef2fce0f7fa98d566033ca8eec9703 | |
parent | a1ac3bbec703f7faf20cbc06fa0eb9d34bb4f5f6 (diff) |
fix PR8686, accepting a 'b' suffix at the end of all the setcc
instructions. I choose to handle this with an asmparser hack,
though it could be handled by changing all the instruction definitions
to allow be "setneb" instead of "setne". The asm parser hack is
better in this case, because we want the disassembler to produce
setne, not setneb.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120260 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/X86/AsmParser/X86AsmParser.cpp | 5 | ||||
-rw-r--r-- | test/MC/X86/x86-32.s | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp index 1b4086b41a..1064effbbc 100644 --- a/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -622,6 +622,11 @@ ParseInstruction(StringRef Name, SMLoc NameLoc, SmallVectorImpl<MCParsedAsmOperand*> &Operands) { StringRef PatchedName = Name; + // FIXME: Hack to recognize setneb as setne. + if (PatchedName.startswith("set") && PatchedName.endswith("b") && + PatchedName != "setb" && PatchedName != "setnb") + PatchedName = PatchedName.substr(0, Name.size()-1); + // FIXME: Hack to recognize cmp<comparison code>{ss,sd,ps,pd}. const MCExpr *ExtraImmOp = 0; if ((PatchedName.startswith("cmp") || PatchedName.startswith("vcmp")) && diff --git a/test/MC/X86/x86-32.s b/test/MC/X86/x86-32.s index f4adb5f7bf..9ff5accf19 100644 --- a/test/MC/X86/x86-32.s +++ b/test/MC/X86/x86-32.s @@ -543,7 +543,10 @@ popfl setng %bl setnle %bl - +// PR8686 + setneb %cl // CHECK: setne %cl + setcb %bl // CHECK: setb %bl + setnaeb %bl // CHECK: setb %bl // CHECK: lcalll $31438, $31438 |