# RUN: llvm-mc -triple x86_64 -show-encoding -x86-asm-syntax=intel -output-asm-variant=1 %s | FileCheck %s

# CHECK: {evex}	shrd	dx, dx, 123
# CHECK: encoding: [0x62,0xf4,0x7d,0x08,0x2c,0xd2,0x7b]
         {evex}	shrd	dx, dx, 123
# CHECK: {nf}	shrd	dx, dx, 123
# CHECK: encoding: [0x62,0xf4,0x7d,0x0c,0x2c,0xd2,0x7b]
         {nf}	shrd	dx, dx, 123
# CHECK: shrd	dx, dx, dx, 123
# CHECK: encoding: [0x62,0xf4,0x6d,0x18,0x2c,0xd2,0x7b]
         shrd	dx, dx, dx, 123
# CHECK: {nf}	shrd	dx, dx, dx, 123
# CHECK: encoding: [0x62,0xf4,0x6d,0x1c,0x2c,0xd2,0x7b]
         {nf}	shrd	dx, dx, dx, 123
# CHECK: {evex}	shrd	word ptr [r8 + 4*rax + 291], dx, 123
# CHECK: encoding: [0x62,0xd4,0x7d,0x08,0x2c,0x94,0x80,0x23,0x01,0x00,0x00,0x7b]
         {evex}	shrd	word ptr [r8 + 4*rax + 291], dx, 123
# CHECK: {nf}	shrd	word ptr [r8 + 4*rax + 291], dx, 123
# CHECK: encoding: [0x62,0xd4,0x7d,0x0c,0x2c,0x94,0x80,0x23,0x01,0x00,0x00,0x7b]
         {nf}	shrd	word ptr [r8 + 4*rax + 291], dx, 123
# CHECK: shrd	dx, word ptr [r8 + 4*rax + 291], dx, 123
# CHECK: encoding: [0x62,0xd4,0x6d,0x18,0x2c,0x94,0x80,0x23,0x01,0x00,0x00,0x7b]
         shrd	dx, word ptr [r8 + 4*rax + 291], dx, 123
# CHECK: {nf}	shrd	dx, word ptr [r8 + 4*rax + 291], dx, 123
# CHECK: encoding: [0x62,0xd4,0x6d,0x1c,0x2c,0x94,0x80,0x23,0x01,0x00,0x00,0x7b]
         {nf}	shrd	dx, word ptr [r8 + 4*rax + 291], dx, 123
# CHECK: {evex}	shrd	ecx, ecx, 123
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0x2c,0xc9,0x7b]
         {evex}	shrd	ecx, ecx, 123
# CHECK: {nf}	shrd	ecx, ecx, 123
# CHECK: encoding: [0x62,0xf4,0x7c,0x0c,0x2c,0xc9,0x7b]
         {nf}	shrd	ecx, ecx, 123
# CHECK: shrd	ecx, ecx, ecx, 123
# CHECK: encoding: [0x62,0xf4,0x74,0x18,0x2c,0xc9,0x7b]
         shrd	ecx, ecx, ecx, 123
# CHECK: {nf}	shrd	ecx, ecx, ecx, 123
# CHECK: encoding: [0x62,0xf4,0x74,0x1c,0x2c,0xc9,0x7b]
         {nf}	shrd	ecx, ecx, ecx, 123
# CHECK: {evex}	shrd	dword ptr [r8 + 4*rax + 291], ecx, 123
# CHECK: encoding: [0x62,0xd4,0x7c,0x08,0x2c,0x8c,0x80,0x23,0x01,0x00,0x00,0x7b]
         {evex}	shrd	dword ptr [r8 + 4*rax + 291], ecx, 123
# CHECK: {nf}	shrd	dword ptr [r8 + 4*rax + 291], ecx, 123
# CHECK: encoding: [0x62,0xd4,0x7c,0x0c,0x2c,0x8c,0x80,0x23,0x01,0x00,0x00,0x7b]
         {nf}	shrd	dword ptr [r8 + 4*rax + 291], ecx, 123
# CHECK: shrd	ecx, dword ptr [r8 + 4*rax + 291], ecx, 123
# CHECK: encoding: [0x62,0xd4,0x74,0x18,0x2c,0x8c,0x80,0x23,0x01,0x00,0x00,0x7b]
         shrd	ecx, dword ptr [r8 + 4*rax + 291], ecx, 123
