Index: lib/Target/X86/X86InstrArithmetic.td =================================================================== --- lib/Target/X86/X86InstrArithmetic.td +++ lib/Target/X86/X86InstrArithmetic.td @@ -1225,10 +1225,10 @@ let isCompare = 1 in { let Defs = [EFLAGS] in { let isCommutable = 1 in { - 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>; + 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>; } // isCommutable def TEST8rm : BinOpRM_F<0x84, "test", Xi8 , X86testpat>; Index: test/MC/Disassembler/X86/x86-16.txt =================================================================== --- test/MC/Disassembler/X86/x86-16.txt +++ test/MC/Disassembler/X86/x86-16.txt @@ -30,7 +30,7 @@ # CHECK: movl %eax, -16(%ebp) 0x67 0x66 0x89 0x45 0xf0 -# CHECK: testb %cl, %bl +# CHECK: testb %bl, %cl 0x84 0xcb # CHECK: cmpl %eax, %ebx Index: test/MC/X86/x86-16.s =================================================================== --- test/MC/X86/x86-16.s +++ 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,0xd9] +// CHECK: testb %bl, %cl # encoding: [0x84,0xcb] testb %bl, %cl // CHECK: cmpl %eax, %ebx # encoding: [0x66,0x39,0xc3] Index: test/MC/X86/x86-32.s =================================================================== --- test/MC/X86/x86-32.s +++ 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,0xd9] +// CHECK: testb %bl, %cl # encoding: [0x84,0xcb] testb %bl, %cl // CHECK: cmpl %eax, %ebx # encoding: [0x39,0xc3] Index: test/MC/X86/x86-64.s =================================================================== --- test/MC/X86/x86-64.s +++ test/MC/X86/x86-64.s @@ -671,7 +671,7 @@ movq 0x00(%r13,%rax,8),%r13 // CHECK: testq %rax, %rbx -// CHECK: encoding: [0x48,0x85,0xc3] +// CHECK: encoding: [0x48,0x85,0xd8] testq %rax, %rbx // CHECK: cmpq %rbx, %r14