1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=fiji < %s | FileCheck -check-prefix=GCN %s
3 ; RUN: llc -global-isel -mtriple=amdgcn-amd-amdhsa -mcpu=fiji < %s | FileCheck -check-prefix=GCN %s
5 define half @v_sqrt_f16(half %src) {
6 ; GCN-LABEL: v_sqrt_f16:
8 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9 ; GCN-NEXT: v_sqrt_f16_e32 v0, v0
10 ; GCN-NEXT: s_setpc_b64 s[30:31]
11 %sqrt = call half @llvm.amdgcn.sqrt.f16(half %src)
15 define half @v_fabs_sqrt_f16(half %src) {
16 ; GCN-LABEL: v_fabs_sqrt_f16:
18 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
19 ; GCN-NEXT: v_sqrt_f16_e64 v0, |v0|
20 ; GCN-NEXT: s_setpc_b64 s[30:31]
21 %fabs.src = call half @llvm.fabs.f16(half %src)
22 %sqrt = call half @llvm.amdgcn.sqrt.f16(half %fabs.src)
26 define half @v_fneg_fabs_sqrt_f16(half %src) {
27 ; GCN-LABEL: v_fneg_fabs_sqrt_f16:
29 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
30 ; GCN-NEXT: v_sqrt_f16_e64 v0, -|v0|
31 ; GCN-NEXT: s_setpc_b64 s[30:31]
32 %fabs.src = call half @llvm.fabs.f16(half %src)
33 %neg.fabs.src = fneg half %fabs.src
34 %sqrt = call half @llvm.amdgcn.sqrt.f16(half %neg.fabs.src)
38 declare half @llvm.amdgcn.sqrt.f16(half) #0
39 declare half @llvm.fabs.f16(half) #0
41 attributes #0 = { nounwind readnone speculatable willreturn }