1 ; RUN: llc -amdgpu-scalarize-global-loads=false -march=amdgcn -mcpu=tahiti -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=FUNC %s
2 ; RUN: llc -amdgpu-scalarize-global-loads=false -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=FUNC %s
4 ; FUNC-LABEL: {{^}}v_safe_fsqrt_f64:
5 ; GCN: v_sqrt_f64_e32 {{v\[[0-9]+:[0-9]+\], v\[[0-9]+:[0-9]+\]}}
6 define amdgpu_kernel void @v_safe_fsqrt_f64(double addrspace(1)* %out, double addrspace(1)* %in) #1 {
7 %r0 = load double, double addrspace(1)* %in
8 %r1 = call double @llvm.sqrt.f64(double %r0)
9 store double %r1, double addrspace(1)* %out
13 ; FUNC-LABEL: {{^}}v_unsafe_fsqrt_f64:
14 ; GCN: v_sqrt_f64_e32 {{v\[[0-9]+:[0-9]+\], v\[[0-9]+:[0-9]+\]}}
15 define amdgpu_kernel void @v_unsafe_fsqrt_f64(double addrspace(1)* %out, double addrspace(1)* %in) #2 {
16 %r0 = load double, double addrspace(1)* %in
17 %r1 = call double @llvm.sqrt.f64(double %r0)
18 store double %r1, double addrspace(1)* %out
22 declare double @llvm.sqrt.f64(double %Val) #0
24 attributes #0 = { nounwind readnone }
25 attributes #1 = { nounwind "unsafe-fp-math"="false" }
26 attributes #2 = { nounwind "unsafe-fp-math"="true" }