# CHECK: {nf}	shrd	ecx, dword ptr [r8 + 4*rax + 291], ecx, 123
# CHECK: encoding: [0x62,0xd4,0x74,0x1c,0x2c,0x8c,0x80,0x23,0x01,0x00,0x00,0x7b]
         {nf}	shrd	ecx, dword ptr [r8 + 4*rax + 291], ecx, 123
# CHECK: {evex}	shrd	r9, r9, 123
# CHECK: encoding: [0x62,0x54,0xfc,0x08,0x2c,0xc9,0x7b]
         {evex}	shrd	r9, r9, 123
# CHECK: {nf}	shrd	r9, r9, 123
# CHECK: encoding: [0x62,0x54,0xfc,0x0c,0x2c,0xc9,0x7b]
         {nf}	shrd	r9, r9, 123
# CHECK: shrd	r9, r9, r9, 123
# CHECK: encoding: [0x62,0x54,0xb4,0x18,0x2c,0xc9,0x7b]
         shrd	r9, r9, r9, 123
# CHECK: {nf}	shrd	r9, r9, r9, 123
# CHECK: encoding: [0x62,0x54,0xb4,0x1c,0x2c,0xc9,0x7b]
         {nf}	shrd	r9, r9, r9, 123
# CHECK: {evex}	shrd	qword ptr [r8 + 4*rax + 291], r9, 123
# CHECK: encoding: [0x62,0x54,0xfc,0x08,0x2c,0x8c,0x80,0x23,0x01,0x00,0x00,0x7b]
         {evex}	shrd	qword ptr [r8 + 4*rax + 291], r9, 123
# CHECK: {nf}	shrd	qword ptr [r8 + 4*rax + 291], r9, 123
# CHECK: encoding: [0x62,0x54,0xfc,0x0c,0x2c,0x8c,0x80,0x23,0x01,0x00,0x00,0x7b]
         {nf}	shrd	qword ptr [r8 + 4*rax + 291], r9, 123
# CHECK: shrd	r9, qword ptr [r8 + 4*rax + 291], r9, 123
# CHECK: encoding: [0x62,0x54,0xb4,0x18,0x2c,0x8c,0x80,0x23,0x01,0x00,0x00,0x7b]
         shrd	r9, qword ptr [r8 + 4*rax + 291], r9, 123
# CHECK: {nf}	shrd	r9, qword ptr [r8 + 4*rax + 291], r9, 123
# CHECK: encoding: [0x62,0x54,0xb4,0x1c,0x2c,0x8c,0x80,0x23,0x01,0x00,0x00,0x7b]
         {nf}	shrd	r9, qword ptr [r8 + 4*rax + 291], r9, 123
# CHECK: {evex}	shrd	dx, dx, cl
# CHECK: encoding: [0x62,0xf4,0x7d,0x08,0xad,0xd2]
         {evex}	shrd	dx, dx, cl
# CHECK: {nf}	shrd	dx, dx, cl
# CHECK: encoding: [0x62,0xf4,0x7d,0x0c,0xad,0xd2]
         {nf}	shrd	dx, dx, cl
# CHECK: shrd	dx, dx, dx, cl
# CHECK: encoding: [0x62,0xf4,0x6d,0x18,0xad,0xd2]
         shrd	dx, dx, dx, cl
# CHECK: {nf}	shrd	dx, dx, dx, cl
# CHECK: encoding: [0x62,0xf4,0x6d,0x1c,0xad,0xd2]
         {nf}	shrd	dx, dx, dx, cl
# CHECK: {evex}	shrd	word ptr [r8 + 4*rax + 291], dx, cl
# CHECK: encoding: [0x62,0xd4,0x7d,0x08,0xad,0x94,0x80,0x23,0x01,0x00,0x00]
         {evex}	shrd	word ptr [r8 + 4*rax + 291], dx, cl
# CHECK: {nf}	shrd	word ptr [r8 + 4*rax + 291], dx, cl
# CHECK: encoding: [0x62,0xd4,0x7d,0x0c,0xad,0x94,0x80,0x23,0x01,0x00,0x00]
         {nf}	shrd	word ptr [r8 + 4*rax + 291], dx, cl
# CHECK: shrd	dx, word ptr [r8 + 4*rax + 291], dx, cl
# CHECK: encoding: [0x62,0xd4,0x6d,0x18,0xad,0x94,0x80,0x23,0x01,0x00,0x00]
         shrd	dx, word ptr [r8 + 4*rax + 291], dx, cl
# CHECK: {nf}	shrd	dx, word ptr [r8 + 4*rax + 291], dx, cl
# CHECK: encoding: [0x62,0xd4,0x6d,0x1c,0xad,0x94,0x80,0x23,0x01,0x00,0x00]
         {nf}	shrd	dx, word ptr [r8 + 4*rax + 291], dx, cl
