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
124 lines
2.6 KiB
LLVM
124 lines
2.6 KiB
LLVM
; RUN: llc -mtriple=aarch64-none-linux-gnu < %s | FileCheck %s
|
|
|
|
; CHECK-LABEL: @test1
|
|
; CHECK: sbfx {{x[0-9]+}}, x0, #23, #9
|
|
define i64 @test1(i32 %a) {
|
|
%tmp = ashr i32 %a, 23
|
|
%ext = sext i32 %tmp to i64
|
|
%res = add i64 %ext, 1
|
|
ret i64 %res
|
|
}
|
|
|
|
; CHECK-LABEL: @test2
|
|
; CHECK: sbfx w0, w0, #23, #8
|
|
define signext i8 @test2(i32 %a) {
|
|
%tmp = ashr i32 %a, 23
|
|
%res = trunc i32 %tmp to i8
|
|
ret i8 %res
|
|
}
|
|
|
|
; CHECK-LABEL: @test3
|
|
; CHECK: sbfx w0, w0, #23, #8
|
|
define signext i8 @test3(i32 %a) {
|
|
%tmp = lshr i32 %a, 23
|
|
%res = trunc i32 %tmp to i8
|
|
ret i8 %res
|
|
}
|
|
|
|
; CHECK-LABEL: @test4
|
|
; CHECK: sbfx w0, w0, #15, #16
|
|
define signext i16 @test4(i32 %a) {
|
|
%tmp = lshr i32 %a, 15
|
|
%res = trunc i32 %tmp to i16
|
|
ret i16 %res
|
|
}
|
|
|
|
; CHECK-LABEL: @test5
|
|
; CHECK: sbfx w0, w0, #16, #8
|
|
define signext i8 @test5(i64 %a) {
|
|
%tmp = lshr i64 %a, 16
|
|
%res = trunc i64 %tmp to i8
|
|
ret i8 %res
|
|
}
|
|
|
|
; CHECK-LABEL: @test6
|
|
; CHECK: sbfx x0, x0, #30, #8
|
|
define signext i8 @test6(i64 %a) {
|
|
%tmp = lshr i64 %a, 30
|
|
%res = trunc i64 %tmp to i8
|
|
ret i8 %res
|
|
}
|
|
|
|
; CHECK-LABEL: @test7
|
|
; CHECK: sbfx x0, x0, #23, #16
|
|
define signext i16 @test7(i64 %a) {
|
|
%tmp = lshr i64 %a, 23
|
|
%res = trunc i64 %tmp to i16
|
|
ret i16 %res
|
|
}
|
|
|
|
; CHECK-LABEL: @test8
|
|
; CHECK: asr w0, w0, #25
|
|
define signext i8 @test8(i32 %a) {
|
|
%tmp = ashr i32 %a, 25
|
|
%res = trunc i32 %tmp to i8
|
|
ret i8 %res
|
|
}
|
|
|
|
; CHECK-LABEL: @test9
|
|
; CHECK: lsr w0, w0, #25
|
|
define signext i8 @test9(i32 %a) {
|
|
%tmp = lshr i32 %a, 25
|
|
%res = trunc i32 %tmp to i8
|
|
ret i8 %res
|
|
}
|
|
|
|
; CHECK-LABEL: @test10
|
|
; CHECK: lsr x0, x0, #49
|
|
define signext i16 @test10(i64 %a) {
|
|
%tmp = lshr i64 %a, 49
|
|
%res = trunc i64 %tmp to i16
|
|
ret i16 %res
|
|
}
|
|
|
|
; SHR with multiple uses is fine as SXTH and SBFX are both aliases of SBFM.
|
|
; However, allowing the transformation means the SHR and SBFX can execute in
|
|
; parallel.
|
|
;
|
|
; CHECK-LABEL: @test11
|
|
; CHECK: lsr x1, x0, #23
|
|
; CHECK: sbfx x0, x0, #23, #16
|
|
define void @test11(i64 %a) {
|
|
%tmp = lshr i64 %a, 23
|
|
%res = trunc i64 %tmp to i16
|
|
call void @use(i16 signext %res, i64 %tmp)
|
|
ret void
|
|
}
|
|
|
|
declare void @use(i16 signext, i64)
|
|
|
|
; CHECK-LABEL: test_complex_node:
|
|
; CHECK: ldr d0, [x0], #8
|
|
; CHECK: lsr w[[VAL:[0-9]+]], w0, #5
|
|
; CHECK: str w[[VAL]], [x2]
|
|
define <2 x i32> @test_complex_node(ptr %addr, ptr %addr2, ptr %bf ) {
|
|
%vec = load <2 x i32>, ptr %addr
|
|
|
|
%vec.next = getelementptr <2 x i32>, ptr %addr, i32 1
|
|
store ptr %vec.next, ptr %addr2
|
|
%lo = ptrtoint ptr %vec.next to i32
|
|
|
|
%val = lshr i32 %lo, 5
|
|
store i32 %val, ptr %bf
|
|
|
|
ret <2 x i32> %vec
|
|
}
|
|
|
|
; CHECK-LABEL: @test12
|
|
; CHECK: lsr w0, w0, #10
|
|
define i32 @test12(i64 %a) {
|
|
%tmp = trunc i64 %a to i32
|
|
%res = lshr i32 %tmp, 10
|
|
ret i32 %res
|
|
}
|