From: Chris Lattner Date: Wed, 8 Sep 2010 22:27:05 +0000 (+0000) Subject: fix rdar://8407548, I missed the commuted form of xchg/test without a suffix. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=90b54547d9fcc381f8ec92c32756ad4da43ed9aa;p=oota-llvm.git fix rdar://8407548, I missed the commuted form of xchg/test without a suffix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113427 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp index 9a43913b7c0..7e9dacf7760 100644 --- a/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -850,7 +850,8 @@ ParseInstruction(StringRef Name, SMLoc NameLoc, // The assembler accepts "xchgX , " and "xchgX , " as // synonyms. Our tables only have the ", " form, so if we see the // other operand order, swap them. - if (Name == "xchgb" || Name == "xchgw" || Name == "xchgl" || Name == "xchgq") + if (Name == "xchgb" || Name == "xchgw" || Name == "xchgl" || Name == "xchgq"|| + Name == "xchg") if (Operands.size() == 3 && static_cast(Operands[1])->isMem() && static_cast(Operands[2])->isReg()) { @@ -860,7 +861,8 @@ ParseInstruction(StringRef Name, SMLoc NameLoc, // The assembler accepts "testX , " and "testX , " as // synonyms. Our tables only have the ", " form, so if we see the // other operand order, swap them. - if (Name == "testb" || Name == "testw" || Name == "testl" || Name == "testq") + if (Name == "testb" || Name == "testw" || Name == "testl" || Name == "testq"|| + Name == "test") if (Operands.size() == 3 && static_cast(Operands[1])->isReg() && static_cast(Operands[2])->isMem()) { diff --git a/test/MC/AsmParser/X86/x86_64-new-encoder.s b/test/MC/AsmParser/X86/x86_64-new-encoder.s index e23c22478ca..86619521fdc 100644 --- a/test/MC/AsmParser/X86/x86_64-new-encoder.s +++ b/test/MC/AsmParser/X86/x86_64-new-encoder.s @@ -174,6 +174,12 @@ xchgl 368(%rax),%ecx xchgl %ecx, 368(%rax) // CHECK: xchgl %ecx, 368(%rax) +// rdar://8407548 +xchg 0xdeadbeef(%rbx,%rcx,8),%bl +// CHECK: xchgb %bl, 3735928559(%rbx,%rcx,8) + + + // PR7254 lock incl 1(%rsp) // CHECK: lock