# RUN: llvm-mc -triple x86_64 -show-encoding %s | FileCheck %s
# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
# ERROR-COUNT-94: error:
# ERROR-NOT: error:
# CHECK: {evex} shlb $123, %bl
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xc0,0xe3,0x7b]
{evex} shlb $123, %bl
# CHECK: {nf} shlb $123, %bl
# CHECK: encoding: [0x62,0xf4,0x7c,0x0c,0xc0,0xe3,0x7b]
{nf} shlb $123, %bl
# CHECK: shlb $123, %bl, %bl
# CHECK: encoding: [0x62,0xf4,0x64,0x18,0xc0,0xe3,0x7b]
shlb $123, %bl, %bl
# CHECK: {nf} shlb $123, %bl, %bl
# CHECK: encoding: [0x62,0xf4,0x64,0x1c,0xc0,0xe3,0x7b]
{nf} shlb $123, %bl, %bl
# CHECK: {evex} shlw $123, %dx
# CHECK: encoding: [0x62,0xf4,0x7d,0x08,0xc1,0xe2,0x7b]
{evex} shlw $123, %dx
# CHECK: {nf} shlw $123, %dx
# CHECK: encoding: [0x62,0xf4,0x7d,0x0c,0xc1,0xe2,0x7b]
{nf} shlw $123, %dx
# CHECK: shlw $123, %dx, %dx
# CHECK: encoding: [0x62,0xf4,0x6d,0x18,0xc1,0xe2,0x7b]
shlw $123, %dx, %dx
# CHECK: {nf} shlw $123, %dx, %dx
# CHECK: encoding: [0x62,0xf4,0x6d,0x1c,0xc1,0xe2,0x7b]
{nf} shlw $123, %dx, %dx
# CHECK: {evex} shll $123, %ecx
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xc1,0xe1,0x7b]
{evex} shll $123, %ecx
# CHECK: {nf} shll $123, %ecx
# CHECK: encoding: [0x62,0xf4,0x7c,0x0c,0xc1,0xe1,0x7b]
{nf} shll $123, %ecx
# CHECK: shll $123, %ecx, %ecx
# CHECK: encoding: [0x62,0xf4,0x74,0x18,0xc1,0xe1,0x7b]
shll $123, %ecx, %ecx
# CHECK: {nf} shll $123, %ecx, %ecx
# CHECK: encoding: [0x62,0xf4,0x74,0x1c,0xc1,0xe1,0x7b]
{nf} shll $123, %ecx, %ecx
# CHECK: {evex} shlq $123, %r9
# CHECK: encoding: [0x62,0xd4,0xfc,0x08,0xc1,0xe1,0x7b]
{evex} shlq $123, %r9
# CHECK: {nf} shlq $123, %r9
# CHECK: encoding: [0x62,0xd4,0xfc,0x0c,0xc1,0xe1,0x7b]
{nf} shlq $123, %r9
# CHECK: shlq $123, %r9, %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x18,0xc1,0xe1,0x7b]
shlq $123, %r9, %r9
# CHECK: {nf} shlq $123, %r9, %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x1c,0xc1,0xe1,0x7b]
{nf} shlq $123, %r9, %r9
# CHECK: {evex} shlb $123, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x08,0xc0,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
{evex} shlb $123, 291(%r8,%rax,4)
# CHECK: {nf} shlb $123, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x0c,0xc0,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
{nf} shlb $123, 291(%r8,%rax,4)
# CHECK: shlb $123, 291(%r8,%rax,4), %bl
# CHECK: encoding: [0x62,0xd4,0x64,0x18,0xc0,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
shlb $123, 291(%r8,%rax,4), %bl
# CHECK: {nf} shlb $123, 291(%r8,%rax,4), %bl
# CHECK: encoding: [0x62,0xd4,0x64,0x1c,0xc0,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
{nf} shlb $123, 291(%r8,%rax,4), %bl
# CHECK: {evex} shlw $123, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7d,0x08,0xc1,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
{evex} shlw $123, 291(%r8,%rax,4)
# CHECK: {nf} shlw $123, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7d,0x0c,0xc1,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
{nf} shlw $123, 291(%r8,%rax,4)
# CHECK: shlw $123, 291(%r8,%rax,4), %dx
# CHECK: encoding: [0x62,0xd4,0x6d,0x18,0xc1,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
shlw $123, 291(%r8,%rax,4), %dx
# CHECK: {nf} shlw $123, 291(%r8,%rax,4), %dx
# CHECK: encoding: [0x62,0xd4,0x6d,0x1c,0xc1,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
{nf} shlw $123, 291(%r8,%rax,4), %dx
# CHECK: {evex} shll $123, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x08,0xc1,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
{evex} shll $123, 291(%r8,%rax,4)
# CHECK: {nf} shll $123, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x0c,0xc1,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
{nf} shll $123, 291(%r8,%rax,4)
# CHECK: shll $123, 291(%r8,%rax,4), %ecx
# CHECK: encoding: [0x62,0xd4,0x74,0x18,0xc1,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
shll $123, 291(%r8,%rax,4), %ecx
# CHECK: {nf} shll $123, 291(%r8,%rax,4), %ecx
# CHECK: encoding: [0x62,0xd4,0x74,0x1c,0xc1,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
{nf} shll $123, 291(%r8,%rax,4), %ecx
# CHECK: {evex} shlq $123, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0xfc,0x08,0xc1,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
{evex} shlq $123, 291(%r8,%rax,4)
# CHECK: {nf} shlq $123, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0xfc,0x0c,0xc1,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
{nf} shlq $123, 291(%r8,%rax,4)
# CHECK: shlq $123, 291(%r8,%rax,4), %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x18,0xc1,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
shlq $123, 291(%r8,%rax,4), %r9
# CHECK: {nf} shlq $123, 291(%r8,%rax,4), %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x1c,0xc1,0xa4,0x80,0x23,0x01,0x00,0x00,0x7b]
{nf} shlq $123, 291(%r8,%rax,4), %r9
# CHECK: {evex} shlb %bl
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xd0,0xe3]
{evex} shlb %bl
# CHECK: {nf} shlb %bl
# CHECK: encoding: [0x62,0xf4,0x7c,0x0c,0xd0,0xe3]
{nf} shlb %bl
# CHECK: {evex} shlb %cl, %bl
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xd2,0xe3]
{evex} shlb %cl, %bl
# CHECK: {nf} shlb %cl, %bl
# CHECK: encoding: [0x62,0xf4,0x7c,0x0c,0xd2,0xe3]
{nf} shlb %cl, %bl
# CHECK: shlb %cl, %bl, %bl
# CHECK: encoding: [0x62,0xf4,0x64,0x18,0xd2,0xe3]
shlb %cl, %bl, %bl
# CHECK: {nf} shlb %cl, %bl, %bl
# CHECK: encoding: [0x62,0xf4,0x64,0x1c,0xd2,0xe3]
{nf} shlb %cl, %bl, %bl
# CHECK: {evex} shlw %cl, %dx
# CHECK: encoding: [0x62,0xf4,0x7d,0x08,0xd3,0xe2]
{evex} shlw %cl, %dx
# CHECK: {nf} shlw %cl, %dx
# CHECK: encoding: [0x62,0xf4,0x7d,0x0c,0xd3,0xe2]
{nf} shlw %cl, %dx
# CHECK: shlw %cl, %dx, %dx
# CHECK: encoding: [0x62,0xf4,0x6d,0x18,0xd3,0xe2]
shlw %cl, %dx, %dx
# CHECK: {nf} shlw %cl, %dx, %dx
# CHECK: encoding: [0x62,0xf4,0x6d,0x1c,0xd3,0xe2]
{nf} shlw %cl, %dx, %dx
# CHECK: {evex} shll %cl, %ecx
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xd3,0xe1]
{evex} shll %cl, %ecx
# CHECK: {nf} shll %cl, %ecx
# CHECK: encoding: [0x62,0xf4,0x7c,0x0c,0xd3,0xe1]
{nf} shll %cl, %ecx
# CHECK: shll %cl, %ecx, %ecx
# CHECK: encoding: [0x62,0xf4,0x74,0x18,0xd3,0xe1]
shll %cl, %ecx, %ecx
# CHECK: {nf} shll %cl, %ecx, %ecx
# CHECK: encoding: [0x62,0xf4,0x74,0x1c,0xd3,0xe1]
{nf} shll %cl, %ecx, %ecx
# CHECK: {evex} shlq %cl, %r9
# CHECK: encoding: [0x62,0xd4,0xfc,0x08,0xd3,0xe1]
{evex} shlq %cl, %r9
# CHECK: {nf} shlq %cl, %r9
# CHECK: encoding: [0x62,0xd4,0xfc,0x0c,0xd3,0xe1]
{nf} shlq %cl, %r9
# CHECK: shlq %cl, %r9, %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x18,0xd3,0xe1]
shlq %cl, %r9, %r9
# CHECK: {nf} shlq %cl, %r9, %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x1c,0xd3,0xe1]
{nf} shlq %cl, %r9, %r9
# CHECK: {evex} shlb %cl, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x08,0xd2,0xa4,0x80,0x23,0x01,0x00,0x00]
{evex} shlb %cl, 291(%r8,%rax,4)
# CHECK: {nf} shlb %cl, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x0c,0xd2,0xa4,0x80,0x23,0x01,0x00,0x00]
{nf} shlb %cl, 291(%r8,%rax,4)
# CHECK: shlb %cl, 291(%r8,%rax,4), %bl
# CHECK: encoding: [0x62,0xd4,0x64,0x18,0xd2,0xa4,0x80,0x23,0x01,0x00,0x00]
shlb %cl, 291(%r8,%rax,4), %bl
# CHECK: {nf} shlb %cl, 291(%r8,%rax,4), %bl
# CHECK: encoding: [0x62,0xd4,0x64,0x1c,0xd2,0xa4,0x80,0x23,0x01,0x00,0x00]
{nf} shlb %cl, 291(%r8,%rax,4), %bl
# CHECK: {evex} shlw %cl, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7d,0x08,0xd3,0xa4,0x80,0x23,0x01,0x00,0x00]
{evex} shlw %cl, 291(%r8,%rax,4)
# CHECK: {nf} shlw %cl, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7d,0x0c,0xd3,0xa4,0x80,0x23,0x01,0x00,0x00]
{nf} shlw %cl, 291(%r8,%rax,4)
# CHECK: shlw %cl, 291(%r8,%rax,4), %dx
# CHECK: encoding: [0x62,0xd4,0x6d,0x18,0xd3,0xa4,0x80,0x23,0x01,0x00,0x00]
shlw %cl, 291(%r8,%rax,4), %dx
# CHECK: {nf} shlw %cl, 291(%r8,%rax,4), %dx
# CHECK: encoding: [0x62,0xd4,0x6d,0x1c,0xd3,0xa4,0x80,0x23,0x01,0x00,0x00]
{nf} shlw %cl, 291(%r8,%rax,4), %dx
# CHECK: {evex} shll %cl, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x08,0xd3,0xa4,0x80,0x23,0x01,0x00,0x00]
{evex} shll %cl, 291(%r8,%rax,4)
# CHECK: {nf} shll %cl, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x0c,0xd3,0xa4,0x80,0x23,0x01,0x00,0x00]
{nf} shll %cl, 291(%r8,%rax,4)
# CHECK: shll %cl, 291(%r8,%rax,4), %ecx
# CHECK: encoding: [0x62,0xd4,0x74,0x18,0xd3,0xa4,0x80,0x23,0x01,0x00,0x00]
shll %cl, 291(%r8,%rax,4), %ecx
# CHECK: {nf} shll %cl, 291(%r8,%rax,4), %ecx
# CHECK: encoding: [0x62,0xd4,0x74,0x1c,0xd3,0xa4,0x80,0x23,0x01,0x00,0x00]
{nf} shll %cl, 291(%r8,%rax,4), %ecx
# CHECK: {evex} shlq %cl, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0xfc,0x08,0xd3,0xa4,0x80,0x23,0x01,0x00,0x00]
{evex} shlq %cl, 291(%r8,%rax,4)
# CHECK: {nf} shlq %cl, 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0xfc,0x0c,0xd3,0xa4,0x80,0x23,0x01,0x00,0x00]
{nf} shlq %cl, 291(%r8,%rax,4)
# CHECK: shlq %cl, 291(%r8,%rax,4), %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x18,0xd3,0xa4,0x80,0x23,0x01,0x00,0x00]
shlq %cl, 291(%r8,%rax,4), %r9
# CHECK: {nf} shlq %cl, 291(%r8,%rax,4), %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x1c,0xd3,0xa4,0x80,0x23,0x01,0x00,0x00]
{nf} shlq %cl, 291(%r8,%rax,4), %r9
# CHECK: {evex} shlw %dx
# CHECK: encoding: [0x62,0xf4,0x7d,0x08,0xd1,0xe2]
{evex} shlw %dx
# CHECK: {nf} shlw %dx
# CHECK: encoding: [0x62,0xf4,0x7d,0x0c,0xd1,0xe2]
{nf} shlw %dx
# CHECK: shlw %dx, %dx
# CHECK: encoding: [0x62,0xf4,0x6d,0x18,0xd1,0xe2]
shlw %dx, %dx
# CHECK: {nf} shlw %dx, %dx
# CHECK: encoding: [0x62,0xf4,0x6d,0x1c,0xd1,0xe2]
{nf} shlw %dx, %dx
# CHECK: {evex} shll %ecx
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xd1,0xe1]
{evex} shll %ecx
# CHECK: {nf} shll %ecx
# CHECK: encoding: [0x62,0xf4,0x7c,0x0c,0xd1,0xe1]
{nf} shll %ecx
# CHECK: shll %ecx, %ecx
# CHECK: encoding: [0x62,0xf4,0x74,0x18,0xd1,0xe1]
shll %ecx, %ecx
# CHECK: {nf} shll %ecx, %ecx
# CHECK: encoding: [0x62,0xf4,0x74,0x1c,0xd1,0xe1]
{nf} shll %ecx, %ecx
# CHECK: {evex} shlq %r9
# CHECK: encoding: [0x62,0xd4,0xfc,0x08,0xd1,0xe1]
{evex} shlq %r9
# CHECK: {nf} shlq %r9
# CHECK: encoding: [0x62,0xd4,0xfc,0x0c,0xd1,0xe1]
{nf} shlq %r9
# CHECK: shlq %r9, %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x18,0xd1,0xe1]
shlq %r9, %r9
# CHECK: {nf} shlq %r9, %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x1c,0xd1,0xe1]
{nf} shlq %r9, %r9
# CHECK: {evex} shlb 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x08,0xd0,0xa4,0x80,0x23,0x01,0x00,0x00]
{evex} shlb 291(%r8,%rax,4)
# CHECK: {nf} shlb 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x0c,0xd0,0xa4,0x80,0x23,0x01,0x00,0x00]
{nf} shlb 291(%r8,%rax,4)
# CHECK: shlb 291(%r8,%rax,4), %bl
# CHECK: encoding: [0x62,0xd4,0x64,0x18,0xd0,0xa4,0x80,0x23,0x01,0x00,0x00]
shlb 291(%r8,%rax,4), %bl
# CHECK: {nf} shlb 291(%r8,%rax,4), %bl
# CHECK: encoding: [0x62,0xd4,0x64,0x1c,0xd0,0xa4,0x80,0x23,0x01,0x00,0x00]
{nf} shlb 291(%r8,%rax,4), %bl
# CHECK: {evex} shlw 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7d,0x08,0xd1,0xa4,0x80,0x23,0x01,0x00,0x00]
{evex} shlw 291(%r8,%rax,4)
# CHECK: {nf} shlw 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7d,0x0c,0xd1,0xa4,0x80,0x23,0x01,0x00,0x00]
{nf} shlw 291(%r8,%rax,4)
# CHECK: shlw 291(%r8,%rax,4), %dx
# CHECK: encoding: [0x62,0xd4,0x6d,0x18,0xd1,0xa4,0x80,0x23,0x01,0x00,0x00]
shlw 291(%r8,%rax,4), %dx
# CHECK: {nf} shlw 291(%r8,%rax,4), %dx
# CHECK: encoding: [0x62,0xd4,0x6d,0x1c,0xd1,0xa4,0x80,0x23,0x01,0x00,0x00]
{nf} shlw 291(%r8,%rax,4), %dx
# CHECK: {evex} shll 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x08,0xd1,0xa4,0x80,0x23,0x01,0x00,0x00]
{evex} shll 291(%r8,%rax,4)
# CHECK: {nf} shll 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x0c,0xd1,0xa4,0x80,0x23,0x01,0x00,0x00]
{nf} shll 291(%r8,%rax,4)
# CHECK: shll 291(%r8,%rax,4), %ecx
# CHECK: encoding: [0x62,0xd4,0x74,0x18,0xd1,0xa4,0x80,0x23,0x01,0x00,0x00]
shll 291(%r8,%rax,4), %ecx
# CHECK: {nf} shll 291(%r8,%rax,4), %ecx
# CHECK: encoding: [0x62,0xd4,0x74,0x1c,0xd1,0xa4,0x80,0x23,0x01,0x00,0x00]
{nf} shll 291(%r8,%rax,4), %ecx
# CHECK: {evex} shlq 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0xfc,0x08,0xd1,0xa4,0x80,0x23,0x01,0x00,0x00]
{evex} shlq 291(%r8,%rax,4)
# CHECK: {nf} shlq 291(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0xfc,0x0c,0xd1,0xa4,0x80,0x23,0x01,0x00,0x00]
{nf} shlq 291(%r8,%rax,4)
# CHECK: shlq 291(%r8,%rax,4), %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x18,0xd1,0xa4,0x80,0x23,0x01,0x00,0x00]
shlq 291(%r8,%rax,4), %r9
# CHECK: {nf} shlq 291(%r8,%rax,4), %r9
# CHECK: encoding: [0x62,0xd4,0xb4,0x1c,0xd1,0xa4,0x80,0x23,0x01,0x00,0x00]
{nf} shlq 291(%r8,%rax,4), %r9