From 378981499a3b1ba211e08f3d7db7c2d84460079d Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 31 Mar 2015 12:31:55 +0000 Subject: [PATCH] Fix the operand encoding in the test instruction. Fixes pr22995. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233686 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86InstrArithmetic.td | 8 ++++---- test/MC/Disassembler/X86/x86-16.txt | 2 +- test/MC/X86/x86-16.s | 2 +- test/MC/X86/x86-32.s | 2 +- test/MC/X86/x86-64.s | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/Target/X86/X86InstrArithmetic.td b/lib/Target/X86/X86InstrArithmetic.td index 78efc4d5711..5e19ad448fc 100644 --- a/lib/Target/X86/X86InstrArithmetic.td +++ b/lib/Target/X86/X86InstrArithmetic.td @@ -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>; diff --git a/test/MC/Disassembler/X86/x86-16.txt b/test/MC/Disassembler/X86/x86-16.txt index 93974d433e3..c6844cd3cef 100644 --- a/test/MC/Disassembler/X86/x86-16.txt +++ b/test/MC/Disassembler/X86/x86-16.txt @@ -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 diff --git a/test/MC/X86/x86-16.s b/test/MC/X86/x86-16.s index 1f87c8159f6..9789cd268aa 100644 --- a/test/MC/X86/x86-16.s +++ b/test/MC/X86/x86-16.s @@ -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] diff --git a/test/MC/X86/x86-32.s b/test/MC/X86/x86-32.s index 648eb5a6d26..56fd658a76e 100644 --- a/test/MC/X86/x86-32.s +++ b/test/MC/X86/x86-32.s @@ -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] diff --git a/test/MC/X86/x86-64.s b/test/MC/X86/x86-64.s index 10d420aa447..096e90039ab 100644 --- a/test/MC/X86/x86-64.s +++ b/test/MC/X86/x86-64.s @@ -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