1 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 -fp-contract=fast -verify-machineinstrs | FileCheck %s
2 ; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 -fp-contract=fast -verify-machineinstrs | %ptxas-verify %}
4 declare float @dummy_f32(float, float) #0
5 declare double @dummy_f64(double, double) #0
7 define ptx_device float @t1_f32(float %x, float %y, float %z) {
8 ; CHECK: fma.rn.f32 %f{{[0-9]+}}, %f{{[0-9]+}}, %f{{[0-9]+}}, %f{{[0-9]+}};
10 %a = fmul float %x, %y
11 %b = fadd float %a, %z
15 define ptx_device float @t2_f32(float %x, float %y, float %z, float %w) {
16 ; CHECK: fma.rn.f32 %f{{[0-9]+}}, %f{{[0-9]+}}, %f{{[0-9]+}}, %f{{[0-9]+}};
17 ; CHECK: fma.rn.f32 %f{{[0-9]+}}, %f{{[0-9]+}}, %f{{[0-9]+}}, %f{{[0-9]+}};
19 %a = fmul float %x, %y
20 %b = fadd float %a, %z
21 %c = fadd float %a, %w
22 %d = call float @dummy_f32(float %b, float %c)
26 define ptx_device double @t1_f64(double %x, double %y, double %z) {
27 ; CHECK: fma.rn.f64 %fd{{[0-9]+}}, %fd{{[0-9]+}}, %fd{{[0-9]+}}, %fd{{[0-9]+}};
29 %a = fmul double %x, %y
30 %b = fadd double %a, %z
34 define ptx_device double @t2_f64(double %x, double %y, double %z, double %w) {
35 ; CHECK: fma.rn.f64 %fd{{[0-9]+}}, %fd{{[0-9]+}}, %fd{{[0-9]+}}, %fd{{[0-9]+}};
36 ; CHECK: fma.rn.f64 %fd{{[0-9]+}}, %fd{{[0-9]+}}, %fd{{[0-9]+}}, %fd{{[0-9]+}};
38 %a = fmul double %x, %y
39 %b = fadd double %a, %z
40 %c = fadd double %a, %w
41 %d = call double @dummy_f64(double %b, double %c)