# CHECK: {evex}	shrd	ecx, ecx, cl
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xad,0xc9]
         {evex}	shrd	ecx, ecx, cl
# CHECK: {nf}	shrd	ecx, ecx, cl
# CHECK: encoding: [0x62,0xf4,0x7c,0x0c,0xad,0xc9]
         {nf}	shrd	ecx, ecx, cl
# CHECK: shrd	ecx, ecx, ecx, cl
# CHECK: encoding: [0x62,0xf4,0x74,0x18,0xad,0xc9]
         shrd	ecx, ecx, ecx, cl
# CHECK: {nf}	shrd	ecx, ecx, ecx, cl
# CHECK: encoding: [0x62,0xf4,0x74,0x1c,0xad,0xc9]
         {nf}	shrd	ecx, ecx, ecx, cl
# CHECK: {evex}	shrd	dword ptr [r8 + 4*rax + 291], ecx, cl
# CHECK: encoding: [0x62,0xd4,0x7c,0x08,0xad,0x8c,0x80,0x23,0x01,0x00,0x00]
         {evex}	shrd	dword ptr [r8 + 4*rax + 291], ecx, cl
# CHECK: {nf}	shrd	dword ptr [r8 + 4*rax + 291], ecx, cl
# CHECK: encoding: [0x62,0xd4,0x7c,0x0c,0xad,0x8c,0x80,0x23,0x01,0x00,0x00]
         {nf}	shrd	dword ptr [r8 + 4*rax + 291], ecx, cl
# CHECK: shrd	ecx, dword ptr [r8 + 4*rax + 291], ecx, cl
# CHECK: encoding: [0x62,0xd4,0x74,0x18,0xad,0x8c,0x80,0x23,0x01,0x00,0x00]
         shrd	ecx, dword ptr [r8 + 4*rax + 291], ecx, cl
# CHECK: {nf}	shrd	ecx, dword ptr [r8 + 4*rax + 291], ecx, cl
# CHECK: encoding: [0x62,0xd4,0x74,0x1c,0xad,0x8c,0x80,0x23,0x01,0x00,0x00]
         {nf}	shrd	ecx, dword ptr [r8 + 4*rax + 291], ecx, cl
# CHECK: {evex}	shrd	r9, r9, cl
# CHECK: encoding: [0x62,0x54,0xfc,0x08,0xad,0xc9]
         {evex}	shrd	r9, r9, cl
# CHECK: {nf}	shrd	r9, r9, cl
# CHECK: encoding: [0x62,0x54,0xfc,0x0c,0xad,0xc9]
         {nf}	shrd	r9, r9, cl
# CHECK: shrd	r9, r9, r9, cl
# CHECK: encoding: [0x62,0x54,0xb4,0x18,0xad,0xc9]
         shrd	r9, r9, r9, cl
# CHECK: {nf}	shrd	r9, r9, r9, cl
# CHECK: encoding: [0x62,0x54,0xb4,0x1c,0xad,0xc9]
         {nf}	shrd	r9, r9, r9, cl
# CHECK: {evex}	shrd	qword ptr [r8 + 4*rax + 291], r9, cl
# CHECK: encoding: [0x62,0x54,0xfc,0x08,0xad,0x8c,0x80,0x23,0x01,0x00,0x00]
         {evex}	shrd	qword ptr [r8 + 4*rax + 291], r9, cl
# CHECK: {nf}	shrd	qword ptr [r8 + 4*rax + 291], r9, cl
# CHECK: encoding: [0x62,0x54,0xfc,0x0c,0xad,0x8c,0x80,0x23,0x01,0x00,0x00]
         {nf}	shrd	qword ptr [r8 + 4*rax + 291], r9, cl
# CHECK: shrd	r9, qword ptr [r8 + 4*rax + 291], r9, cl
# CHECK: encoding: [0x62,0x54,0xb4,0x18,0xad,0x8c,0x80,0x23,0x01,0x00,0x00]
         shrd	r9, qword ptr [r8 + 4*rax + 291], r9, cl
# CHECK: {nf}	shrd	r9, qword ptr [r8 + 4*rax + 291], r9, cl
# CHECK: encoding: [0x62,0x54,0xb4,0x1c,0xad,0x8c,0x80,0x23,0x01,0x00,0x00]
         {nf}	shrd	r9, qword ptr [r8 + 4*rax + 291], r9, cl
