177 lines · plain
1! RUN: %flang_fc1 -flang-experimental-hlfir -emit-llvm %s -o - | FileCheck --check-prefixes="LLVMIR" %s2! REQUIRES: target=powerpc{{.*}}3 4! CHECK-LABEL: fmadd_testr5subroutine fmadd_testr(a, x, y)6 real :: a, x, y, z7 z = fmadd(a, x, y)8! LLVMIR: call contract float @llvm.fma.f32(float %{{[0-9]}}, float %{{[0-9]}}, float %{{[0-9]}})9end10 11! CHECK-LABEL: fmadd_testd12subroutine fmadd_testd(a, x, y)13 real(8) :: a, x, y, z14 z = fmadd(a, x, y)15! LLVMIR: call contract double @llvm.fma.f64(double %{{[0-9]}}, double %{{[0-9]}}, double %{{[0-9]}})16end17 18! CHECK-LABEL: fnmadd_testr19subroutine fnmadd_testr(a, x, y)20 real :: a, x, y, z21 z = fnmadd(a, x, y)22! LLVMIR: call contract float @llvm.ppc.fnmadds(float %{{[0-9]}}, float %{{[0-9]}}, float %{{[0-9]}})23end24 25! CHECK-LABEL: fnmadd_testd26subroutine fnmadd_testd(a, x, y)27 real(8) :: a, x, y, z28 z = fnmadd(a, x, y)29! LLVMIR: call contract double @llvm.ppc.fnmadd(double %{{[0-9]}}, double %{{[0-9]}}, double %{{[0-9]}})30end31 32! CHECK-LABEL: fmsub_testr33subroutine fmsub_testr(a, x, y)34 real :: a, x, y, z35 z = fmsub(a, x, y)36! LLVMIR: call contract float @llvm.ppc.fmsubs(float %{{[0-9]}}, float %{{[0-9]}}, float %{{[0-9]}})37end38 39! CHECK-LABEL: fmsub_testd40subroutine fmsub_testd(a, x, y)41 real(8) :: a, x, y, z42 z = fmsub(a, x, y)43! LLVMIR: call contract double @llvm.ppc.fmsub(double %{{[0-9]}}, double %{{[0-9]}}, double %{{[0-9]}})44end45 46! CHECK-LABEL: fnmsub_testr47subroutine fnmsub_testr(a, x, y)48 real :: a, x, y, z49 z = fnmsub(a, x, y)50! LLVMIR: call contract float @llvm.ppc.fnmsub.f32(float %{{[0-9]}}, float %{{[0-9]}}, float %{{[0-9]}})51end52 53! CHECK-LABEL: fnmsub_testd54subroutine fnmsub_testd(a, x, y)55 real(8) :: a, x, y, z56 z = fnmsub(a, x, y)57! LLVMIR: call contract double @llvm.ppc.fnmsub.f64(double %{{[0-9]}}, double %{{[0-9]}}, double %{{[0-9]}})58end59 60! CHECK-LABEL: fctid_test61subroutine fctid_test(x)62 real(8) :: x, r63 r = fctid(x)64! LLVMIR: call contract double @llvm.ppc.fctid(double %{{[0-9]}})65end66 67! CHECK-LABEL: fctidz_test68subroutine fctidz_test(x)69 real(8) :: x, r70 r = fctidz(x)71! LLVMIR: call contract double @llvm.ppc.fctidz(double %{{[0-9]}})72end73 74! CHECK-LABEL: fctiw_test75subroutine fctiw_test(x)76 real(8) :: x, r77 r = fctiw(x)78! LLVMIR: call contract double @llvm.ppc.fctiw(double %{{[0-9]}})79end80 81! CHECK-LABEL: fctiwz_test82subroutine fctiwz_test(x)83 real(8) :: x, r84 r = fctiwz(x)85! LLVMIR: call contract double @llvm.ppc.fctiwz(double %{{[0-9]}})86end87 88! CHECK-LABEL: fctudz_test89subroutine fctudz_test(x)90 real(8) :: x, r91 r = fctudz(x)92! LLVMIR: call contract double @llvm.ppc.fctudz(double %{{[0-9]}})93end94 95! CHECK-LABEL: fctuwz_test96subroutine fctuwz_test(x)97 real(8) :: x, r98 r = fctuwz(x)99! LLVMIR: call contract double @llvm.ppc.fctuwz(double %{{[0-9]}})100end101 102! CHECK-LABEL: fcfi_test103subroutine fcfi_test(i)104 real(8) :: i, r105 r = fcfi(i)106! LLVMIR: call contract double @llvm.ppc.fcfid(double %{{[0-9]}})107end108 109! CHECK-LABEL: fcfid_test110subroutine fcfid_test(i)111 real(8) :: i, r112 r = fcfid(i)113! LLVMIR: call contract double @llvm.ppc.fcfid(double %{{[0-9]}})114end115 116! CHECK-LABEL: fcfud_test117subroutine fcfud_test(i)118 real(8) :: i, r119 r = fcfud(i)120! LLVMIR: call contract double @llvm.ppc.fcfud(double %{{[0-9]}})121end122 123! CHECK-LABEL: fnabs_testr(x)124subroutine fnabs_testr(x)125 real :: x, y126 y = fnabs(x)127! LLVMIR: call contract float @llvm.ppc.fnabss(float %{{[0-9]}})128end129 130! CHECK-LABEL: fnabs_testd(x)131subroutine fnabs_testd(x)132 real(8) :: x, y133 y = fnabs(x)134! LLVMIR: call contract double @llvm.ppc.fnabs(double %{{[0-9]}})135end136 137!CHECK-LABEL: fre_test(x)138subroutine fre_test(x)139 real(8) :: x, y140 y = fre(x)141! LLVMIR: call contract double @llvm.ppc.fre(double %{{[0-9]}})142end143 144!CHECK-LABEL: fres_test(x)145subroutine fres_test(x)146 real :: x, y147 y = fres(x)148! LLVMIR: call contract float @llvm.ppc.fres(float %{{[0-9]}})149end150 151!CHECK-LABEL: frsqrte_test(x)152subroutine frsqrte_test(x)153 real(8) :: x, y154 y = frsqrte(x)155! LLVMIR: call contract double @llvm.ppc.frsqrte(double %{{[0-9]}})156end157 158!CHECK-LABEL: frsqrtes_test(x)159subroutine frsqrtes_test(x)160 real :: x, y161 y = frsqrtes(x)162! LLVMIR: call contract float @llvm.ppc.frsqrtes(float %{{[0-9]}})163end164 165! CHECK-LABEL: mtfsf_test166subroutine mtfsf_test(r)167 real(8) :: r168 call mtfsf(1, r)169! LLVMIR: call void @llvm.ppc.mtfsf(i32 {{[0-9]}}, double %{{[0-9]}})170end171 172! CHECK-LABEL: mtfsfi_test173subroutine mtfsfi_test()174 call mtfsfi(1, 2)175! LLVMIR: call void @llvm.ppc.mtfsfi(i32 {{[0-9]}}, i32 {{[0-9]}})176end177