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
113 lines
2.9 KiB
LLVM
113 lines
2.9 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
|
|
|
|
; Overflow on a float to int or int to float conversion is undefined (PR21130).
|
|
|
|
define i8 @overflow_fptosi() {
|
|
; CHECK-LABEL: @overflow_fptosi(
|
|
; CHECK-NEXT: ret i8 poison
|
|
;
|
|
%i = fptosi double 1.56e+02 to i8
|
|
ret i8 %i
|
|
}
|
|
|
|
define i8 @overflow_fptoui() {
|
|
; CHECK-LABEL: @overflow_fptoui(
|
|
; CHECK-NEXT: ret i8 poison
|
|
;
|
|
%i = fptoui double 2.56e+02 to i8
|
|
ret i8 %i
|
|
}
|
|
|
|
; The maximum float is approximately 2 ** 128 which is 3.4E38.
|
|
; The constant below is 4E38. Use a 130 bit integer to hold that
|
|
; number; 129-bits for the value + 1 bit for the sign.
|
|
|
|
define float @overflow_uitofp() {
|
|
; CHECK-LABEL: @overflow_uitofp(
|
|
; CHECK-NEXT: ret float +inf
|
|
;
|
|
%i = uitofp i130 400000000000000000000000000000000000000 to float
|
|
ret float %i
|
|
}
|
|
|
|
define float @overflow_sitofp() {
|
|
; CHECK-LABEL: @overflow_sitofp(
|
|
; CHECK-NEXT: ret float +inf
|
|
;
|
|
%i = sitofp i130 400000000000000000000000000000000000000 to float
|
|
ret float %i
|
|
}
|
|
|
|
; https://llvm.org/PR43907 - make sure that NaN doesn't morph into Inf.
|
|
; SNaN becomes QNaN.
|
|
|
|
define float @nan_f64_trunc() {
|
|
; CHECK-LABEL: @nan_f64_trunc(
|
|
; CHECK-NEXT: ret float +qnan
|
|
;
|
|
%f = fptrunc double 0x7FF0000000000001 to float
|
|
ret float %f
|
|
}
|
|
|
|
; Verify again with a vector and different destination type.
|
|
; SNaN becomes SNaN (first two elements).
|
|
; QNaN remains QNaN (third element).
|
|
; Lower 42 bits of NaN source payload are lost.
|
|
|
|
define <3 x half> @nan_v3f64_trunc() {
|
|
; CHECK-LABEL: @nan_v3f64_trunc(
|
|
; CHECK-NEXT: ret <3 x half> splat (half +qnan)
|
|
;
|
|
%f = fptrunc <3 x double> <double 0x7FF0020000000000, double 0x7FF003FFFFFFFFFF, double 0x7FF8000000000001> to <3 x half>
|
|
ret <3 x half> %f
|
|
}
|
|
|
|
define bfloat @nan_bf16_trunc() {
|
|
; CHECK-LABEL: @nan_bf16_trunc(
|
|
; CHECK-NEXT: ret bfloat +qnan
|
|
;
|
|
%f = fptrunc double 0x7FF0000000000001 to bfloat
|
|
ret bfloat %f
|
|
}
|
|
|
|
define float @trunc_denorm_lost_fraction0() {
|
|
; CHECK-LABEL: @trunc_denorm_lost_fraction0(
|
|
; CHECK-NEXT: ret float 0.000000e+00
|
|
;
|
|
%b = fptrunc double 0x0000000010000000 to float
|
|
ret float %b
|
|
}
|
|
|
|
define float @trunc_denorm_lost_fraction1() {
|
|
; CHECK-LABEL: @trunc_denorm_lost_fraction1(
|
|
; CHECK-NEXT: ret float 0.000000e+00
|
|
;
|
|
%b = fptrunc double 0x0000000010000001 to float
|
|
ret float %b
|
|
}
|
|
|
|
define float @trunc_denorm_lost_fraction2() {
|
|
; CHECK-LABEL: @trunc_denorm_lost_fraction2(
|
|
; CHECK-NEXT: ret float 0.000000e+00
|
|
;
|
|
%b = fptrunc double 0x000000001fffffff to float
|
|
ret float %b
|
|
}
|
|
|
|
define float @trunc_denorm_lost_fraction3() {
|
|
; CHECK-LABEL: @trunc_denorm_lost_fraction3(
|
|
; CHECK-NEXT: ret float 0.000000e+00
|
|
;
|
|
%b = fptrunc double 0x0000000020000000 to float
|
|
ret float %b
|
|
}
|
|
|
|
define float @trunc_denorm_lost_fraction4() {
|
|
; CHECK-LABEL: @trunc_denorm_lost_fraction4(
|
|
; CHECK-NEXT: ret float -0.000000e+00
|
|
;
|
|
%b = fptrunc double 0x8000000010000001 to float
|
|
ret float %b
|
|
}
|