MC/X86: Rename alternate spellings of CMP{8,16,32} and mark as "code gen only" so...
authorDaniel Dunbar <daniel@zuster.org>
Tue, 9 Mar 2010 22:50:40 +0000 (22:50 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 9 Mar 2010 22:50:40 +0000 (22:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98097 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrInfo.td
test/MC/AsmParser/X86/x86_32-new-encoder.s

index 4589b59e50a5f63a4644d098525173fc28e9c3e1..4b43e658e73dc8737e7a6faeb50cd2e199e48b7a 100644 (file)
@@ -3453,12 +3453,18 @@ def CMP32rm : I<0x3B, MRMSrcMem,
                 "cmp{l}\t{$src2, $src1|$src1, $src2}",
                 [(X86cmp GR32:$src1, (loadi32 addr:$src2)),
                  (implicit EFLAGS)]>;
-def CMP8mrmrr : I<0x3A, MRMSrcReg, (outs), (ins GR8:$src1, GR8:$src2),
-                  "cmp{b}\t{$src2, $src1|$src1, $src2}", []>;
-def CMP16mrmrr : I<0x3B, MRMSrcReg, (outs), (ins GR16:$src1, GR16:$src2),
-                   "cmp{w}\t{$src2, $src1|$src1, $src2}", []>, OpSize;
-def CMP32mrmrr : I<0x3B, MRMSrcReg, (outs), (ins GR32:$src1, GR32:$src2),
-                   "cmp{l}\t{$src2, $src1|$src1, $src2}", []>;
+
+// These are alternate spellings for use by the disassembler, we mark them as
+// code gen only to ensure they aren't matched by the assembler.
+let isCodeGenOnly = 1 in {
+  def CMP8rr_alt : I<0x3A, MRMSrcReg, (outs), (ins GR8:$src1, GR8:$src2),
+                    "cmp{b}\t{$src2, $src1|$src1, $src2}", []>;
+  def CMP16rr_alt : I<0x3B, MRMSrcReg, (outs), (ins GR16:$src1, GR16:$src2),
+                     "cmp{w}\t{$src2, $src1|$src1, $src2}", []>, OpSize;
+  def CMP32rr_alt : I<0x3B, MRMSrcReg, (outs), (ins GR32:$src1, GR32:$src2),
+                     "cmp{l}\t{$src2, $src1|$src1, $src2}", []>;
+}
+
 def CMP8ri  : Ii8<0x80, MRM7r,
                   (outs), (ins GR8:$src1, i8imm:$src2),
                   "cmp{b}\t{$src2, $src1|$src1, $src2}",
index ffda3b2d141cbf5aca1f960ca668bdab63eac509..63ae9d1bbdf7bdac214e5404a6f788e3cc3c0e07 100644 (file)
@@ -41,3 +41,6 @@ rdtscp
 
 // CHECK: testb        %bl, %cl                # encoding: [0x84,0xcb]
         testb %bl, %cl
+
+// CHECK: cmpl %eax, %ebx              # encoding: [0x39,0xc3]
+        cmpl %eax, %ebx