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
877 lines
30 KiB
LLVM
877 lines
30 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
|
|
; RUN: opt < %s -passes=instsimplify -march=nvptx64 --mcpu=sm_86 --mattr=+ptx72 -S | FileCheck %s
|
|
|
|
; Check constant-folding for NVVM add intrinsics with different rounding modes
|
|
|
|
;###############################################################
|
|
;# Add(1.25, -2.0) #
|
|
;###############################################################
|
|
; Tests addition of two normal numbers (1.25 and -2.0) where the result
|
|
; is exactly representable. All rounding modes produce the same result.
|
|
|
|
define double @test_1_25_minus_2_rm_d() {
|
|
; CHECK-LABEL: define double @test_1_25_minus_2_rm_d() {
|
|
; CHECK-NEXT: ret double -7.500000e-01
|
|
;
|
|
%res = call double @llvm.nvvm.add.rm.d(double 1.25, double -2.0)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_1_25_minus_2_rn_d() {
|
|
; CHECK-LABEL: define double @test_1_25_minus_2_rn_d() {
|
|
; CHECK-NEXT: ret double -7.500000e-01
|
|
;
|
|
%res = call double @llvm.nvvm.add.rn.d(double 1.25, double -2.0)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_1_25_minus_2_rp_d() {
|
|
; CHECK-LABEL: define double @test_1_25_minus_2_rp_d() {
|
|
; CHECK-NEXT: ret double -7.500000e-01
|
|
;
|
|
%res = call double @llvm.nvvm.add.rp.d(double 1.25, double -2.0)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_1_25_minus_2_rz_d() {
|
|
; CHECK-LABEL: define double @test_1_25_minus_2_rz_d() {
|
|
; CHECK-NEXT: ret double -7.500000e-01
|
|
;
|
|
%res = call double @llvm.nvvm.add.rz.d(double 1.25, double -2.0)
|
|
ret double %res
|
|
}
|
|
|
|
define float @test_1_25_minus_2_rm_f() {
|
|
; CHECK-LABEL: define float @test_1_25_minus_2_rm_f() {
|
|
; CHECK-NEXT: ret float -7.500000e-01
|
|
;
|
|
%res = call float @llvm.nvvm.add.rm.f(float 1.25, float -2.0)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_25_minus_2_rn_f() {
|
|
; CHECK-LABEL: define float @test_1_25_minus_2_rn_f() {
|
|
; CHECK-NEXT: ret float -7.500000e-01
|
|
;
|
|
%res = call float @llvm.nvvm.add.rn.f(float 1.25, float -2.0)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_25_minus_2_rp_f() {
|
|
; CHECK-LABEL: define float @test_1_25_minus_2_rp_f() {
|
|
; CHECK-NEXT: ret float -7.500000e-01
|
|
;
|
|
%res = call float @llvm.nvvm.add.rp.f(float 1.25, float -2.0)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_25_minus_2_rz_f() {
|
|
; CHECK-LABEL: define float @test_1_25_minus_2_rz_f() {
|
|
; CHECK-NEXT: ret float -7.500000e-01
|
|
;
|
|
%res = call float @llvm.nvvm.add.rz.f(float 1.25, float -2.0)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_25_minus_2_rm_ftz_f() {
|
|
; CHECK-LABEL: define float @test_1_25_minus_2_rm_ftz_f() {
|
|
; CHECK-NEXT: ret float -7.500000e-01
|
|
;
|
|
%res = call float @llvm.nvvm.add.rm.ftz.f(float 1.25, float -2.0)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_25_minus_2_rn_ftz_f() {
|
|
; CHECK-LABEL: define float @test_1_25_minus_2_rn_ftz_f() {
|
|
; CHECK-NEXT: ret float -7.500000e-01
|
|
;
|
|
%res = call float @llvm.nvvm.add.rn.ftz.f(float 1.25, float -2.0)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_25_minus_2_rp_ftz_f() {
|
|
; CHECK-LABEL: define float @test_1_25_minus_2_rp_ftz_f() {
|
|
; CHECK-NEXT: ret float -7.500000e-01
|
|
;
|
|
%res = call float @llvm.nvvm.add.rp.ftz.f(float 1.25, float -2.0)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_25_minus_2_rz_ftz_f() {
|
|
; CHECK-LABEL: define float @test_1_25_minus_2_rz_ftz_f() {
|
|
; CHECK-NEXT: ret float -7.500000e-01
|
|
;
|
|
%res = call float @llvm.nvvm.add.rz.ftz.f(float 1.25, float -2.0)
|
|
ret float %res
|
|
}
|
|
|
|
;###############################################################
|
|
;# Add(0.0, NaN) #
|
|
;###############################################################
|
|
; Tests addition of a zero with NaN.
|
|
; The result is always NaN and the operation is not constant-folded.
|
|
|
|
define double @test_zero_plus_nan_rm_d() {
|
|
; CHECK-LABEL: define double @test_zero_plus_nan_rm_d() {
|
|
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.nvvm.add.rm.d(double 0.000000e+00, double +snan(0x4444400000000))
|
|
; CHECK-NEXT: ret double [[RES]]
|
|
;
|
|
%res = call double @llvm.nvvm.add.rm.d(double 0.0, double 0x7ff4444400000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_zero_plus_nan_rn_d() {
|
|
; CHECK-LABEL: define double @test_zero_plus_nan_rn_d() {
|
|
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.nvvm.add.rn.d(double 0.000000e+00, double +snan(0x4444400000000))
|
|
; CHECK-NEXT: ret double [[RES]]
|
|
;
|
|
%res = call double @llvm.nvvm.add.rn.d(double 0.0, double 0x7ff4444400000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_zero_plus_nan_rp_d() {
|
|
; CHECK-LABEL: define double @test_zero_plus_nan_rp_d() {
|
|
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.nvvm.add.rp.d(double 0.000000e+00, double +snan(0x4444400000000))
|
|
; CHECK-NEXT: ret double [[RES]]
|
|
;
|
|
%res = call double @llvm.nvvm.add.rp.d(double 0.0, double 0x7ff4444400000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_zero_plus_nan_rz_d() {
|
|
; CHECK-LABEL: define double @test_zero_plus_nan_rz_d() {
|
|
; CHECK-NEXT: [[RES:%.*]] = call double @llvm.nvvm.add.rz.d(double 0.000000e+00, double +snan(0x4444400000000))
|
|
; CHECK-NEXT: ret double [[RES]]
|
|
;
|
|
%res = call double @llvm.nvvm.add.rz.d(double 0.0, double 0x7ff4444400000000)
|
|
ret double %res
|
|
}
|
|
|
|
define float @test_zero_plus_nan_rm_f() {
|
|
; CHECK-LABEL: define float @test_zero_plus_nan_rm_f() {
|
|
; CHECK-NEXT: [[RES:%.*]] = call float @llvm.nvvm.add.rm.f(float 0.000000e+00, float +nan(0x3A2220))
|
|
; CHECK-NEXT: ret float [[RES]]
|
|
;
|
|
%res = call float @llvm.nvvm.add.rm.f(float 0.0, float 0x7FFF444400000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_zero_plus_nan_rn_f() {
|
|
; CHECK-LABEL: define float @test_zero_plus_nan_rn_f() {
|
|
; CHECK-NEXT: [[RES:%.*]] = call float @llvm.nvvm.add.rn.f(float 0.000000e+00, float +nan(0x3A2220))
|
|
; CHECK-NEXT: ret float [[RES]]
|
|
;
|
|
%res = call float @llvm.nvvm.add.rn.f(float 0.0, float 0x7FFF444400000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_zero_plus_nan_rp_f() {
|
|
; CHECK-LABEL: define float @test_zero_plus_nan_rp_f() {
|
|
; CHECK-NEXT: [[RES:%.*]] = call float @llvm.nvvm.add.rp.f(float 0.000000e+00, float +nan(0x3A2220))
|
|
; CHECK-NEXT: ret float [[RES]]
|
|
;
|
|
%res = call float @llvm.nvvm.add.rp.f(float 0.0, float 0x7FFF444400000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_zero_plus_nan_rz_f() {
|
|
; CHECK-LABEL: define float @test_zero_plus_nan_rz_f() {
|
|
; CHECK-NEXT: [[RES:%.*]] = call float @llvm.nvvm.add.rz.f(float 0.000000e+00, float +nan(0x3A2220))
|
|
; CHECK-NEXT: ret float [[RES]]
|
|
;
|
|
%res = call float @llvm.nvvm.add.rz.f(float 0.0, float 0x7FFF444400000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_zero_plus_nan_rm_ftz_f() {
|
|
; CHECK-LABEL: define float @test_zero_plus_nan_rm_ftz_f() {
|
|
; CHECK-NEXT: [[RES:%.*]] = call float @llvm.nvvm.add.rm.ftz.f(float 0.000000e+00, float +nan(0x3A2220))
|
|
; CHECK-NEXT: ret float [[RES]]
|
|
;
|
|
%res = call float @llvm.nvvm.add.rm.ftz.f(float 0.0, float 0x7FFF444400000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_zero_plus_nan_rn_ftz_f() {
|
|
; CHECK-LABEL: define float @test_zero_plus_nan_rn_ftz_f() {
|
|
; CHECK-NEXT: [[RES:%.*]] = call float @llvm.nvvm.add.rn.ftz.f(float 0.000000e+00, float +nan(0x3A2220))
|
|
; CHECK-NEXT: ret float [[RES]]
|
|
;
|
|
%res = call float @llvm.nvvm.add.rn.ftz.f(float 0.0, float 0x7FFF444400000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_zero_plus_nan_rp_ftz_f() {
|
|
; CHECK-LABEL: define float @test_zero_plus_nan_rp_ftz_f() {
|
|
; CHECK-NEXT: [[RES:%.*]] = call float @llvm.nvvm.add.rp.ftz.f(float 0.000000e+00, float +nan(0x3A2220))
|
|
; CHECK-NEXT: ret float [[RES]]
|
|
;
|
|
%res = call float @llvm.nvvm.add.rp.ftz.f(float 0.0, float 0x7FFF444400000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_zero_plus_nan_rz_ftz_f() {
|
|
; CHECK-LABEL: define float @test_zero_plus_nan_rz_ftz_f() {
|
|
; CHECK-NEXT: [[RES:%.*]] = call float @llvm.nvvm.add.rz.ftz.f(float 0.000000e+00, float +nan(0x3A2220))
|
|
; CHECK-NEXT: ret float [[RES]]
|
|
;
|
|
%res = call float @llvm.nvvm.add.rz.ftz.f(float 0.0, float 0x7FFF444400000000)
|
|
ret float %res
|
|
}
|
|
|
|
;###############################################################
|
|
;# Add(Subnormal, Subnormal) -> Normal #
|
|
;###############################################################
|
|
; Tests addition of two positive subnormal numbers (2^-127)
|
|
; - Without FTZ: The result is the sum of the subnormals (2^-126) - a normal number
|
|
; - With FTZ: The inputs are flushed to zero, so the result is zero (despite the output being normal)
|
|
|
|
define double @test_subnorm_plus_subnorm_to_normal_rm_d() {
|
|
; CHECK-LABEL: define double @test_subnorm_plus_subnorm_to_normal_rm_d() {
|
|
; CHECK-NEXT: ret double f0x3810000000000000
|
|
;
|
|
%res = call double @llvm.nvvm.add.rm.d(double 0x3800000000000000, double 0x3800000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_subnorm_plus_subnorm_to_normal_rn_d() {
|
|
; CHECK-LABEL: define double @test_subnorm_plus_subnorm_to_normal_rn_d() {
|
|
; CHECK-NEXT: ret double f0x3810000000000000
|
|
;
|
|
%res = call double @llvm.nvvm.add.rn.d(double 0x3800000000000000, double 0x3800000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_subnorm_plus_subnorm_to_normal_rp_d() {
|
|
; CHECK-LABEL: define double @test_subnorm_plus_subnorm_to_normal_rp_d() {
|
|
; CHECK-NEXT: ret double f0x3810000000000000
|
|
;
|
|
%res = call double @llvm.nvvm.add.rp.d(double 0x3800000000000000, double 0x3800000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_subnorm_plus_subnorm_to_normal_rz_d() {
|
|
; CHECK-LABEL: define double @test_subnorm_plus_subnorm_to_normal_rz_d() {
|
|
; CHECK-NEXT: ret double f0x3810000000000000
|
|
;
|
|
%res = call double @llvm.nvvm.add.rz.d(double 0x3800000000000000, double 0x3800000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define float @test_subnorm_plus_subnorm_to_normal_rm_f() {
|
|
; CHECK-LABEL: define float @test_subnorm_plus_subnorm_to_normal_rm_f() {
|
|
; CHECK-NEXT: ret float f0x00800000
|
|
;
|
|
%res = call float @llvm.nvvm.add.rm.f(float 0x3800000000000000, float 0x3800000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_subnorm_plus_subnorm_to_normal_rn_f() {
|
|
; CHECK-LABEL: define float @test_subnorm_plus_subnorm_to_normal_rn_f() {
|
|
; CHECK-NEXT: ret float f0x00800000
|
|
;
|
|
%res = call float @llvm.nvvm.add.rn.f(float 0x3800000000000000, float 0x3800000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_subnorm_plus_subnorm_to_normal_rp_f() {
|
|
; CHECK-LABEL: define float @test_subnorm_plus_subnorm_to_normal_rp_f() {
|
|
; CHECK-NEXT: ret float f0x00800000
|
|
;
|
|
%res = call float @llvm.nvvm.add.rp.f(float 0x3800000000000000, float 0x3800000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_subnorm_plus_subnorm_to_normal_rz_f() {
|
|
; CHECK-LABEL: define float @test_subnorm_plus_subnorm_to_normal_rz_f() {
|
|
; CHECK-NEXT: ret float f0x00800000
|
|
;
|
|
%res = call float @llvm.nvvm.add.rz.f(float 0x3800000000000000, float 0x3800000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_subnorm_plus_subnorm_to_normal_rm_ftz_f() {
|
|
; CHECK-LABEL: define float @test_subnorm_plus_subnorm_to_normal_rm_ftz_f() {
|
|
; CHECK-NEXT: ret float 0.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rm.ftz.f(float 0x3800000000000000, float 0x3800000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_subnorm_plus_subnorm_to_normal_rn_ftz_f() {
|
|
; CHECK-LABEL: define float @test_subnorm_plus_subnorm_to_normal_rn_ftz_f() {
|
|
; CHECK-NEXT: ret float 0.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rn.ftz.f(float 0x3800000000000000, float 0x3800000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_subnorm_plus_subnorm_to_normal_rp_ftz_f() {
|
|
; CHECK-LABEL: define float @test_subnorm_plus_subnorm_to_normal_rp_ftz_f() {
|
|
; CHECK-NEXT: ret float 0.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rp.ftz.f(float 0x3800000000000000, float 0x3800000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_subnorm_plus_subnorm_to_normal_rz_ftz_f() {
|
|
; CHECK-LABEL: define float @test_subnorm_plus_subnorm_to_normal_rz_ftz_f() {
|
|
; CHECK-NEXT: ret float 0.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rz.ftz.f(float 0x3800000000000000, float 0x3800000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
;###############################################################
|
|
;# Add(Normal, -Subnormal) -> Subnormal #
|
|
;###############################################################
|
|
; Tests addition of 2^-126 (the smallest normal number) and -(2^127).
|
|
; - Without FTZ: The result is correctly computed as a subnormal (2^127)
|
|
; - With FTZ: The result is flushed to zero.
|
|
; This verifies that the output is also flushed to zero, as we'd end up
|
|
; with 2^-126 if we only flushed the inputs.
|
|
|
|
define double @test_normal_minus_subnorm_to_subnorm_rm_d() {
|
|
; CHECK-LABEL: define double @test_normal_minus_subnorm_to_subnorm_rm_d() {
|
|
; CHECK-NEXT: ret double f0x3800000000000000
|
|
;
|
|
%res = call double @llvm.nvvm.add.rm.d(double 0x3810000000000000, double 0xB800000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_normal_minus_subnorm_to_subnorm_rn_d() {
|
|
; CHECK-LABEL: define double @test_normal_minus_subnorm_to_subnorm_rn_d() {
|
|
; CHECK-NEXT: ret double f0x3800000000000000
|
|
;
|
|
%res = call double @llvm.nvvm.add.rn.d(double 0x3810000000000000, double 0xB800000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_normal_minus_subnorm_to_subnorm_rp_d() {
|
|
; CHECK-LABEL: define double @test_normal_minus_subnorm_to_subnorm_rp_d() {
|
|
; CHECK-NEXT: ret double f0x3800000000000000
|
|
;
|
|
%res = call double @llvm.nvvm.add.rp.d(double 0x3810000000000000, double 0xB800000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_normal_minus_subnorm_to_subnorm_rz_d() {
|
|
; CHECK-LABEL: define double @test_normal_minus_subnorm_to_subnorm_rz_d() {
|
|
; CHECK-NEXT: ret double f0x3800000000000000
|
|
;
|
|
%res = call double @llvm.nvvm.add.rz.d(double 0x3810000000000000, double 0xB800000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define float @test_normal_minus_subnorm_to_subnorm_rm_f() {
|
|
; CHECK-LABEL: define float @test_normal_minus_subnorm_to_subnorm_rm_f() {
|
|
; CHECK-NEXT: ret float f0x00400000
|
|
;
|
|
%res = call float @llvm.nvvm.add.rm.f(float 0x3810000000000000, float 0xB800000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_normal_minus_subnorm_to_subnorm_rn_f() {
|
|
; CHECK-LABEL: define float @test_normal_minus_subnorm_to_subnorm_rn_f() {
|
|
; CHECK-NEXT: ret float f0x00400000
|
|
;
|
|
%res = call float @llvm.nvvm.add.rn.f(float 0x3810000000000000, float 0xB800000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_normal_minus_subnorm_to_subnorm_rp_f() {
|
|
; CHECK-LABEL: define float @test_normal_minus_subnorm_to_subnorm_rp_f() {
|
|
; CHECK-NEXT: ret float f0x00400000
|
|
;
|
|
%res = call float @llvm.nvvm.add.rp.f(float 0x3810000000000000, float 0xB800000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_normal_minus_subnorm_to_subnorm_rz_f() {
|
|
; CHECK-LABEL: define float @test_normal_minus_subnorm_to_subnorm_rz_f() {
|
|
; CHECK-NEXT: ret float f0x00400000
|
|
;
|
|
%res = call float @llvm.nvvm.add.rz.f(float 0x3810000000000000, float 0xB800000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_normal_minus_subnorm_to_subnorm_rm_ftz_f() {
|
|
; CHECK-LABEL: define float @test_normal_minus_subnorm_to_subnorm_rm_ftz_f() {
|
|
; CHECK-NEXT: ret float f0x00800000
|
|
;
|
|
%res = call float @llvm.nvvm.add.rm.ftz.f(float 0x3810000000000000, float 0xB800000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_normal_minus_subnorm_to_subnorm_rn_ftz_f() {
|
|
; CHECK-LABEL: define float @test_normal_minus_subnorm_to_subnorm_rn_ftz_f() {
|
|
; CHECK-NEXT: ret float f0x00800000
|
|
;
|
|
%res = call float @llvm.nvvm.add.rn.ftz.f(float 0x3810000000000000, float 0xB800000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_normal_minus_subnorm_to_subnorm_rp_ftz_f() {
|
|
; CHECK-LABEL: define float @test_normal_minus_subnorm_to_subnorm_rp_ftz_f() {
|
|
; CHECK-NEXT: ret float 0.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rp.ftz.f(float 0x3800000000000000, float 0x3800000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_normal_minus_subnorm_to_subnorm_rz_ftz_f() {
|
|
; CHECK-LABEL: define float @test_normal_minus_subnorm_to_subnorm_rz_ftz_f() {
|
|
; CHECK-NEXT: ret float 0.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rz.ftz.f(float 0x3800000000000000, float 0x3800000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
;###############################################################
|
|
;# Add(1.0, 2^(-25)) #
|
|
;###############################################################
|
|
; Tests addition of 1.0 and 2^(-25) where the exact result falls between
|
|
; 1.0 and 1.0 + 2^(-23):
|
|
; - RN, RZ, RM: Return 1.0 (rounding toward nearest/zero/down)
|
|
; - RP: Returns 1.0 + 2^(-23) (rounding up)
|
|
|
|
define float @test_1_plus_ulp_rm_f() {
|
|
; CHECK-LABEL: define float @test_1_plus_ulp_rm_f() {
|
|
; CHECK-NEXT: ret float 1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rm.f(float 1.0, float 0x3E60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_plus_ulp_rn_f() {
|
|
; CHECK-LABEL: define float @test_1_plus_ulp_rn_f() {
|
|
; CHECK-NEXT: ret float 1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rn.f(float 1.0, float 0x3E60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_plus_ulp_rp_f() {
|
|
; CHECK-LABEL: define float @test_1_plus_ulp_rp_f() {
|
|
; CHECK-NEXT: ret float f0x3F800001
|
|
;
|
|
%res = call float @llvm.nvvm.add.rp.f(float 1.0, float 0x3E60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_plus_ulp_rz_f() {
|
|
; CHECK-LABEL: define float @test_1_plus_ulp_rz_f() {
|
|
; CHECK-NEXT: ret float 1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rz.f(float 1.0, float 0x3E60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_plus_ulp_rm_ftz_f() {
|
|
; CHECK-LABEL: define float @test_1_plus_ulp_rm_ftz_f() {
|
|
; CHECK-NEXT: ret float 1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rm.ftz.f(float 1.0, float 0x3E60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_plus_ulp_rn_ftz_f() {
|
|
; CHECK-LABEL: define float @test_1_plus_ulp_rn_ftz_f() {
|
|
; CHECK-NEXT: ret float 1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rn.ftz.f(float 1.0, float 0x3E60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_plus_ulp_rp_ftz_f() {
|
|
; CHECK-LABEL: define float @test_1_plus_ulp_rp_ftz_f() {
|
|
; CHECK-NEXT: ret float f0x3F800001
|
|
;
|
|
%res = call float @llvm.nvvm.add.rp.ftz.f(float 1.0, float 0x3E60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_plus_ulp_rz_ftz_f() {
|
|
; CHECK-LABEL: define float @test_1_plus_ulp_rz_ftz_f() {
|
|
; CHECK-NEXT: ret float 1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rz.ftz.f(float 1.0, float 0x3E60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
;###############################################################
|
|
;# Add(1.0, 2^(-54)) #
|
|
;###############################################################
|
|
; Tests addition of 1.0 and 2^(-54) where the exact result falls between
|
|
; 1.0 and 1.0 + 2^(-52):
|
|
; - RN, RZ, RM: Return 1.0 (rounding to nearest/zero/down)
|
|
; - RP: Returns 1.0 + 2^(-52) (rounding up)
|
|
|
|
define double @test_1_plus_ulp_rm_d() {
|
|
; CHECK-LABEL: define double @test_1_plus_ulp_rm_d() {
|
|
; CHECK-NEXT: ret double 1.000000e+00
|
|
;
|
|
%res = call double @llvm.nvvm.add.rm.d(double 1.0, double 0x3C90000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_1_plus_ulp_rn_d() {
|
|
; CHECK-LABEL: define double @test_1_plus_ulp_rn_d() {
|
|
; CHECK-NEXT: ret double 1.000000e+00
|
|
;
|
|
%res = call double @llvm.nvvm.add.rn.d(double 1.0, double 0x3C90000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_1_plus_ulp_rp_d() {
|
|
; CHECK-LABEL: define double @test_1_plus_ulp_rp_d() {
|
|
; CHECK-NEXT: ret double f0x3FF0000000000001
|
|
;
|
|
%res = call double @llvm.nvvm.add.rp.d(double 1.0, double 0x3C90000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_1_plus_ulp_rz_d() {
|
|
; CHECK-LABEL: define double @test_1_plus_ulp_rz_d() {
|
|
; CHECK-NEXT: ret double 1.000000e+00
|
|
;
|
|
%res = call double @llvm.nvvm.add.rz.d(double 1.0, double 0x3C90000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
;###############################################################
|
|
;# Add(-1.0, 2^(-25)) #
|
|
;###############################################################
|
|
; Tests addition of -1.0 and 2^(-25)) where the exact result falls between
|
|
; -1.0 and -1.0 + 2^(-23):
|
|
; - RN, RM: Returns -1.0 (rounding toward nearest/down)
|
|
; - RZ, RP: Return -1.0 + 2^(-23) (rounding toward zero/up)
|
|
|
|
define float @test_neg_1_plus_ulp_rm_f() {
|
|
; CHECK-LABEL: define float @test_neg_1_plus_ulp_rm_f() {
|
|
; CHECK-NEXT: ret float -1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rm.f(float -1.0, float 0x3E60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_neg_1_plus_ulp_rn_f() {
|
|
; CHECK-LABEL: define float @test_neg_1_plus_ulp_rn_f() {
|
|
; CHECK-NEXT: ret float -1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rn.f(float -1.0, float 0x3E60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_neg_1_plus_ulp_rp_f() {
|
|
; CHECK-LABEL: define float @test_neg_1_plus_ulp_rp_f() {
|
|
; CHECK-NEXT: ret float f0xBF7FFFFF
|
|
;
|
|
%res = call float @llvm.nvvm.add.rp.f(float -1.0, float 0x3E60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_neg_1_plus_ulp_rz_f() {
|
|
; CHECK-LABEL: define float @test_neg_1_plus_ulp_rz_f() {
|
|
; CHECK-NEXT: ret float f0xBF7FFFFF
|
|
;
|
|
%res = call float @llvm.nvvm.add.rz.f(float -1.0, float 0x3E60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_neg_1_plus_ulp_rm_ftz_f() {
|
|
; CHECK-LABEL: define float @test_neg_1_plus_ulp_rm_ftz_f() {
|
|
; CHECK-NEXT: ret float -1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rm.ftz.f(float -1.0, float 0x3E60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_neg_1_plus_ulp_rn_ftz_f() {
|
|
; CHECK-LABEL: define float @test_neg_1_plus_ulp_rn_ftz_f() {
|
|
; CHECK-NEXT: ret float -1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rn.ftz.f(float -1.0, float 0x3E60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_neg_1_plus_ulp_rp_ftz_f() {
|
|
; CHECK-LABEL: define float @test_neg_1_plus_ulp_rp_ftz_f() {
|
|
; CHECK-NEXT: ret float f0xBF7FFFFF
|
|
;
|
|
%res = call float @llvm.nvvm.add.rp.ftz.f(float -1.0, float 0x3E60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_neg_1_plus_ulp_rz_ftz_f() {
|
|
; CHECK-LABEL: define float @test_neg_1_plus_ulp_rz_ftz_f() {
|
|
; CHECK-NEXT: ret float f0xBF7FFFFF
|
|
;
|
|
%res = call float @llvm.nvvm.add.rz.ftz.f(float -1.0, float 0x3E60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
;###############################################################
|
|
;# Add(-1.0, 2^(-54)) #
|
|
;###############################################################
|
|
; Tests addition of -1.0 and 2^(-54) where the exact result falls between
|
|
; -1.0 and -1.0 + 2^(-52):
|
|
; - RN, RM: Return -1.0 (rounding toward nearest/down)
|
|
; - RZ, RP: Return -1.0 + 2^(-52) (rounding toward zero/up)
|
|
|
|
define double @test_neg_1_plus_ulp_rm_d() {
|
|
; CHECK-LABEL: define double @test_neg_1_plus_ulp_rm_d() {
|
|
; CHECK-NEXT: ret double -1.000000e+00
|
|
;
|
|
%res = call double @llvm.nvvm.add.rm.d(double -1.0, double 0x3C90000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_neg_1_plus_ulp_rn_d() {
|
|
; CHECK-LABEL: define double @test_neg_1_plus_ulp_rn_d() {
|
|
; CHECK-NEXT: ret double -1.000000e+00
|
|
;
|
|
%res = call double @llvm.nvvm.add.rn.d(double -1.0, double 0x3C90000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_neg_1_plus_ulp_rp_d() {
|
|
; CHECK-LABEL: define double @test_neg_1_plus_ulp_rp_d() {
|
|
; CHECK-NEXT: ret double f0xBFEFFFFFFFFFFFFF
|
|
;
|
|
%res = call double @llvm.nvvm.add.rp.d(double -1.0, double 0x3C90000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_neg_1_plus_ulp_rz_d() {
|
|
; CHECK-LABEL: define double @test_neg_1_plus_ulp_rz_d() {
|
|
; CHECK-NEXT: ret double f0xBFEFFFFFFFFFFFFF
|
|
;
|
|
%res = call double @llvm.nvvm.add.rz.d(double -1.0, double 0x3C90000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
;###############################################################
|
|
;# Add(1.0, -2^(-25)) #
|
|
;###############################################################
|
|
; Tests addition of 1.0 and -2^(-25) where the exact result falls between
|
|
; 1.0 and 1.0 - 2^(-23):
|
|
; - RN, RP: Return 1.0 (rounding toward nearest/up)
|
|
; - RZ, RM: Return 1.0 - 2^(-23) (rounding toward zero/down)
|
|
|
|
define float @test_1_minus_ulp_rm_f() {
|
|
; CHECK-LABEL: define float @test_1_minus_ulp_rm_f() {
|
|
; CHECK-NEXT: ret float f0x3F7FFFFF
|
|
;
|
|
%res = call float @llvm.nvvm.add.rm.f(float 1.0, float 0xBE60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_minus_ulp_rn_f() {
|
|
; CHECK-LABEL: define float @test_1_minus_ulp_rn_f() {
|
|
; CHECK-NEXT: ret float 1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rn.f(float 1.0, float 0xBE60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_minus_ulp_rp_f() {
|
|
; CHECK-LABEL: define float @test_1_minus_ulp_rp_f() {
|
|
; CHECK-NEXT: ret float 1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rp.f(float 1.0, float 0xBE60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_minus_ulp_rz_f() {
|
|
; CHECK-LABEL: define float @test_1_minus_ulp_rz_f() {
|
|
; CHECK-NEXT: ret float f0x3F7FFFFF
|
|
;
|
|
%res = call float @llvm.nvvm.add.rz.f(float 1.0, float 0xBE60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_minus_ulp_rm_ftz_f() {
|
|
; CHECK-LABEL: define float @test_1_minus_ulp_rm_ftz_f() {
|
|
; CHECK-NEXT: ret float f0x3F7FFFFF
|
|
;
|
|
%res = call float @llvm.nvvm.add.rm.ftz.f(float 1.0, float 0xBE60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_minus_ulp_rn_ftz_f() {
|
|
; CHECK-LABEL: define float @test_1_minus_ulp_rn_ftz_f() {
|
|
; CHECK-NEXT: ret float 1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rn.ftz.f(float 1.0, float 0xBE60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_minus_ulp_rp_ftz_f() {
|
|
; CHECK-LABEL: define float @test_1_minus_ulp_rp_ftz_f() {
|
|
; CHECK-NEXT: ret float 1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rp.ftz.f(float 1.0, float 0xBE60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_1_minus_ulp_rz_ftz_f() {
|
|
; CHECK-LABEL: define float @test_1_minus_ulp_rz_ftz_f() {
|
|
; CHECK-NEXT: ret float f0x3F7FFFFF
|
|
;
|
|
%res = call float @llvm.nvvm.add.rz.ftz.f(float 1.0, float 0xBE60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
;###############################################################
|
|
;# Add(1.0, -2^(-54)) #
|
|
;###############################################################
|
|
; Tests addition of 1.0 and -2^(-54) where the exact result falls between
|
|
; 1.0 and 1.0 - 2^(-52):
|
|
; - RN, RP: Return 1.0 (rounding toward nearest/up)
|
|
; - RZ, RM: Return 1.0 - 2^(-52) (rounding toward zero/down)
|
|
|
|
define double @test_1_minus_ulp_rm_d() {
|
|
; CHECK-LABEL: define double @test_1_minus_ulp_rm_d() {
|
|
; CHECK-NEXT: ret double f0x3FEFFFFFFFFFFFFF
|
|
;
|
|
%res = call double @llvm.nvvm.add.rm.d(double 1.0, double 0xBC90000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_1_minus_ulp_rn_d() {
|
|
; CHECK-LABEL: define double @test_1_minus_ulp_rn_d() {
|
|
; CHECK-NEXT: ret double 1.000000e+00
|
|
;
|
|
%res = call double @llvm.nvvm.add.rn.d(double 1.0, double 0xBC90000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_1_minus_ulp_rp_d() {
|
|
; CHECK-LABEL: define double @test_1_minus_ulp_rp_d() {
|
|
; CHECK-NEXT: ret double 1.000000e+00
|
|
;
|
|
%res = call double @llvm.nvvm.add.rp.d(double 1.0, double 0xBC90000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_1_minus_ulp_rz_d() {
|
|
; CHECK-LABEL: define double @test_1_minus_ulp_rz_d() {
|
|
; CHECK-NEXT: ret double f0x3FEFFFFFFFFFFFFF
|
|
;
|
|
%res = call double @llvm.nvvm.add.rz.d(double 1.0, double 0xBC90000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
;###############################################################
|
|
;# Add(-1.0, -2^(-25)) #
|
|
;###############################################################
|
|
; Tests addition of -1.0 and -2^(-25) where the exact result falls between
|
|
; -1.0 and -1.0 - 2^(-23):
|
|
; - RN, RZ, RP: Return -1.0 (rounding to nearest/zero/up)
|
|
; - RM: Return -1.0 - 2^(-23) (rounding down)
|
|
|
|
define float @test_neg_1_minus_ulp_rm_f() {
|
|
; CHECK-LABEL: define float @test_neg_1_minus_ulp_rm_f() {
|
|
; CHECK-NEXT: ret float f0xBF800001
|
|
;
|
|
%res = call float @llvm.nvvm.add.rm.f(float -1.0, float 0xBE60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_neg_1_minus_ulp_rn_f() {
|
|
; CHECK-LABEL: define float @test_neg_1_minus_ulp_rn_f() {
|
|
; CHECK-NEXT: ret float -1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rn.f(float -1.0, float 0xBE60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_neg_1_minus_ulp_rp_f() {
|
|
; CHECK-LABEL: define float @test_neg_1_minus_ulp_rp_f() {
|
|
; CHECK-NEXT: ret float -1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rp.f(float -1.0, float 0xBE60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_neg_1_minus_ulp_rz_f() {
|
|
; CHECK-LABEL: define float @test_neg_1_minus_ulp_rz_f() {
|
|
; CHECK-NEXT: ret float -1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rz.f(float -1.0, float 0xBE60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_neg_1_minus_ulp_rm_ftz_f() {
|
|
; CHECK-LABEL: define float @test_neg_1_minus_ulp_rm_ftz_f() {
|
|
; CHECK-NEXT: ret float f0xBF800001
|
|
;
|
|
%res = call float @llvm.nvvm.add.rm.ftz.f(float -1.0, float 0xBE60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_neg_1_minus_ulp_rn_ftz_f() {
|
|
; CHECK-LABEL: define float @test_neg_1_minus_ulp_rn_ftz_f() {
|
|
; CHECK-NEXT: ret float -1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rn.ftz.f(float -1.0, float 0xBE60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_neg_1_minus_ulp_rp_ftz_f() {
|
|
; CHECK-LABEL: define float @test_neg_1_minus_ulp_rp_ftz_f() {
|
|
; CHECK-NEXT: ret float -1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rp.ftz.f(float -1.0, float 0xBE60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
define float @test_neg_1_minus_ulp_rz_ftz_f() {
|
|
; CHECK-LABEL: define float @test_neg_1_minus_ulp_rz_ftz_f() {
|
|
; CHECK-NEXT: ret float -1.000000e+00
|
|
;
|
|
%res = call float @llvm.nvvm.add.rz.ftz.f(float -1.0, float 0xBE60000000000000)
|
|
ret float %res
|
|
}
|
|
|
|
;###############################################################
|
|
;# Add(-1.0, -2^(-54)) #
|
|
;###############################################################
|
|
; Tests addition of -1.0 and -2^(-54) where the exact result falls between
|
|
; -1.0 and -1.0 - 2^(-52):
|
|
; - RN, RZ, RP: Return -1.0 (rounding to nearest/zero/up)
|
|
; - RM: Return -1.0 - 2^(-52) (rounding down)
|
|
|
|
define double @test_neg_1_minus_ulp_rm_d() {
|
|
; CHECK-LABEL: define double @test_neg_1_minus_ulp_rm_d() {
|
|
; CHECK-NEXT: ret double f0xBFF0000000000001
|
|
;
|
|
%res = call double @llvm.nvvm.add.rm.d(double -1.0, double 0xBC90000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_neg_1_minus_ulp_rn_d() {
|
|
; CHECK-LABEL: define double @test_neg_1_minus_ulp_rn_d() {
|
|
; CHECK-NEXT: ret double -1.000000e+00
|
|
;
|
|
%res = call double @llvm.nvvm.add.rn.d(double -1.0, double 0xBC90000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_neg_1_minus_ulp_rp_d() {
|
|
; CHECK-LABEL: define double @test_neg_1_minus_ulp_rp_d() {
|
|
; CHECK-NEXT: ret double -1.000000e+00
|
|
;
|
|
%res = call double @llvm.nvvm.add.rp.d(double -1.0, double 0xBC90000000000000)
|
|
ret double %res
|
|
}
|
|
|
|
define double @test_neg_1_minus_ulp_rz_d() {
|
|
; CHECK-LABEL: define double @test_neg_1_minus_ulp_rz_d() {
|
|
; CHECK-NEXT: ret double -1.000000e+00
|
|
;
|
|
%res = call double @llvm.nvvm.add.rz.d(double -1.0, double 0xBC90000000000000)
|
|
ret double %res
|
|
}
|