Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

924 lines
31 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ndd -verify-machineinstrs --show-mc-encoding | FileCheck %s --check-prefixes=CHECK,NDD
; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ndd,+prefer-ndd-imm -verify-machineinstrs --show-mc-encoding | FileCheck %s --check-prefixes=CHECK,NDD
; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ndd,+prefer-ndd-mem -verify-machineinstrs --show-mc-encoding | FileCheck %s --check-prefixes=CHECK,MEM
; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ndd,+prefer-ndd-imm,+prefer-ndd-mem -verify-machineinstrs --show-mc-encoding | FileCheck %s --check-prefixes=CHECK,MEM
; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ndd,nf -verify-machineinstrs --show-mc-encoding | FileCheck --check-prefix=NF %s
; RUN: llc < %s -mtriple=x86_64-unknown -mattr=+ndd,nf -x86-enable-apx-for-relocation=true -verify-machineinstrs --show-mc-encoding | FileCheck --check-prefix=NF %s
define i8 @shr8m1(ptr %ptr) {
; NDD-LABEL: shr8m1:
; NDD: # %bb.0: # %entry
; NDD-NEXT: movzbl (%rdi), %eax # encoding: [0x0f,0xb6,0x07]
; NDD-NEXT: shrb %al # EVEX TO LEGACY Compression encoding: [0xd0,0xe8]
; NDD-NEXT: retq # encoding: [0xc3]
;
; MEM-LABEL: shr8m1:
; MEM: # %bb.0: # %entry
; MEM-NEXT: shrb (%rdi), %al # encoding: [0x62,0xf4,0x7c,0x18,0xd0,0x2f]
; MEM-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr8m1:
; NF: # %bb.0: # %entry
; NF-NEXT: movzbl (%rdi), %eax # encoding: [0x0f,0xb6,0x07]
; NF-NEXT: shrb %al # EVEX TO LEGACY Compression encoding: [0xd0,0xe8]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i8, ptr %ptr
%shr = lshr i8 %a, 1
ret i8 %shr
}
define i16 @shr16m1(ptr %ptr) {
; NDD-LABEL: shr16m1:
; NDD: # %bb.0: # %entry
; NDD-NEXT: movzwl (%rdi), %eax # encoding: [0x0f,0xb7,0x07]
; NDD-NEXT: shrw %ax # EVEX TO LEGACY Compression encoding: [0x66,0xd1,0xe8]
; NDD-NEXT: retq # encoding: [0xc3]
;
; MEM-LABEL: shr16m1:
; MEM: # %bb.0: # %entry
; MEM-NEXT: shrw (%rdi), %ax # encoding: [0x62,0xf4,0x7d,0x18,0xd1,0x2f]
; MEM-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr16m1:
; NF: # %bb.0: # %entry
; NF-NEXT: movzwl (%rdi), %eax # encoding: [0x0f,0xb7,0x07]
; NF-NEXT: shrw %ax # EVEX TO LEGACY Compression encoding: [0x66,0xd1,0xe8]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i16, ptr %ptr
%shr = lshr i16 %a, 1
ret i16 %shr
}
define i32 @shr32m1(ptr %ptr) {
; NDD-LABEL: shr32m1:
; NDD: # %bb.0: # %entry
; NDD-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07]
; NDD-NEXT: shrl %eax # EVEX TO LEGACY Compression encoding: [0xd1,0xe8]
; NDD-NEXT: retq # encoding: [0xc3]
;
; MEM-LABEL: shr32m1:
; MEM: # %bb.0: # %entry
; MEM-NEXT: shrl (%rdi), %eax # encoding: [0x62,0xf4,0x7c,0x18,0xd1,0x2f]
; MEM-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr32m1:
; NF: # %bb.0: # %entry
; NF-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07]
; NF-NEXT: shrl %eax # EVEX TO LEGACY Compression encoding: [0xd1,0xe8]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i32, ptr %ptr
%shr = lshr i32 %a, 1
ret i32 %shr
}
define i64 @shr64m1(ptr %ptr) {
; NDD-LABEL: shr64m1:
; NDD: # %bb.0: # %entry
; NDD-NEXT: movq (%rdi), %rax # encoding: [0x48,0x8b,0x07]
; NDD-NEXT: shrq %rax # EVEX TO LEGACY Compression encoding: [0x48,0xd1,0xe8]
; NDD-NEXT: retq # encoding: [0xc3]
;
; MEM-LABEL: shr64m1:
; MEM: # %bb.0: # %entry
; MEM-NEXT: shrq (%rdi), %rax # encoding: [0x62,0xf4,0xfc,0x18,0xd1,0x2f]
; MEM-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr64m1:
; NF: # %bb.0: # %entry
; NF-NEXT: movq (%rdi), %rax # encoding: [0x48,0x8b,0x07]
; NF-NEXT: shrq %rax # EVEX TO LEGACY Compression encoding: [0x48,0xd1,0xe8]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i64, ptr %ptr
%shr = lshr i64 %a, 1
ret i64 %shr
}
define i8 @shr8mcl(ptr %ptr, i8 %cl) {
; NDD-LABEL: shr8mcl:
; NDD: # %bb.0: # %entry
; NDD-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NDD-NEXT: movzbl (%rdi), %eax # encoding: [0x0f,0xb6,0x07]
; NDD-NEXT: # kill: def $cl killed $cl killed $ecx
; NDD-NEXT: shrb %cl, %al # EVEX TO LEGACY Compression encoding: [0xd2,0xe8]
; NDD-NEXT: retq # encoding: [0xc3]
;
; MEM-LABEL: shr8mcl:
; MEM: # %bb.0: # %entry
; MEM-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; MEM-NEXT: # kill: def $cl killed $cl killed $ecx
; MEM-NEXT: shrb %cl, (%rdi), %al # encoding: [0x62,0xf4,0x7c,0x18,0xd2,0x2f]
; MEM-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr8mcl:
; NF: # %bb.0: # %entry
; NF-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NF-NEXT: movzbl (%rdi), %eax # encoding: [0x0f,0xb6,0x07]
; NF-NEXT: # kill: def $cl killed $cl killed $ecx
; NF-NEXT: shrb %cl, %al # EVEX TO LEGACY Compression encoding: [0xd2,0xe8]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i8, ptr %ptr
%shr = lshr i8 %a, %cl
ret i8 %shr
}
define i8 @shr8mcl_mask(ptr %ptr, i8 %cl) {
; NDD-LABEL: shr8mcl_mask:
; NDD: # %bb.0: # %entry
; NDD-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NDD-NEXT: movzbl (%rdi), %eax # encoding: [0x0f,0xb6,0x07]
; NDD-NEXT: # kill: def $cl killed $cl killed $ecx
; NDD-NEXT: shrb %cl, %al # EVEX TO LEGACY Compression encoding: [0xd2,0xe8]
; NDD-NEXT: retq # encoding: [0xc3]
;
; MEM-LABEL: shr8mcl_mask:
; MEM: # %bb.0: # %entry
; MEM-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; MEM-NEXT: # kill: def $cl killed $cl killed $ecx
; MEM-NEXT: shrb %cl, (%rdi), %al # encoding: [0x62,0xf4,0x7c,0x18,0xd2,0x2f]
; MEM-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr8mcl_mask:
; NF: # %bb.0: # %entry
; NF-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NF-NEXT: movzbl (%rdi), %eax # encoding: [0x0f,0xb6,0x07]
; NF-NEXT: # kill: def $cl killed $cl killed $ecx
; NF-NEXT: shrb %cl, %al # EVEX TO LEGACY Compression encoding: [0xd2,0xe8]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i8, ptr %ptr
%shamt = and i8 %cl, 31
%shr = lshr i8 %a, %shamt
ret i8 %shr
}
define i16 @shr16mcl(ptr %ptr, i16 %cl) {
; NDD-LABEL: shr16mcl:
; NDD: # %bb.0: # %entry
; NDD-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NDD-NEXT: movzwl (%rdi), %eax # encoding: [0x0f,0xb7,0x07]
; NDD-NEXT: # kill: def $cl killed $cl killed $ecx
; NDD-NEXT: shrw %cl, %ax # EVEX TO LEGACY Compression encoding: [0x66,0xd3,0xe8]
; NDD-NEXT: retq # encoding: [0xc3]
;
; MEM-LABEL: shr16mcl:
; MEM: # %bb.0: # %entry
; MEM-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; MEM-NEXT: # kill: def $cl killed $cl killed $ecx
; MEM-NEXT: shrw %cl, (%rdi), %ax # encoding: [0x62,0xf4,0x7d,0x18,0xd3,0x2f]
; MEM-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr16mcl:
; NF: # %bb.0: # %entry
; NF-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NF-NEXT: movzwl (%rdi), %eax # encoding: [0x0f,0xb7,0x07]
; NF-NEXT: # kill: def $cl killed $cl killed $ecx
; NF-NEXT: shrw %cl, %ax # EVEX TO LEGACY Compression encoding: [0x66,0xd3,0xe8]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i16, ptr %ptr
%shr = lshr i16 %a, %cl
ret i16 %shr
}
define i16 @shr16mcl_mask(ptr %ptr, i16 %cl) {
; NDD-LABEL: shr16mcl_mask:
; NDD: # %bb.0: # %entry
; NDD-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NDD-NEXT: movzwl (%rdi), %eax # encoding: [0x0f,0xb7,0x07]
; NDD-NEXT: # kill: def $cl killed $cl killed $ecx
; NDD-NEXT: shrw %cl, %ax # EVEX TO LEGACY Compression encoding: [0x66,0xd3,0xe8]
; NDD-NEXT: retq # encoding: [0xc3]
;
; MEM-LABEL: shr16mcl_mask:
; MEM: # %bb.0: # %entry
; MEM-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; MEM-NEXT: # kill: def $cl killed $cl killed $ecx
; MEM-NEXT: shrw %cl, (%rdi), %ax # encoding: [0x62,0xf4,0x7d,0x18,0xd3,0x2f]
; MEM-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr16mcl_mask:
; NF: # %bb.0: # %entry
; NF-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NF-NEXT: movzwl (%rdi), %eax # encoding: [0x0f,0xb7,0x07]
; NF-NEXT: # kill: def $cl killed $cl killed $ecx
; NF-NEXT: shrw %cl, %ax # EVEX TO LEGACY Compression encoding: [0x66,0xd3,0xe8]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i16, ptr %ptr
%shamt = and i16 %cl, 31
%shr = lshr i16 %a, %shamt
ret i16 %shr
}
define i32 @shr32mcl(ptr %ptr, i32 %cl) {
; NDD-LABEL: shr32mcl:
; NDD: # %bb.0: # %entry
; NDD-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NDD-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07]
; NDD-NEXT: # kill: def $cl killed $cl killed $ecx
; NDD-NEXT: shrl %cl, %eax # EVEX TO LEGACY Compression encoding: [0xd3,0xe8]
; NDD-NEXT: retq # encoding: [0xc3]
;
; MEM-LABEL: shr32mcl:
; MEM: # %bb.0: # %entry
; MEM-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; MEM-NEXT: # kill: def $cl killed $cl killed $ecx
; MEM-NEXT: shrl %cl, (%rdi), %eax # encoding: [0x62,0xf4,0x7c,0x18,0xd3,0x2f]
; MEM-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr32mcl:
; NF: # %bb.0: # %entry
; NF-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NF-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07]
; NF-NEXT: # kill: def $cl killed $cl killed $ecx
; NF-NEXT: shrl %cl, %eax # EVEX TO LEGACY Compression encoding: [0xd3,0xe8]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i32, ptr %ptr
%shr = lshr i32 %a, %cl
ret i32 %shr
}
define i32 @shr32mcl_mask(ptr %ptr, i32 %cl) {
; NDD-LABEL: shr32mcl_mask:
; NDD: # %bb.0: # %entry
; NDD-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NDD-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07]
; NDD-NEXT: # kill: def $cl killed $cl killed $ecx
; NDD-NEXT: shrl %cl, %eax # EVEX TO LEGACY Compression encoding: [0xd3,0xe8]
; NDD-NEXT: retq # encoding: [0xc3]
;
; MEM-LABEL: shr32mcl_mask:
; MEM: # %bb.0: # %entry
; MEM-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; MEM-NEXT: # kill: def $cl killed $cl killed $ecx
; MEM-NEXT: shrl %cl, (%rdi), %eax # encoding: [0x62,0xf4,0x7c,0x18,0xd3,0x2f]
; MEM-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr32mcl_mask:
; NF: # %bb.0: # %entry
; NF-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NF-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07]
; NF-NEXT: # kill: def $cl killed $cl killed $ecx
; NF-NEXT: shrl %cl, %eax # EVEX TO LEGACY Compression encoding: [0xd3,0xe8]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i32, ptr %ptr
%shamt = and i32 %cl, 31
%shr = lshr i32 %a, %shamt
ret i32 %shr
}
define i64 @shr64mcl(ptr %ptr, i64 %cl) {
; NDD-LABEL: shr64mcl:
; NDD: # %bb.0: # %entry
; NDD-NEXT: movq %rsi, %rcx # encoding: [0x48,0x89,0xf1]
; NDD-NEXT: movq (%rdi), %rax # encoding: [0x48,0x8b,0x07]
; NDD-NEXT: # kill: def $cl killed $cl killed $rcx
; NDD-NEXT: shrq %cl, %rax # EVEX TO LEGACY Compression encoding: [0x48,0xd3,0xe8]
; NDD-NEXT: retq # encoding: [0xc3]
;
; MEM-LABEL: shr64mcl:
; MEM: # %bb.0: # %entry
; MEM-NEXT: movq %rsi, %rcx # encoding: [0x48,0x89,0xf1]
; MEM-NEXT: # kill: def $cl killed $cl killed $rcx
; MEM-NEXT: shrq %cl, (%rdi), %rax # encoding: [0x62,0xf4,0xfc,0x18,0xd3,0x2f]
; MEM-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr64mcl:
; NF: # %bb.0: # %entry
; NF-NEXT: movq %rsi, %rcx # encoding: [0x48,0x89,0xf1]
; NF-NEXT: movq (%rdi), %rax # encoding: [0x48,0x8b,0x07]
; NF-NEXT: # kill: def $cl killed $cl killed $rcx
; NF-NEXT: shrq %cl, %rax # EVEX TO LEGACY Compression encoding: [0x48,0xd3,0xe8]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i64, ptr %ptr
%shr = lshr i64 %a, %cl
ret i64 %shr
}
define i64 @shr64mcl_mask(ptr %ptr, i64 %cl) {
; NDD-LABEL: shr64mcl_mask:
; NDD: # %bb.0: # %entry
; NDD-NEXT: movq %rsi, %rcx # encoding: [0x48,0x89,0xf1]
; NDD-NEXT: movq (%rdi), %rax # encoding: [0x48,0x8b,0x07]
; NDD-NEXT: # kill: def $cl killed $cl killed $rcx
; NDD-NEXT: shrq %cl, %rax # EVEX TO LEGACY Compression encoding: [0x48,0xd3,0xe8]
; NDD-NEXT: retq # encoding: [0xc3]
;
; MEM-LABEL: shr64mcl_mask:
; MEM: # %bb.0: # %entry
; MEM-NEXT: movq %rsi, %rcx # encoding: [0x48,0x89,0xf1]
; MEM-NEXT: # kill: def $cl killed $cl killed $rcx
; MEM-NEXT: shrq %cl, (%rdi), %rax # encoding: [0x62,0xf4,0xfc,0x18,0xd3,0x2f]
; MEM-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr64mcl_mask:
; NF: # %bb.0: # %entry
; NF-NEXT: movq %rsi, %rcx # encoding: [0x48,0x89,0xf1]
; NF-NEXT: movq (%rdi), %rax # encoding: [0x48,0x8b,0x07]
; NF-NEXT: # kill: def $cl killed $cl killed $rcx
; NF-NEXT: shrq %cl, %rax # EVEX TO LEGACY Compression encoding: [0x48,0xd3,0xe8]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i64, ptr %ptr
%shamt = and i64 %cl, 63
%shr = lshr i64 %a, %shamt
ret i64 %shr
}
define i8 @shr8mi(ptr %ptr) {
; NDD-LABEL: shr8mi:
; NDD: # %bb.0: # %entry
; NDD-NEXT: movzbl (%rdi), %eax # encoding: [0x0f,0xb6,0x07]
; NDD-NEXT: shrb $4, %al # EVEX TO LEGACY Compression encoding: [0xc0,0xe8,0x04]
; NDD-NEXT: retq # encoding: [0xc3]
;
; MEM-LABEL: shr8mi:
; MEM: # %bb.0: # %entry
; MEM-NEXT: shrb $4, (%rdi), %al # encoding: [0x62,0xf4,0x7c,0x18,0xc0,0x2f,0x04]
; MEM-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr8mi:
; NF: # %bb.0: # %entry
; NF-NEXT: movzbl (%rdi), %eax # encoding: [0x0f,0xb6,0x07]
; NF-NEXT: shrb $4, %al # EVEX TO LEGACY Compression encoding: [0xc0,0xe8,0x04]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i8, ptr %ptr
%shr = lshr i8 %a, 4
ret i8 %shr
}
define i16 @shr16mi(ptr %ptr) {
; NDD-LABEL: shr16mi:
; NDD: # %bb.0: # %entry
; NDD-NEXT: movzwl (%rdi), %eax # encoding: [0x0f,0xb7,0x07]
; NDD-NEXT: shrw $4, %ax # EVEX TO LEGACY Compression encoding: [0x66,0xc1,0xe8,0x04]
; NDD-NEXT: retq # encoding: [0xc3]
;
; MEM-LABEL: shr16mi:
; MEM: # %bb.0: # %entry
; MEM-NEXT: shrw $4, (%rdi), %ax # encoding: [0x62,0xf4,0x7d,0x18,0xc1,0x2f,0x04]
; MEM-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr16mi:
; NF: # %bb.0: # %entry
; NF-NEXT: movzwl (%rdi), %eax # encoding: [0x0f,0xb7,0x07]
; NF-NEXT: shrw $4, %ax # EVEX TO LEGACY Compression encoding: [0x66,0xc1,0xe8,0x04]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i16, ptr %ptr
%shr = lshr i16 %a, 4
ret i16 %shr
}
define i32 @shr32mi(ptr %ptr) {
; NDD-LABEL: shr32mi:
; NDD: # %bb.0: # %entry
; NDD-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07]
; NDD-NEXT: shrl $4, %eax # EVEX TO LEGACY Compression encoding: [0xc1,0xe8,0x04]
; NDD-NEXT: retq # encoding: [0xc3]
;
; MEM-LABEL: shr32mi:
; MEM: # %bb.0: # %entry
; MEM-NEXT: shrl $4, (%rdi), %eax # encoding: [0x62,0xf4,0x7c,0x18,0xc1,0x2f,0x04]
; MEM-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr32mi:
; NF: # %bb.0: # %entry
; NF-NEXT: movl (%rdi), %eax # encoding: [0x8b,0x07]
; NF-NEXT: shrl $4, %eax # EVEX TO LEGACY Compression encoding: [0xc1,0xe8,0x04]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i32, ptr %ptr
%shr = lshr i32 %a, 4
ret i32 %shr
}
define i64 @shr64mi(ptr %ptr) {
; NDD-LABEL: shr64mi:
; NDD: # %bb.0: # %entry
; NDD-NEXT: movq (%rdi), %rax # encoding: [0x48,0x8b,0x07]
; NDD-NEXT: shrq $4, %rax # EVEX TO LEGACY Compression encoding: [0x48,0xc1,0xe8,0x04]
; NDD-NEXT: retq # encoding: [0xc3]
;
; MEM-LABEL: shr64mi:
; MEM: # %bb.0: # %entry
; MEM-NEXT: shrq $4, (%rdi), %rax # encoding: [0x62,0xf4,0xfc,0x18,0xc1,0x2f,0x04]
; MEM-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr64mi:
; NF: # %bb.0: # %entry
; NF-NEXT: movq (%rdi), %rax # encoding: [0x48,0x8b,0x07]
; NF-NEXT: shrq $4, %rax # EVEX TO LEGACY Compression encoding: [0x48,0xc1,0xe8,0x04]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i64, ptr %ptr
%shr = lshr i64 %a, 4
ret i64 %shr
}
define i8 @shr8r1(i8 noundef %a) {
; CHECK-LABEL: shr8r1:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shrb %dil, %al # encoding: [0x62,0xf4,0x7c,0x18,0xd0,0xef]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr8r1:
; NF: # %bb.0: # %entry
; NF-NEXT: {nf} shrb %dil, %al # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0xd0,0xef]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%shr = lshr i8 %a, 1
ret i8 %shr
}
define i16 @shr16r1(i16 noundef %a) {
; CHECK-LABEL: shr16r1:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shrw %di, %ax # encoding: [0x62,0xf4,0x7d,0x18,0xd1,0xef]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr16r1:
; NF: # %bb.0: # %entry
; NF-NEXT: {nf} shrw %di, %ax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7d,0x1c,0xd1,0xef]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%shr = lshr i16 %a, 1
ret i16 %shr
}
define i32 @shr32r1(i32 noundef %a) {
; CHECK-LABEL: shr32r1:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shrl %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0xd1,0xef]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr32r1:
; NF: # %bb.0: # %entry
; NF-NEXT: {nf} shrl %edi, %eax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0xd1,0xef]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%shr = lshr i32 %a, 1
ret i32 %shr
}
define i64 @shr64r1(i64 noundef %a) {
; CHECK-LABEL: shr64r1:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shrq %rdi, %rax # encoding: [0x62,0xf4,0xfc,0x18,0xd1,0xef]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr64r1:
; NF: # %bb.0: # %entry
; NF-NEXT: {nf} shrq %rdi, %rax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0xfc,0x1c,0xd1,0xef]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%shr = lshr i64 %a, 1
ret i64 %shr
}
define i8 @shr8rcl(i8 noundef %a, i8 %cl) {
; CHECK-LABEL: shr8rcl:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
; CHECK-NEXT: shrb %cl, %dil, %al # encoding: [0x62,0xf4,0x7c,0x18,0xd2,0xef]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr8rcl:
; NF: # %bb.0: # %entry
; NF-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NF-NEXT: # kill: def $cl killed $cl killed $ecx
; NF-NEXT: {nf} shrb %cl, %dil, %al # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0xd2,0xef]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%shr = lshr i8 %a, %cl
ret i8 %shr
}
define i8 @shr8rcl_mask(i8 noundef %a, i8 %cl) {
; CHECK-LABEL: shr8rcl_mask:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
; CHECK-NEXT: shrb %cl, %dil, %al # encoding: [0x62,0xf4,0x7c,0x18,0xd2,0xef]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr8rcl_mask:
; NF: # %bb.0: # %entry
; NF-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NF-NEXT: # kill: def $cl killed $cl killed $ecx
; NF-NEXT: {nf} shrb %cl, %dil, %al # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0xd2,0xef]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%shamt = and i8 %cl, 31
%shr = lshr i8 %a, %shamt
ret i8 %shr
}
define i16 @shr16rcl(i16 noundef %a, i16 %cl) {
; CHECK-LABEL: shr16rcl:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
; CHECK-NEXT: shrw %cl, %di, %ax # encoding: [0x62,0xf4,0x7d,0x18,0xd3,0xef]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr16rcl:
; NF: # %bb.0: # %entry
; NF-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NF-NEXT: # kill: def $cl killed $cl killed $ecx
; NF-NEXT: {nf} shrw %cl, %di, %ax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7d,0x1c,0xd3,0xef]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%shr = lshr i16 %a, %cl
ret i16 %shr
}
define i16 @shr16rcl_mask(i16 noundef %a, i16 %cl) {
; CHECK-LABEL: shr16rcl_mask:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
; CHECK-NEXT: shrw %cl, %di, %ax # encoding: [0x62,0xf4,0x7d,0x18,0xd3,0xef]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr16rcl_mask:
; NF: # %bb.0: # %entry
; NF-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NF-NEXT: # kill: def $cl killed $cl killed $ecx
; NF-NEXT: {nf} shrw %cl, %di, %ax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7d,0x1c,0xd3,0xef]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%shamt = and i16 %cl, 31
%shr = lshr i16 %a, %shamt
ret i16 %shr
}
define i32 @shr32rcl(i32 noundef %a, i32 %cl) {
; CHECK-LABEL: shr32rcl:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
; CHECK-NEXT: shrl %cl, %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0xd3,0xef]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr32rcl:
; NF: # %bb.0: # %entry
; NF-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NF-NEXT: # kill: def $cl killed $cl killed $ecx
; NF-NEXT: {nf} shrl %cl, %edi, %eax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0xd3,0xef]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%shr = lshr i32 %a, %cl
ret i32 %shr
}
define i32 @shr32rcl_mask(i32 noundef %a, i32 %cl) {
; CHECK-LABEL: shr32rcl_mask:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
; CHECK-NEXT: shrl %cl, %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0xd3,0xef]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr32rcl_mask:
; NF: # %bb.0: # %entry
; NF-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NF-NEXT: # kill: def $cl killed $cl killed $ecx
; NF-NEXT: {nf} shrl %cl, %edi, %eax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0xd3,0xef]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%shamt = and i32 %cl, 31
%shr = lshr i32 %a, %shamt
ret i32 %shr
}
define i64 @shr64rcl(i64 noundef %a, i64 %cl) {
; CHECK-LABEL: shr64rcl:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movq %rsi, %rcx # encoding: [0x48,0x89,0xf1]
; CHECK-NEXT: # kill: def $cl killed $cl killed $rcx
; CHECK-NEXT: shrq %cl, %rdi, %rax # encoding: [0x62,0xf4,0xfc,0x18,0xd3,0xef]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr64rcl:
; NF: # %bb.0: # %entry
; NF-NEXT: movq %rsi, %rcx # encoding: [0x48,0x89,0xf1]
; NF-NEXT: # kill: def $cl killed $cl killed $rcx
; NF-NEXT: {nf} shrq %cl, %rdi, %rax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0xfc,0x1c,0xd3,0xef]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%shr = lshr i64 %a, %cl
ret i64 %shr
}
define i64 @shr64rcl_mask(i64 noundef %a, i64 %cl) {
; CHECK-LABEL: shr64rcl_mask:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movq %rsi, %rcx # encoding: [0x48,0x89,0xf1]
; CHECK-NEXT: # kill: def $cl killed $cl killed $rcx
; CHECK-NEXT: shrq %cl, %rdi, %rax # encoding: [0x62,0xf4,0xfc,0x18,0xd3,0xef]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr64rcl_mask:
; NF: # %bb.0: # %entry
; NF-NEXT: movq %rsi, %rcx # encoding: [0x48,0x89,0xf1]
; NF-NEXT: # kill: def $cl killed $cl killed $rcx
; NF-NEXT: {nf} shrq %cl, %rdi, %rax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0xfc,0x1c,0xd3,0xef]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%shamt = and i64 %cl, 63
%shr = lshr i64 %a, %shamt
ret i64 %shr
}
define i8 @shr8ri(i8 noundef %a) {
; CHECK-LABEL: shr8ri:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shrb $4, %dil, %al # encoding: [0x62,0xf4,0x7c,0x18,0xc0,0xef,0x04]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr8ri:
; NF: # %bb.0: # %entry
; NF-NEXT: {nf} shrb $4, %dil, %al # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0xc0,0xef,0x04]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%shr = lshr i8 %a, 4
ret i8 %shr
}
define i16 @shr16ri(i16 noundef %a) {
; CHECK-LABEL: shr16ri:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shrw $4, %di, %ax # encoding: [0x62,0xf4,0x7d,0x18,0xc1,0xef,0x04]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr16ri:
; NF: # %bb.0: # %entry
; NF-NEXT: {nf} shrw $4, %di, %ax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7d,0x1c,0xc1,0xef,0x04]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%shr = lshr i16 %a, 4
ret i16 %shr
}
define i32 @shr32ri(i32 noundef %a) {
; CHECK-LABEL: shr32ri:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shrl $4, %edi, %eax # encoding: [0x62,0xf4,0x7c,0x18,0xc1,0xef,0x04]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr32ri:
; NF: # %bb.0: # %entry
; NF-NEXT: {nf} shrl $4, %edi, %eax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0x7c,0x1c,0xc1,0xef,0x04]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%shr = lshr i32 %a, 4
ret i32 %shr
}
define i64 @shr64ri(i64 noundef %a) {
; CHECK-LABEL: shr64ri:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shrq $4, %rdi, %rax # encoding: [0x62,0xf4,0xfc,0x18,0xc1,0xef,0x04]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr64ri:
; NF: # %bb.0: # %entry
; NF-NEXT: {nf} shrq $4, %rdi, %rax # EVEX TO EVEX Compression encoding: [0x62,0xf4,0xfc,0x1c,0xc1,0xef,0x04]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%shr = lshr i64 %a, 4
ret i64 %shr
}
define void @shr8m1_legacy(ptr %ptr) {
; CHECK-LABEL: shr8m1_legacy:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shrb (%rdi) # encoding: [0xd0,0x2f]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr8m1_legacy:
; NF: # %bb.0: # %entry
; NF-NEXT: shrb (%rdi) # encoding: [0xd0,0x2f]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i8, ptr %ptr
%shr = lshr i8 %a, 1
store i8 %shr, ptr %ptr
ret void
}
define void @shr16m1_legacy(ptr %ptr) {
; CHECK-LABEL: shr16m1_legacy:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shrw (%rdi) # encoding: [0x66,0xd1,0x2f]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr16m1_legacy:
; NF: # %bb.0: # %entry
; NF-NEXT: shrw (%rdi) # encoding: [0x66,0xd1,0x2f]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i16, ptr %ptr
%shr = lshr i16 %a, 1
store i16 %shr, ptr %ptr
ret void
}
define void @shr32m1_legacy(ptr %ptr) {
; CHECK-LABEL: shr32m1_legacy:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shrl (%rdi) # encoding: [0xd1,0x2f]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr32m1_legacy:
; NF: # %bb.0: # %entry
; NF-NEXT: shrl (%rdi) # encoding: [0xd1,0x2f]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i32, ptr %ptr
%shr = lshr i32 %a, 1
store i32 %shr, ptr %ptr
ret void
}
define void @shr64m1_legacy(ptr %ptr) {
; CHECK-LABEL: shr64m1_legacy:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shrq (%rdi) # encoding: [0x48,0xd1,0x2f]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr64m1_legacy:
; NF: # %bb.0: # %entry
; NF-NEXT: shrq (%rdi) # encoding: [0x48,0xd1,0x2f]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i64, ptr %ptr
%shr = lshr i64 %a, 1
store i64 %shr, ptr %ptr
ret void
}
define void @shr8mi_legacy(ptr %ptr) {
; CHECK-LABEL: shr8mi_legacy:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shrb $4, (%rdi) # encoding: [0xc0,0x2f,0x04]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr8mi_legacy:
; NF: # %bb.0: # %entry
; NF-NEXT: shrb $4, (%rdi) # encoding: [0xc0,0x2f,0x04]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i8, ptr %ptr
%shr = lshr i8 %a, 4
store i8 %shr, ptr %ptr
ret void
}
define void @shr16mi_legacy(ptr %ptr) {
; CHECK-LABEL: shr16mi_legacy:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shrw $4, (%rdi) # encoding: [0x66,0xc1,0x2f,0x04]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr16mi_legacy:
; NF: # %bb.0: # %entry
; NF-NEXT: shrw $4, (%rdi) # encoding: [0x66,0xc1,0x2f,0x04]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i16, ptr %ptr
%shr = lshr i16 %a, 4
store i16 %shr, ptr %ptr
ret void
}
define void @shr32mi_legacy(ptr %ptr) {
; CHECK-LABEL: shr32mi_legacy:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shrl $4, (%rdi) # encoding: [0xc1,0x2f,0x04]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr32mi_legacy:
; NF: # %bb.0: # %entry
; NF-NEXT: shrl $4, (%rdi) # encoding: [0xc1,0x2f,0x04]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i32, ptr %ptr
%shr = lshr i32 %a, 4
store i32 %shr, ptr %ptr
ret void
}
define void @shr64mi_legacy(ptr %ptr) {
; CHECK-LABEL: shr64mi_legacy:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: shrq $4, (%rdi) # encoding: [0x48,0xc1,0x2f,0x04]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr64mi_legacy:
; NF: # %bb.0: # %entry
; NF-NEXT: shrq $4, (%rdi) # encoding: [0x48,0xc1,0x2f,0x04]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i64, ptr %ptr
%shr = lshr i64 %a, 4
store i64 %shr, ptr %ptr
ret void
}
define void @shr8mcl_legacy(ptr %ptr, i8 %cl) {
; CHECK-LABEL: shr8mcl_legacy:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
; CHECK-NEXT: shrb %cl, (%rdi) # encoding: [0xd2,0x2f]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr8mcl_legacy:
; NF: # %bb.0: # %entry
; NF-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NF-NEXT: # kill: def $cl killed $cl killed $ecx
; NF-NEXT: shrb %cl, (%rdi) # encoding: [0xd2,0x2f]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i8, ptr %ptr
%shr = lshr i8 %a, %cl
store i8 %shr, ptr %ptr
ret void
}
define void @shr16mcl_legacy(ptr %ptr, i16 %cl) {
; CHECK-LABEL: shr16mcl_legacy:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
; CHECK-NEXT: shrw %cl, (%rdi) # encoding: [0x66,0xd3,0x2f]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr16mcl_legacy:
; NF: # %bb.0: # %entry
; NF-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NF-NEXT: # kill: def $cl killed $cl killed $ecx
; NF-NEXT: shrw %cl, (%rdi) # encoding: [0x66,0xd3,0x2f]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i16, ptr %ptr
%shr = lshr i16 %a, %cl
store i16 %shr, ptr %ptr
ret void
}
define void @shr32mcl_legacy(ptr %ptr, i32 %cl) {
; CHECK-LABEL: shr32mcl_legacy:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; CHECK-NEXT: # kill: def $cl killed $cl killed $ecx
; CHECK-NEXT: shrl %cl, (%rdi) # encoding: [0xd3,0x2f]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr32mcl_legacy:
; NF: # %bb.0: # %entry
; NF-NEXT: movl %esi, %ecx # encoding: [0x89,0xf1]
; NF-NEXT: # kill: def $cl killed $cl killed $ecx
; NF-NEXT: shrl %cl, (%rdi) # encoding: [0xd3,0x2f]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i32, ptr %ptr
%shr = lshr i32 %a, %cl
store i32 %shr, ptr %ptr
ret void
}
define void @shr64mcl_legacy(ptr %ptr, i64 %cl) {
; CHECK-LABEL: shr64mcl_legacy:
; CHECK: # %bb.0: # %entry
; CHECK-NEXT: movq %rsi, %rcx # encoding: [0x48,0x89,0xf1]
; CHECK-NEXT: # kill: def $cl killed $cl killed $rcx
; CHECK-NEXT: shrq %cl, (%rdi) # encoding: [0x48,0xd3,0x2f]
; CHECK-NEXT: retq # encoding: [0xc3]
;
; NF-LABEL: shr64mcl_legacy:
; NF: # %bb.0: # %entry
; NF-NEXT: movq %rsi, %rcx # encoding: [0x48,0x89,0xf1]
; NF-NEXT: # kill: def $cl killed $cl killed $rcx
; NF-NEXT: shrq %cl, (%rdi) # encoding: [0x48,0xd3,0x2f]
; NF-NEXT: retq # encoding: [0xc3]
entry:
%a = load i64, ptr %ptr
%shr = lshr i64 %a, %cl
store i64 %shr, ptr %ptr
ret void
}