Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/X86/GlobalISel/shl-scalar-widening.ll
T
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

56 lines
1.9 KiB
LLVM
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=X64
define i16 @test_shl_i4(i16 %v, i16 %a, i16 %b) {
; Let's say the arguments are the following unsigned
; integers in two’s complement representation:
;
; %v: 77 (0000 0000 0100 1101)
; %a: 74 (0000 0000 0100 1010)
; %b: 72 (0000 0000 0100 1000)
; X64-LABEL: test_shl_i4:
; X64: # %bb.0:
; X64-NEXT: # kill: def $esi killed $esi def $rsi
; X64-NEXT: # kill: def $edx killed $edx def $rdx
; X64-NEXT: leal (%rdx,%rsi), %ecx
; X64-NEXT: andb $15, %cl
; X64-NEXT: # kill: def $cl killed $cl killed $ecx
; X64-NEXT: shlb %cl, %dil
; X64-NEXT: movzbl %dil, %eax
; X64-NEXT: andw $15, %ax
; X64-NEXT: # kill: def $ax killed $ax killed $eax
; X64-NEXT: retq
%v.t = trunc i16 %v to i4 ; %v.t: 13 (1101)
%a.t = trunc i16 %a to i4 ; %a.t: 10 (1010)
%b.t = trunc i16 %b to i4 ; %b.t: 8 (1000)
%n.t = add i4 %a.t, %b.t ; %n.t: 2 (0010)
%r.t = shl i4 %v.t, %n.t ; %r.t: 4 (0100)
%r = zext i4 %r.t to i16
; %r: 4 (0000 0000 0000 0100)
ret i16 %r
; %di: 77 (0000 0000 0100 1101)
; %si: 74 (0000 0000 0100 1010)
; %dx: 72 (0000 0000 0100 1000)
; %dx: 146 (0000 0000 1001 0010)
; %dx: 2 (0000 0000 0000 0010)
; %cx: 2 (0000 0000 0000 0010)
; %di: 52 (0000 0000 0011 0100)
; %di: 4 (0000 0000 0000 0100)
; %ax: 4 (0000 0000 0000 0100)
; Let's pretend that legalizing G_SHL by widening its second
; source operand is done via G_ANYEXT rather than G_ZEXT and
; see what happens:
; addb %sil, %dl
; %dx: 146 (0000 0000 1001 0010)
; movl %edx, %ecx
; %cx: 146 (0000 0000 1001 0010)
; shlb %cl, %dil
; %di: 0 (0000 0000 0000 0000)
; andw $15, %di
; %di: 0 (0000 0000 0000 0000)
; movl %edi, %eax
; %ax: 0 (0000 0000 0000 0000)
; retq
}