From 4c361972fd9110eff30145abdd17f195404a4e49 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 22 May 2010 06:37:33 +0000 Subject: [PATCH] MC/X86: Add alias for setz, setnz, jz, jnz. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104435 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/AsmParser/X86AsmParser.cpp | 4 ++++ test/MC/AsmParser/X86/x86_64-new-encoder.s | 19 ++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp index 7ce39ef4232..b291ef63b70 100644 --- a/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -586,6 +586,10 @@ ParseInstruction(const StringRef &Name, SMLoc NameLoc, .Case("popf", Is64Bit ? "popfq" : "popfl") .Case("retl", Is64Bit ? "retl" : "ret") .Case("retq", Is64Bit ? "ret" : "retq") + .Case("setz", "sete") + .Case("setnz", "setne") + .Case("jz", "je") + .Case("jnz", "jne") .Default(Name); Operands.push_back(X86Operand::CreateToken(PatchedName, NameLoc)); diff --git a/test/MC/AsmParser/X86/x86_64-new-encoder.s b/test/MC/AsmParser/X86/x86_64-new-encoder.s index 8ecb91b6917..6cd22d03051 100644 --- a/test/MC/AsmParser/X86/x86_64-new-encoder.s +++ b/test/MC/AsmParser/X86/x86_64-new-encoder.s @@ -106,6 +106,23 @@ movl 0, %eax // CHECK: movl 0, %eax # encoding: [0x8b,0x04,0x25,A,A,A,A] movq $10, %rax // rdar://8014869 -retq +// // CHECK: ret // CHECK: encoding: [0xc3] + retq + +// CHECK: sete %al +// CHECK: encoding: [0x0f,0x94,0xc0] + setz %al + +// CHECK: setne %al +// CHECK: encoding: [0x0f,0x95,0xc0] + setnz %al + +// CHECK: je 0 +// CHECK: encoding: [0x74,A] + jz 0 + +// CHECK: jne +// CHECK: encoding: [0x75,A] + jnz 0