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
186 lines
4.4 KiB
LLVM
186 lines
4.4 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
; RUN: llc < %s -mtriple=aarch64-gnu-linux -o - | FileCheck %s
|
|
|
|
; These tests make sure that the `cmp` instruction is rendered with an
|
|
; instruction that checks the sign bit of the original unextended data
|
|
; (%in) instead of the sign bit of the sign extended one that is
|
|
; created by the type legalization process.
|
|
;
|
|
; The tests are subdivided in tests that determine the sign bit
|
|
; looking through a `sign_extend_inreg` and tests that determine the
|
|
; sign bit looking through a `sign_extend`.
|
|
|
|
define i32 @f_i8_sign_extend_inreg(i8 %in, i32 %a, i32 %b) nounwind {
|
|
; CHECK-LABEL: f_i8_sign_extend_inreg:
|
|
; CHECK: // %bb.0: // %entry
|
|
; CHECK-NEXT: sxtb w8, w0
|
|
; CHECK-NEXT: cmn w8, #1
|
|
; CHECK-NEXT: csel w8, w1, w2, gt
|
|
; CHECK-NEXT: add w0, w8, w0, uxtb
|
|
; CHECK-NEXT: ret
|
|
entry:
|
|
%cmp = icmp sgt i8 %in, -1
|
|
%ext = zext i8 %in to i32
|
|
br i1 %cmp, label %A, label %B
|
|
|
|
A:
|
|
%retA = add i32 %ext, %a
|
|
ret i32 %retA
|
|
|
|
B:
|
|
%retB = add i32 %ext, %b
|
|
ret i32 %retB
|
|
}
|
|
|
|
define i32 @f_i16_sign_extend_inreg(i16 %in, i32 %a, i32 %b) nounwind {
|
|
; CHECK-LABEL: f_i16_sign_extend_inreg:
|
|
; CHECK: // %bb.0: // %entry
|
|
; CHECK-NEXT: sxth w8, w0
|
|
; CHECK-NEXT: cmn w8, #1
|
|
; CHECK-NEXT: csel w8, w1, w2, gt
|
|
; CHECK-NEXT: add w0, w8, w0, uxth
|
|
; CHECK-NEXT: ret
|
|
entry:
|
|
%cmp = icmp sgt i16 %in, -1
|
|
%ext = zext i16 %in to i32
|
|
br i1 %cmp, label %A, label %B
|
|
|
|
A:
|
|
%retA = add i32 %ext, %a
|
|
ret i32 %retA
|
|
|
|
B:
|
|
%retB = add i32 %ext, %b
|
|
ret i32 %retB
|
|
}
|
|
|
|
define i64 @f_i32_sign_extend_inreg(i32 %in, i64 %a, i64 %b) nounwind {
|
|
; CHECK-LABEL: f_i32_sign_extend_inreg:
|
|
; CHECK: // %bb.0: // %entry
|
|
; CHECK-NEXT: cmn w0, #1
|
|
; CHECK-NEXT: csel x8, x1, x2, gt
|
|
; CHECK-NEXT: add x0, x8, w0, uxtw
|
|
; CHECK-NEXT: ret
|
|
entry:
|
|
%cmp = icmp sgt i32 %in, -1
|
|
%ext = zext i32 %in to i64
|
|
br i1 %cmp, label %A, label %B
|
|
|
|
A:
|
|
%retA = add i64 %ext, %a
|
|
ret i64 %retA
|
|
|
|
B:
|
|
%retB = add i64 %ext, %b
|
|
ret i64 %retB
|
|
}
|
|
|
|
define i32 @g_i8_sign_extend_inreg(i8 %in, i32 %a, i32 %b) nounwind {
|
|
; CHECK-LABEL: g_i8_sign_extend_inreg:
|
|
; CHECK: // %bb.0: // %entry
|
|
; CHECK-NEXT: tst w0, #0x80
|
|
; CHECK-NEXT: csel w8, w1, w2, ne
|
|
; CHECK-NEXT: add w0, w8, w0, uxtb
|
|
; CHECK-NEXT: ret
|
|
entry:
|
|
%cmp = icmp slt i8 %in, 0
|
|
%ext = zext i8 %in to i32
|
|
br i1 %cmp, label %A, label %B
|
|
|
|
A:
|
|
%retA = add i32 %ext, %a
|
|
ret i32 %retA
|
|
|
|
B:
|
|
%retB = add i32 %ext, %b
|
|
ret i32 %retB
|
|
}
|
|
|
|
define i32 @g_i16_sign_extend_inreg(i16 %in, i32 %a, i32 %b) nounwind {
|
|
; CHECK-LABEL: g_i16_sign_extend_inreg:
|
|
; CHECK: // %bb.0: // %entry
|
|
; CHECK-NEXT: tst w0, #0x8000
|
|
; CHECK-NEXT: csel w8, w1, w2, ne
|
|
; CHECK-NEXT: add w0, w8, w0, uxth
|
|
; CHECK-NEXT: ret
|
|
entry:
|
|
%cmp = icmp slt i16 %in, 0
|
|
%ext = zext i16 %in to i32
|
|
br i1 %cmp, label %A, label %B
|
|
|
|
A:
|
|
%retA = add i32 %ext, %a
|
|
ret i32 %retA
|
|
|
|
B:
|
|
%retB = add i32 %ext, %b
|
|
ret i32 %retB
|
|
}
|
|
|
|
define i64 @g_i32_sign_extend_inreg(i32 %in, i64 %a, i64 %b) nounwind {
|
|
; CHECK-LABEL: g_i32_sign_extend_inreg:
|
|
; CHECK: // %bb.0: // %entry
|
|
; CHECK-NEXT: cmp w0, #0
|
|
; CHECK-NEXT: csel x8, x1, x2, mi
|
|
; CHECK-NEXT: add x0, x8, w0, uxtw
|
|
; CHECK-NEXT: ret
|
|
entry:
|
|
%cmp = icmp slt i32 %in, 0
|
|
%ext = zext i32 %in to i64
|
|
br i1 %cmp, label %A, label %B
|
|
|
|
A:
|
|
%retA = add i64 %ext, %a
|
|
ret i64 %retA
|
|
|
|
B:
|
|
%retB = add i64 %ext, %b
|
|
ret i64 %retB
|
|
}
|
|
|
|
define i64 @f_i32_sign_extend_i64(i32 %in, i64 %a, i64 %b) nounwind {
|
|
; CHECK-LABEL: f_i32_sign_extend_i64:
|
|
; CHECK: // %bb.0: // %entry
|
|
; CHECK-NEXT: // kill: def $w0 killed $w0 def $x0
|
|
; CHECK-NEXT: sxtw x8, w0
|
|
; CHECK-NEXT: cmn x8, #1
|
|
; CHECK-NEXT: csel x8, x1, x2, gt
|
|
; CHECK-NEXT: add x0, x8, w0, uxtw
|
|
; CHECK-NEXT: ret
|
|
entry:
|
|
%inext = sext i32 %in to i64
|
|
%cmp = icmp sgt i64 %inext, -1
|
|
%ext = zext i32 %in to i64
|
|
br i1 %cmp, label %A, label %B
|
|
|
|
A:
|
|
%retA = add i64 %ext, %a
|
|
ret i64 %retA
|
|
|
|
B:
|
|
%retB = add i64 %ext, %b
|
|
ret i64 %retB
|
|
}
|
|
|
|
define i64 @g_i32_sign_extend_i64(i32 %in, i64 %a, i64 %b) nounwind {
|
|
; CHECK-LABEL: g_i32_sign_extend_i64:
|
|
; CHECK: // %bb.0: // %entry
|
|
; CHECK-NEXT: tst w0, #0x80000000
|
|
; CHECK-NEXT: csel x8, x1, x2, ne
|
|
; CHECK-NEXT: add x0, x8, w0, uxtw
|
|
; CHECK-NEXT: ret
|
|
entry:
|
|
%inext = sext i32 %in to i64
|
|
%cmp = icmp slt i64 %inext, 0
|
|
%ext = zext i32 %in to i64
|
|
br i1 %cmp, label %A, label %B
|
|
|
|
A:
|
|
%retA = add i64 %ext, %a
|
|
ret i64 %retA
|
|
|
|
B:
|
|
%retB = add i64 %ext, %b
|
|
ret i64 %retB
|
|
}
|