1 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 -fp-contract=fast | FileCheck %s -check-prefix=CHECK
2 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 -fp-contract=fast -enable-unsafe-fp-math | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-UNSAFE
3 ; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 -fp-contract=fast | %ptxas-verify %}
4 ; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 -fp-contract=fast -enable-unsafe-fp-math | %ptxas-verify %}
6 define ptx_device float @t1_f32(float %x, float %y, float %z,
8 ; CHECK-UNSAFE: fma.rn.f32 %f{{[0-9]+}}, %f{{[0-9]+}}, %f{{[0-9]+}}, %f{{[0-9]+}};
9 ; CHECK-UNSAFE: fma.rn.f32 %f{{[0-9]+}}, %f{{[0-9]+}}, %f{{[0-9]+}}, %f{{[0-9]+}};
11 %a = fmul float %x, %y
12 %b = fmul float %u, %v
13 %c = fadd float %a, %b
14 %d = fadd float %c, %z
18 define ptx_device double @t1_f64(double %x, double %y, double %z,
19 double %u, double %v) {
20 ; CHECK-UNSAFE: fma.rn.f64 %fd{{[0-9]+}}, %fd{{[0-9]+}}, %fd{{[0-9]+}}, %fd{{[0-9]+}};
21 ; CHECK-UNSAFE: fma.rn.f64 %fd{{[0-9]+}}, %fd{{[0-9]+}}, %fd{{[0-9]+}}, %fd{{[0-9]+}};
23 %a = fmul double %x, %y
24 %b = fmul double %u, %v
25 %c = fadd double %a, %b
26 %d = fadd double %c, %z
30 define double @two_choices(double %val1, double %val2) {
31 ; CHECK-LABEL: two_choices(
35 %1 = fmul double %val1, %val2
36 %2 = fmul double %1, %1
37 %3 = fadd double %1, %2