# RUN: llvm-mc -triple x86_64 -show-encoding %s | FileCheck %s

# CHECK: {evex}	sarb	%al
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xd0,0xf8]
         {evex}	sarb	$1, %al
# CHECK: {evex}	sarw	%ax
# CHECK: encoding: [0x62,0xf4,0x7d,0x08,0xd1,0xf8]
         {evex}	sarw	$1, %ax
# CHECK: {evex}	sarl	%eax
# CHECK: encoding: [0x62,0xf4,0x7c,0x08,0xd1,0xf8]
         {evex}	sarl	$1, %eax
# CHECK: {evex}	sarq	%rax
# CHECK: encoding: [0x62,0xf4,0xfc,0x08,0xd1,0xf8]
         {evex}	sarq	$1, %rax
# CHECK: {nf}	sarb	%al
# CHECK: encoding: [0x62,0xf4,0x7c,0x0c,0xd0,0xf8]
         {nf}	sarb	$1, %al
# CHECK: {nf}	sarw	%ax
# CHECK: encoding: [0x62,0xf4,0x7d,0x0c,0xd1,0xf8]
         {nf}	sarw	$1, %ax
# CHECK: {nf}	sarl	%eax
# CHECK: encoding: [0x62,0xf4,0x7c,0x0c,0xd1,0xf8]
         {nf}	sarl	$1, %eax
# CHECK: {nf}	sarq	%rax
# CHECK: encoding: [0x62,0xf4,0xfc,0x0c,0xd1,0xf8]
         {nf}	sarq	$1, %rax
# CHECK: sarb	%al, %bl
# CHECK: encoding: [0x62,0xf4,0x64,0x18,0xd0,0xf8]
         sarb	$1, %al, %bl
# CHECK: sarw	%ax, %bx
# CHECK: encoding: [0x62,0xf4,0x65,0x18,0xd1,0xf8]
         sarw	$1, %ax, %bx
# CHECK: sarl	%eax, %ebx
# CHECK: encoding: [0x62,0xf4,0x64,0x18,0xd1,0xf8]
         sarl	$1, %eax, %ebx
# CHECK: sarq	%rax, %rbx
# CHECK: encoding: [0x62,0xf4,0xe4,0x18,0xd1,0xf8]
         sarq	$1, %rax, %rbx
# CHECK: {nf}	sarb	%al, %bl
# CHECK: encoding: [0x62,0xf4,0x64,0x1c,0xd0,0xf8]
         {nf}	sarb	$1, %al, %bl
# CHECK: {nf}	sarw	%ax, %bx
# CHECK: encoding: [0x62,0xf4,0x65,0x1c,0xd1,0xf8]
         {nf}	sarw	$1, %ax, %bx
# CHECK: {nf}	sarl	%eax, %ebx
# CHECK: encoding: [0x62,0xf4,0x64,0x1c,0xd1,0xf8]
         {nf}	sarl	$1, %eax, %ebx
# CHECK: {nf}	sarq	%rax, %rbx
# CHECK: encoding: [0x62,0xf4,0xe4,0x1c,0xd1,0xf8]
         {nf}	sarq	$1, %rax, %rbx
# CHECK: {evex}	sarb	123(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x08,0xd0,0x7c,0x80,0x7b]
         {evex}	sarb	$1, 123(%r8,%rax,4)
# CHECK: {evex}	sarw	123(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7d,0x08,0xd1,0x7c,0x80,0x7b]
         {evex}	sarw	$1, 123(%r8,%rax,4)
# CHECK: {evex}	sarl	123(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x08,0xd1,0x7c,0x80,0x7b]
         {evex}	sarl	$1, 123(%r8,%rax,4)
# CHECK: {evex}	sarq	123(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0xfc,0x08,0xd1,0x7c,0x80,0x7b]
         {evex}	sarq	$1, 123(%r8,%rax,4)
# CHECK: {nf}	sarb	123(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x0c,0xd0,0x7c,0x80,0x7b]
         {nf}	sarb	$1, 123(%r8,%rax,4)
# CHECK: {nf}	sarw	123(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7d,0x0c,0xd1,0x7c,0x80,0x7b]
         {nf}	sarw	$1, 123(%r8,%rax,4)
# CHECK: {nf}	sarl	123(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0x7c,0x0c,0xd1,0x7c,0x80,0x7b]
         {nf}	sarl	$1, 123(%r8,%rax,4)
# CHECK: {nf}	sarq	123(%r8,%rax,4)
# CHECK: encoding: [0x62,0xd4,0xfc,0x0c,0xd1,0x7c,0x80,0x7b]
         {nf}	sarq	$1, 123(%r8,%rax,4)
# CHECK: sarb	123(%r8,%rax,4), %bl
# CHECK: encoding: [0x62,0xd4,0x64,0x18,0xd0,0x7c,0x80,0x7b]
         sarb	$1, 123(%r8,%rax,4), %bl
# CHECK: sarw	123(%r8,%rax,4), %bx
# CHECK: encoding: [0x62,0xd4,0x65,0x18,0xd1,0x7c,0x80,0x7b]
         sarw	$1, 123(%r8,%rax,4), %bx
# CHECK: sarl	123(%r8,%rax,4), %ebx
# CHECK: encoding: [0x62,0xd4,0x64,0x18,0xd1,0x7c,0x80,0x7b]
         sarl	$1, 123(%r8,%rax,4), %ebx
# CHECK: sarq	123(%r8,%rax,4), %rbx
# CHECK: encoding: [0x62,0xd4,0xe4,0x18,0xd1,0x7c,0x80,0x7b]
         sarq	$1, 123(%r8,%rax,4), %rbx
# CHECK: {nf}	sarb	123(%r8,%rax,4), %bl
# CHECK: encoding: [0x62,0xd4,0x64,0x1c,0xd0,0x7c,0x80,0x7b]
         {nf}	sarb	$1, 123(%r8,%rax,4), %bl
# CHECK: {nf}	sarw	123(%r8,%rax,4), %bx
# CHECK: encoding: [0x62,0xd4,0x65,0x1c,0xd1,0x7c,0x80,0x7b]
         {nf}	sarw	$1, 123(%r8,%rax,4), %bx
# CHECK: {nf}	sarl	123(%r8,%rax,4), %ebx
# CHECK: encoding: [0x62,0xd4,0x64,0x1c,0xd1,0x7c,0x80,0x7b]
         {nf}	sarl	$1, 123(%r8,%rax,4), %ebx
# CHECK: {nf}	sarq	123(%r8,%rax,4), %rbx
# CHECK: encoding: [0x62,0xd4,0xe4,0x1c,0xd1,0x7c,0x80,0x7b]
         {nf}	sarq	$1, 123(%r8,%rax,4), %rbx
