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
3 ; RUN: %if ptxas && !ptxas-12.0 %{ llc < %s -march=nvptx -mcpu=sm_20 -fp-contract=fast | %ptxas-verify %}
4 ; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 -fp-contract=fast | %ptxas-verify %}
6 ;; These tests should run for all targets
8 ;;===-- Basic instruction selection tests ---------------------------------===;;
13 define double @fadd_f64(double %a, double %b) {
14 ; CHECK: add.f64 %fd{{[0-9]+}}, %fd{{[0-9]+}}, %fd{{[0-9]+}}
16 %ret = fadd double %a, %b
20 define double @fsub_f64(double %a, double %b) {
21 ; CHECK: sub.f64 %fd{{[0-9]+}}, %fd{{[0-9]+}}, %fd{{[0-9]+}}
23 %ret = fsub double %a, %b
27 define double @fmul_f64(double %a, double %b) {
28 ; CHECK: mul.f64 %fd{{[0-9]+}}, %fd{{[0-9]+}}, %fd{{[0-9]+}}
30 %ret = fmul double %a, %b
34 define double @fdiv_f64(double %a, double %b) {
35 ; CHECK: div.rn.f64 %fd{{[0-9]+}}, %fd{{[0-9]+}}, %fd{{[0-9]+}}
37 %ret = fdiv double %a, %b
41 ;; PTX does not have a floating-point rem instruction
46 define float @fadd_f32(float %a, float %b) {
47 ; CHECK: add.f32 %f{{[0-9]+}}, %f{{[0-9]+}}, %f{{[0-9]+}}
49 %ret = fadd float %a, %b
53 define float @fsub_f32(float %a, float %b) {
54 ; CHECK: sub.f32 %f{{[0-9]+}}, %f{{[0-9]+}}, %f{{[0-9]+}}
56 %ret = fsub float %a, %b
60 define float @fmul_f32(float %a, float %b) {
61 ; CHECK: mul.f32 %f{{[0-9]+}}, %f{{[0-9]+}}, %f{{[0-9]+}}
63 %ret = fmul float %a, %b
67 define float @fdiv_f32(float %a, float %b) {
68 ; CHECK: div.rn.f32 %f{{[0-9]+}}, %f{{[0-9]+}}, %f{{[0-9]+}}
70 %ret = fdiv float %a, %b
74 ;; PTX does not have a floating-point rem instruction