brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · f39009d Raw
50 lines · plain
1! RUN: %flang_fc1 -emit-hlfir -o - -mllvm -math-runtime=fast %s \2! RUN: | FileCheck %s --check-prefixes=ALL,FAST%if target=x86_64{{.*}} %{,ALL-KIND10,FAST-KIND10%}3 4! RUN: %flang_fc1 -emit-hlfir -o - -mllvm -math-runtime=relaxed %s \5! RUN: | FileCheck %s --check-prefixes=ALL,RELAXED%if target=x86_64{{.*}} %{,ALL-KIND10,RELAXED-KIND10%}6 7! RUN: %flang_fc1 -emit-hlfir -o - -mllvm -math-runtime=precise %s \8! RUN: | FileCheck %s --check-prefixes=ALL,PRECISE%if target=x86_64{{.*}} %{,ALL-KIND10,PRECISE-KIND10%}9 10function test_real4(x)11  real :: x, test_real412  test_real4 = anint(x)13end function14 15! ALL-LABEL: @_QPtest_real416! FAST: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f32) -> f3217! RELAXED: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f32) -> f3218! PRECISE: {{%[A-Za-z0-9._]+}} = fir.call @llvm.round.f32({{%[A-Za-z0-9._]+}}) {{.*}}: (f32) -> f3219 20function test_real8(x)21  real(8) :: x, test_real822  test_real8 = anint(x)23end function24 25! ALL-LABEL: @_QPtest_real826! FAST: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f64) -> f6427! RELAXED: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f64) -> f6428! PRECISE: {{%[A-Za-z0-9._]+}} = fir.call @llvm.round.f64({{%[A-Za-z0-9._]+}}) {{.*}}: (f64) -> f6429 30function test_real10(x)31  integer, parameter :: kind10 = merge(10, 4, selected_real_kind(p=18).eq.10)32  real(kind10) :: x, test_real1033  test_real10 = anint(x)34end function35 36! ALL-KIND10-LABEL: @_QPtest_real1037! FAST-KIND10: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f80) -> f8038! RELAXED-KIND10: {{%[A-Za-z0-9._]+}} = llvm.intr.round({{%[A-Za-z0-9._]+}}) : (f80) -> f8039! PRECISE-KIND10: {{%[A-Za-z0-9._]+}} = fir.call @llvm.round.f80({{%[A-Za-z0-9._]+}}) {{.*}}: (f80) -> f8040 41! TODO: wait until fp128 is supported well in llvm.round42!function test_real16(x)43!  real(16) :: x, test_real1644!  test_real16 = anint(x)45!end function46 47! PRECISE-DAG: func.func private @llvm.round.f32(f32) -> f32 attributes {fir.bindc_name = "llvm.round.f32", fir.runtime}48! PRECISE-DAG: func.func private @llvm.round.f64(f64) -> f64 attributes {fir.bindc_name = "llvm.round.f64", fir.runtime}49! PRECISE-KIND10-DAG: func.func private @llvm.round.f80(f80) -> f80 attributes {fir.bindc_name = "llvm.round.f80", fir.runtime}50