195 lines · plain
1! RUN: bbc -emit-hlfir -fcuda %s -o - | FileCheck %s2 3module mod14 type retf5 real :: inf, sup, near, zero 6 end type retf7 type retd8 real(8) :: inf, sup, near, zero 9 end type retd10contains11 attributes(global) subroutine fadd(c, a, b)12 real(4) :: a, b13 type (retf) :: c14 c%near = __fadd_rn(a, b)15 c%zero = __fadd_rz(a, b)16 c%inf = __fadd_rd(a, b)17 c%sup = __fadd_ru(a, b)18 end subroutine19 attributes(global) subroutine dadd(c, a, b)20 real(8) :: a, b21 type (retd) :: c22 c%near = __dadd_rn(a, b)23 c%zero = __dadd_rz(a, b)24 c%inf = __dadd_rd(a, b)25 c%sup = __dadd_ru(a, b)26 end subroutine27 attributes(global) subroutine fmul(c, a, b)28 real(4) :: a, b29 type (retf) :: c30 c%near = __fmul_rn(a, b)31 c%zero = __fmul_rz(a, b)32 c%inf = __fmul_rd(a, b)33 c%sup = __fmul_ru(a, b)34 end subroutine35 attributes(global) subroutine dmul(c, a, b)36 real(8) :: a, b37 type (retf) :: c38 c%near = __dmul_rn(a, b)39 c%zero = __dmul_rz(a, b)40 c%inf = __dmul_rd(a, b)41 c%sup = __dmul_ru(a, b)42 end subroutine43 attributes(global) subroutine fmaf(c, a, b)44 real(4) :: a, b45 type (retf) :: c46 c%near = __fmaf_rn(a, b, b)47 c%zero = __fmaf_rz(a, b, b)48 c%inf = __fmaf_rd(a, b, b)49 c%sup = __fmaf_ru(a, b, b)50 end subroutine51 attributes(global) subroutine fma(c, a, b)52 real(8) :: a, b53 type (retd) :: c54 c%near = __fma_rn(a, b, b)55 c%zero = __fma_rz(a, b, b)56 c%inf = __fma_rd(a, b, b)57 c%sup = __fma_ru(a, b, b)58 end subroutine59 attributes(global) subroutine frcp(c,a)60 real(4) :: a61 type (retf) :: c62 c%near = __frcp_rn(a)63 c%zero = __frcp_rz(a)64 c%inf = __frcp_rd(a)65 c%sup = __frcp_ru(a)66 end subroutine67 attributes(global) subroutine fsqrt(c,a)68 real(4) :: a69 type (retf) :: c70 c%near = __fsqrt_rn(a)71 c%zero = __fsqrt_rz(a)72 c%inf = __fsqrt_rd(a)73 c%sup = __fsqrt_ru(a)74 end subroutine75 attributes(global) subroutine fdiv(c, a, b)76 real(4) :: a, b77 type (retf) :: c78 c%near = __fdiv_rn(a, b)79 c%zero = __fdiv_rz(a, b)80 c%inf = __fdiv_rd(a, b)81 c%sup = __fdiv_ru(a, b)82 end subroutine83 attributes(global) subroutine testsincosf(c, a, b)84 real(4) :: a, b, c85 call sincos(a, b, c)86 end subroutine87 attributes(global) subroutine testsincosd(c, a, b)88 real(8) :: a, b, c89 call sincos(a, b, c)90 end subroutine91 attributes(global) subroutine testsincospif(c, a, b)92 real(4) :: a, b, c93 call sincospi(a, b, c)94 end subroutine95 attributes(global) subroutine testsincospid(c, a, b)96 real(8) :: a, b, c97 call sincospi(a, b, c)98 end subroutine99 attributes(global) subroutine testmulhi(c, a, b)100 integer(4) :: a, b, c101 c = __mulhi(a, b)102 end subroutine103 attributes(global) subroutine testumulhi(c, a, b)104 integer(4) :: a, b, c105 c = __umulhi(a, b)106 end subroutine107 attributes(global) subroutine testmul64hi(c, a, b)108 integer(8) :: a, b, c109 c = __mul64hi(a, b)110 end subroutine111 attributes(global) subroutine testumul64hi(c, a, b)112 integer(8) :: a, b, c113 c = __umul64hi(a, b)114 end subroutine115 116end117 118! CHECK-LABEL: func.func @_QMmod1Pfadd119! CHECK: fir.call @__nv_fadd_rn120! CHECK: fir.call @__nv_fadd_rz121! CHECK: fir.call @__nv_fadd_rd122! CHECK: fir.call @__nv_fadd_ru123 124! CHECK-LABEL: func.func @_QMmod1Pdadd125! CHECK: fir.call @__nv_dadd_rn126! CHECK: fir.call @__nv_dadd_rz127! CHECK: fir.call @__nv_dadd_rd128! CHECK: fir.call @__nv_dadd_ru129 130! CHECK-LABEL: func.func @_QMmod1Pfmul131! CHECK: fir.call @__nv_fmul_rn132! CHECK: fir.call @__nv_fmul_rz133! CHECK: fir.call @__nv_fmul_rd134! CHECK: fir.call @__nv_fmul_ru135 136! CHECK-LABEL: func.func @_QMmod1Pdmul137! CHECK: fir.call @__nv_dmul_rn138! CHECK: fir.call @__nv_dmul_rz139! CHECK: fir.call @__nv_dmul_rd140! CHECK: fir.call @__nv_dmul_ru141 142! CHECK-LABEL: func.func @_QMmod1Pfmaf143! CHECK: fir.call @__nv_fmaf_rn144! CHECK: fir.call @__nv_fmaf_rz145! CHECK: fir.call @__nv_fmaf_rd146! CHECK: fir.call @__nv_fmaf_ru147 148! CHECK-LABEL: func.func @_QMmod1Pfma149! CHECK: fir.call @__nv_fma_rn150! CHECK: fir.call @__nv_fma_rz151! CHECK: fir.call @__nv_fma_rd152! CHECK: fir.call @__nv_fma_ru153 154! CHECK-LABEL: func.func @_QMmod1Pfrcp155! CHECK: fir.call @__nv_frcp_rn156! CHECK: fir.call @__nv_frcp_rz157! CHECK: fir.call @__nv_frcp_rd158! CHECK: fir.call @__nv_frcp_ru159 160! CHECK-LABEL: func.func @_QMmod1Pfsqrt161! CHECK: fir.call @__nv_fsqrt_rn162! CHECK: fir.call @__nv_fsqrt_rz163! CHECK: fir.call @__nv_fsqrt_rd164! CHECK: fir.call @__nv_fsqrt_ru165 166! CHECK-LABEL: func.func @_QMmod1Pfdiv167! CHECK: fir.call @__nv_fdiv_rn168! CHECK: fir.call @__nv_fdiv_rz169! CHECK: fir.call @__nv_fdiv_rd170! CHECK: fir.call @__nv_fdiv_ru171 172! CHECK-LABEL: func.func @_QMmod1Ptestsincosf173! CHECK: fir.call @__nv_sincosf174 175! CHECK-LABEL: func.func @_QMmod1Ptestsincosd176! CHECK: fir.call @__nv_sincos177 178! CHECK-LABEL: func.func @_QMmod1Ptestsincospif179! CHECK: fir.call @__nv_sincospif180 181! CHECK-LABEL: func.func @_QMmod1Ptestsincospid182! CHECK: fir.call @__nv_sincospi183 184! CHECK-LABEL: func.func @_QMmod1Ptestmulhi185! CHECK: fir.call @__nv_mulhi186 187! CHECK-LABEL: func.func @_QMmod1Ptestumulhi188! CHECK: fir.call @__nv_umulhi189 190! CHECK-LABEL: func.func @_QMmod1Ptestmul64hi191! CHECK: fir.call @__nv_mul64hi192 193! CHECK-LABEL: func.func @_QMmod1Ptestumul64hi194! CHECK: fir.call @__nv_umul64hi195