diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp index 479f4e43dfeb9d3562fb184f64ee4ec6bb7ea74d..7ce39ef42326590aef79a2ec203890c56110880f 100644 --- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -584,6 +584,8 @@ ParseInstruction(const StringRef &Name, SMLoc NameLoc, .Case("repnz", "repne") .Case("pushf", Is64Bit ? "pushfq" : "pushfl") .Case("popf", Is64Bit ? "popfq" : "popfl") + .Case("retl", Is64Bit ? "retl" : "ret") + .Case("retq", Is64Bit ? "ret" : "retq") .Default(Name); Operands.push_back(X86Operand::CreateToken(PatchedName, NameLoc)); diff --git a/llvm/test/MC/AsmParser/X86/x86_32-new-encoder.s b/llvm/test/MC/AsmParser/X86/x86_32-new-encoder.s index 1c02f8823af8ed32904905657576fdf630d8680f..9d0fd6d06cb650c2e274b0a918043da8f6427e56 100644 --- a/llvm/test/MC/AsmParser/X86/x86_32-new-encoder.s +++ b/llvm/test/MC/AsmParser/X86/x86_32-new-encoder.s @@ -84,3 +84,8 @@ int $255 popf // CHECK: popfl # encoding: [0x9d] popfl + +// rdar://8014869 +retl +// CHECK: ret +// CHECK: encoding: [0xc3] diff --git a/llvm/test/MC/AsmParser/X86/x86_64-new-encoder.s b/llvm/test/MC/AsmParser/X86/x86_64-new-encoder.s index 589c719158f9bc3f78fd0b37c17e4d153b4fc6b2..8ecb91b6917f1aaa9aef400849e9aeb6f938da83 100644 --- a/llvm/test/MC/AsmParser/X86/x86_64-new-encoder.s +++ b/llvm/test/MC/AsmParser/X86/x86_64-new-encoder.s @@ -104,3 +104,8 @@ movl 0, %eax // CHECK: movl 0, %eax # encoding: [0x8b,0x04,0x25,A,A,A,A] // CHECK: movq $10, %rax // CHECK: encoding: [0x48,0xc7,0xc0,0x0a,0x00,0x00,0x00] movq $10, %rax + +// rdar://8014869 +retq +// CHECK: ret +// CHECK: encoding: [0xc3]