diff --git a/flang/module/cudadevice.f90 b/flang/module/cudadevice.f90 index 262a8d09ff7df..28577ee495368 100644 --- a/flang/module/cudadevice.f90 +++ b/flang/module/cudadevice.f90 @@ -709,6 +709,34 @@ attributes(device) real(8) function sinpi(x) bind(c,name='__nv_sinpi') end function end interface + interface __ull2float_rd + attributes(device) real function __ull2float_rd(i) bind(c, name='__nv_ull2float_rd') + !dir$ ignore_tkr (d) i + integer(8), value :: i + end function + end interface + + interface __ull2float_rn + attributes(device) real function __ull2float_rn(i) bind(c, name='__nv_ull2float_rn') + !dir$ ignore_tkr (d) i + integer(8), value :: i + end function + end interface + + interface __ull2float_ru + attributes(device) real function __ull2float_ru(i) bind(c, name='__nv_ull2float_ru') + !dir$ ignore_tkr (d) i + integer(8), value :: i + end function + end interface + + interface __ull2float_rz + attributes(device) real function __ull2float_rz(i) bind(c, name='__nv_ull2float_rz') + !dir$ ignore_tkr (d) i + integer(8), value :: i + end function + end interface + interface __mul24 attributes(device) integer function __mul24(i,j) bind(c, name='__nv_mul24') !dir$ ignore_tkr (d) i, (d) j diff --git a/flang/test/Lower/CUDA/cuda-libdevice.cuf b/flang/test/Lower/CUDA/cuda-libdevice.cuf index a1592c036d2fe..06515b1c5f6df 100644 --- a/flang/test/Lower/CUDA/cuda-libdevice.cuf +++ b/flang/test/Lower/CUDA/cuda-libdevice.cuf @@ -20,6 +20,21 @@ end subroutine ! CHECK-LABEL: _QPtest_usad ! CHECK: %{{.*}} = fir.call @__nv_usad(%{{.*}}, %{{.*}}, %{{.*}}) proc_attrs fastmath : (i32, i32, i32) -> i32 +attributes(global) subroutine test_ull2dloat_rX() + real :: res + integer(8) :: i + res = __ull2float_rd(i) + res = __ull2float_rn(i) + res = __ull2float_ru(i) + res = __ull2float_rz(i) +end subroutine + +! CHECK-LABEL: _QPtest_ull2dloat_rx +! CHECK: %{{.*}} = fir.call @__nv_ull2float_rd(%{{.*}}) proc_attrs fastmath : (i64) -> f32 +! CHECK: %{{.*}} = fir.call @__nv_ull2float_rn(%{{.*}}) proc_attrs fastmath : (i64) -> f32 +! CHECK: %{{.*}} = fir.call @__nv_ull2float_ru(%{{.*}}) proc_attrs fastmath : (i64) -> f32 +! CHECK: %{{.*}} = fir.call @__nv_ull2float_rz(%{{.*}}) proc_attrs fastmath : (i64) -> f32 + attributes(global) subroutine test_log() real :: res real :: r @@ -50,4 +65,3 @@ end subroutine ! CHECK-LABEL: _QPtest_tanf ! CHECK: %{{.*}} = fir.call @__nv_tanf(%{{.*}}) proc_attrs fastmath : (f32) -> f32 -