xref: /llvm-project/llvm/test/CodeGen/NVPTX/rsqrt.ll (revision b279f6b098d3849f7f1c1f539b108307d5f8ae2d)
1; RUN: llc < %s -mtriple=nvptx64 | FileCheck %s
2; RUN: %if ptxas %{ llc < %s -mtriple=nvptx64 | %ptxas-verify %}
3
4; CHECK-LABEL: .func{{.*}}test1
5define float @test1(float %in) local_unnamed_addr {
6; CHECK: rsqrt.approx.f32
7  %call = call float @llvm.nvvm.rsqrt.approx.f(float %in)
8  ret float %call
9}
10
11; CHECK-LABEL: .func{{.*}}test2
12define double @test2(double %in) local_unnamed_addr {
13; CHECK: rsqrt.approx.f64
14  %call = call double @llvm.nvvm.rsqrt.approx.d(double %in)
15  ret double %call
16}
17
18; CHECK-LABEL: .func{{.*}}test3
19define float @test3(float %in) local_unnamed_addr {
20; CHECK: rsqrt.approx.ftz.f32
21  %call = tail call float @llvm.nvvm.rsqrt.approx.ftz.f(float %in)
22  ret float %call
23}
24
25; CHECK-LABEL: .func{{.*}}test4
26define double @test4(double %in) local_unnamed_addr {
27; CHECK: rsqrt.approx.ftz.f64
28  %call = tail call double @llvm.nvvm.rsqrt.approx.ftz.d(double %in)
29  ret double %call
30}
31
32declare float @llvm.nvvm.rsqrt.approx.ftz.f(float)
33declare double @llvm.nvvm.rsqrt.approx.ftz.d(double)
34declare float @llvm.nvvm.rsqrt.approx.f(float)
35declare double @llvm.nvvm.rsqrt.approx.d(double)
36