Fix the operand encoding in the test instruction.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 31 Mar 2015 12:31:55 +0000 (12:31 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 31 Mar 2015 12:31:55 +0000 (12:31 +0000)
Fixes pr22995.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233686 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrArithmetic.td
test/MC/Disassembler/X86/x86-16.txt
test/MC/X86/x86-16.s
test/MC/X86/x86-32.s
test/MC/X86/x86-64.s

index 78efc4d5711116ed21e8167c1ad49c5dd95cd14f..5e19ad448fc7fcfade63bbc2428900eebd7a1be4 100644 (file)
@@ -1216,10 +1216,10 @@ def X86testpat : PatFrag<(ops node:$lhs, node:$rhs),
 let isCompare = 1 in {
   let Defs = [EFLAGS] in {
     let isCommutable = 1 in {
-      def TEST8rr  : BinOpRR_F<0x84, "test", Xi8 , X86testpat, MRMSrcReg>;
-      def TEST16rr : BinOpRR_F<0x84, "test", Xi16, X86testpat, MRMSrcReg>;
-      def TEST32rr : BinOpRR_F<0x84, "test", Xi32, X86testpat, MRMSrcReg>;
-      def TEST64rr : BinOpRR_F<0x84, "test", Xi64, X86testpat, MRMSrcReg>;
+      def TEST8rr  : BinOpRR_F<0x84, "test", Xi8 , X86testpat>;
+      def TEST16rr : BinOpRR_F<0x84, "test", Xi16, X86testpat>;
+      def TEST32rr : BinOpRR_F<0x84, "test", Xi32, X86testpat>;
+      def TEST64rr : BinOpRR_F<0x84, "test", Xi64, X86testpat>;
     } // isCommutable
 
     def TEST8rm    : BinOpRM_F<0x84, "test", Xi8 , X86testpat>;
index 93974d433e3d418c7f4abf55ba89dd9726163433..c6844cd3cef448aca8892b6f928fae85533bec5f 100644 (file)
@@ -30,7 +30,7 @@
 # CHECK: movl %eax, -16(%ebp)
 0x67 0x66 0x89 0x45 0xf0
 
-# CHECK: testb %bl, %cl
+# CHECK: testb %cl, %bl
 0x84 0xcb
 
 # CHECK: cmpl %eax, %ebx
index 1f87c8159f6732a0409c5bb37c2a69f69fb6c4d7..9789cd268aaf507d729d7f2e0509ff0b68e01b9b 100644 (file)
@@ -30,7 +30,7 @@
 // CHECK: movl %eax, -16(%ebp)          # encoding: [0x67,0x66,0x89,0x45,0xf0]
        movl    %eax, -16(%ebp)
 
-// CHECK: testb        %bl, %cl                # encoding: [0x84,0xcb]
+// CHECK: testb        %bl, %cl                # encoding: [0x84,0xd9]
         testb %bl, %cl
 
 // CHECK: cmpl %eax, %ebx              # encoding: [0x66,0x39,0xc3]
index 648eb5a6d2684cb80b75eea9092d1c32a1694c5e..56fd658a76ee6daa9a7c5a1498578f00c50ea5ef 100644 (file)
@@ -79,7 +79,7 @@
 // CHECK: movl %eax, -16(%ebp)          # encoding: [0x89,0x45,0xf0]
        movl    %eax, -16(%ebp)
 
-// CHECK: testb        %bl, %cl                # encoding: [0x84,0xcb]
+// CHECK: testb        %bl, %cl                # encoding: [0x84,0xd9]
         testb %bl, %cl
 
 // CHECK: cmpl %eax, %ebx              # encoding: [0x39,0xc3]
index 10d420aa447ba797b6f90a1706e6d85a54e0a310..096e90039abde90cf0d1a53cf2cf27940ed19d3f 100644 (file)
@@ -613,7 +613,7 @@ movq _foo@GOTPCREL(%rip), %r14
 movq 0x00(%r13,%rax,8),%r13
 
 // CHECK: testq        %rax, %rbx
-// CHECK:  encoding: [0x48,0x85,0xd8]
+// CHECK:  encoding: [0x48,0x85,0xc3]
 testq %rax, %rbx
 
 // CHECK: cmpq %rbx, %r14