1 ; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs -enable-unsafe-fp-math < %s | FileCheck -check-prefix=SI-UNSAFE -check-prefix=SI %s
2 ; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI-SAFE -check-prefix=SI %s
4 declare float @llvm.sqrt.f32(float) nounwind readnone
5 declare double @llvm.sqrt.f64(double) nounwind readnone
8 ; SI-UNSAFE: V_RSQ_F32_e32
11 define void @rsq_f32(float addrspace(1)* noalias %out, float addrspace(1)* noalias %in) nounwind {
12 %val = load float addrspace(1)* %in, align 4
13 %sqrt = call float @llvm.sqrt.f32(float %val) nounwind readnone
14 %div = fdiv float 1.0, %sqrt
15 store float %div, float addrspace(1)* %out, align 4
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