R600/SI: Change all instruction assembly names to lowercase.
[oota-llvm.git] / test / CodeGen / R600 / rsq.ll
1 ; RUN: llc -march=r600 -mcpu=SI -mattr=-fp32-denormals -verify-machineinstrs -enable-unsafe-fp-math < %s | FileCheck -check-prefix=SI-UNSAFE -check-prefix=SI %s
2 ; RUN: llc -march=r600 -mcpu=SI -mattr=-fp32-denormals -verify-machineinstrs < %s | FileCheck -check-prefix=SI-SAFE -check-prefix=SI %s
3
4 declare float @llvm.sqrt.f32(float) nounwind readnone
5 declare double @llvm.sqrt.f64(double) nounwind readnone
6
7 ; SI-LABEL: {{^}}rsq_f32:
8 ; SI: v_rsq_f32_e32
9 ; SI: s_endpgm
10 define void @rsq_f32(float addrspace(1)* noalias %out, float addrspace(1)* noalias %in) nounwind {
11   %val = load float addrspace(1)* %in, align 4
12   %sqrt = call float @llvm.sqrt.f32(float %val) nounwind readnone
13   %div = fdiv float 1.0, %sqrt
14   store float %div, float addrspace(1)* %out, align 4
15   ret void
16 }
17
18 ; SI-LABEL: {{^}}rsq_f64:
19 ; SI-UNSAFE: v_rsq_f64_e32
20 ; SI-SAFE: v_sqrt_f64_e32
21 ; SI: s_endpgm
22 define void @rsq_f64(double addrspace(1)* noalias %out, double addrspace(1)* noalias %in) nounwind {
23   %val = load double addrspace(1)* %in, align 4
24   %sqrt = call double @llvm.sqrt.f64(double %val) nounwind readnone
25   %div = fdiv double 1.0, %sqrt
26   store double %div, double addrspace(1)* %out, align 4
27   ret void
28 }
29
30 ; SI-LABEL: {{^}}rsq_f32_sgpr:
31 ; SI: v_rsq_f32_e32 {{v[0-9]+}}, {{s[0-9]+}}
32 ; SI: s_endpgm
33 define void @rsq_f32_sgpr(float addrspace(1)* noalias %out, float %val) nounwind {
34   %sqrt = call float @llvm.sqrt.f32(float %val) nounwind readnone
35   %div = fdiv float 1.0, %sqrt
36   store float %div, float addrspace(1)* %out, align 4
37   ret void
38 }