1 ; RUN: llc < %s -march=nvptx -mcpu=sm_20 -fp-contract=fast | FileCheck %s
2 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 -fp-contract=fast | FileCheck %s
4 ;; These tests should run for all targets
6 ;;===-- Basic instruction selection tests ---------------------------------===;;
11 define double @fadd_f64(double %a, double %b) {
12 ; CHECK: add.f64 %fd{{[0-9]+}}, %fd{{[0-9]+}}, %fd{{[0-9]+}}
14 %ret = fadd double %a, %b
18 define double @fsub_f64(double %a, double %b) {
19 ; CHECK: sub.f64 %fd{{[0-9]+}}, %fd{{[0-9]+}}, %fd{{[0-9]+}}
21 %ret = fsub double %a, %b
25 define double @fmul_f64(double %a, double %b) {
26 ; CHECK: mul.f64 %fd{{[0-9]+}}, %fd{{[0-9]+}}, %fd{{[0-9]+}}
28 %ret = fmul double %a, %b
32 define double @fdiv_f64(double %a, double %b) {
33 ; CHECK: div.rn.f64 %fd{{[0-9]+}}, %fd{{[0-9]+}}, %fd{{[0-9]+}}
35 %ret = fdiv double %a, %b
39 ;; PTX does not have a floating-point rem instruction
44 define float @fadd_f32(float %a, float %b) {
45 ; CHECK: add.f32 %f{{[0-9]+}}, %f{{[0-9]+}}, %f{{[0-9]+}}
47 %ret = fadd float %a, %b
51 define float @fsub_f32(float %a, float %b) {
52 ; CHECK: sub.f32 %f{{[0-9]+}}, %f{{[0-9]+}}, %f{{[0-9]+}}
54 %ret = fsub float %a, %b
58 define float @fmul_f32(float %a, float %b) {
59 ; CHECK: mul.f32 %f{{[0-9]+}}, %f{{[0-9]+}}, %f{{[0-9]+}}
61 %ret = fmul float %a, %b
65 define float @fdiv_f32(float %a, float %b) {
66 ; CHECK: div.rn.f32 %f{{[0-9]+}}, %f{{[0-9]+}}, %f{{[0-9]+}}
68 %ret = fdiv float %a, %b
72 ;; PTX does not have a floating-point rem instruction