Alexander Timofeev | 982aee6 | 2017-07-04 17:32:00 +0000 | [diff] [blame] | 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 |
Matt Arsenault | c1e6a45 | 2016-07-09 08:02:28 +0000 | [diff] [blame] | 3 | |
| 4 | ; FUNC-LABEL: {{^}}v_safe_fsqrt_f64: |
| 5 | ; GCN: v_sqrt_f64_e32 {{v\[[0-9]+:[0-9]+\], v\[[0-9]+:[0-9]+\]}} |
Matt Arsenault | 3dbeefa | 2017-03-21 21:39:51 +0000 | [diff] [blame] | 6 | define amdgpu_kernel void @v_safe_fsqrt_f64(double addrspace(1)* %out, double addrspace(1)* %in) #1 { |
Matt Arsenault | c1e6a45 | 2016-07-09 08:02:28 +0000 | [diff] [blame] | 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 |
| 10 | ret void |
| 11 | } |
| 12 | |
| 13 | ; FUNC-LABEL: {{^}}v_unsafe_fsqrt_f64: |
| 14 | ; GCN: v_sqrt_f64_e32 {{v\[[0-9]+:[0-9]+\], v\[[0-9]+:[0-9]+\]}} |
Matt Arsenault | 3dbeefa | 2017-03-21 21:39:51 +0000 | [diff] [blame] | 15 | define amdgpu_kernel void @v_unsafe_fsqrt_f64(double addrspace(1)* %out, double addrspace(1)* %in) #2 { |
Matt Arsenault | c1e6a45 | 2016-07-09 08:02:28 +0000 | [diff] [blame] | 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 |
| 19 | ret void |
| 20 | } |
| 21 | |
| 22 | declare double @llvm.sqrt.f64(double %Val) #0 |
| 23 | |
| 24 | attributes #0 = { nounwind readnone } |
| 25 | attributes #1 = { nounwind "unsafe-fp-math"="false" } |
| 26 | attributes #2 = { nounwind "unsafe-fp-math"="true" } |