• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
2
3
4declare float @llvm.nvvm.sqrt.f(float)
5
6
7; CHECK: sqrt_div
8; CHECK: sqrt.rn.f32
9; CHECK: div.rn.f32
10define float @sqrt_div(float %a, float %b) {
11  %t1 = tail call float @llvm.nvvm.sqrt.f(float %a)
12  %t2 = fdiv float %t1, %b
13  ret float %t2
14}
15
16; CHECK: sqrt_div_fast
17; CHECK: sqrt.approx.f32
18; CHECK: div.approx.f32
19define float @sqrt_div_fast(float %a, float %b) #0 {
20  %t1 = tail call float @llvm.nvvm.sqrt.f(float %a)
21  %t2 = fdiv float %t1, %b
22  ret float %t2
23}
24
25
26; CHECK: fadd
27; CHECK: add.f32
28define float @fadd(float %a, float %b) {
29  %t1 = fadd float %a, %b
30  ret float %t1
31}
32
33; CHECK: fadd_ftz
34; CHECK: add.ftz.f32
35define float @fadd_ftz(float %a, float %b) #1 {
36  %t1 = fadd float %a, %b
37  ret float %t1
38}
39
40
41
42attributes #0 = { "unsafe-fp-math" = "true" }
43attributes #1 = { "nvptx-f32ftz" = "true" }
44