1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -global-isel=0 -mtriple=amdgcn-amd-amdhsa -mcpu=fiji < %s | FileCheck -check-prefixes=GCN,SDAG %s
3 ; RUN: llc -global-isel=1 -mtriple=amdgcn-amd-amdhsa -mcpu=fiji < %s | FileCheck -check-prefixes=GCN,GISEL %s
5 define float @v_exp2_f32(float %src) {
6 ; GCN-LABEL: v_exp2_f32:
8 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9 ; GCN-NEXT: v_exp_f32_e32 v0, v0
10 ; GCN-NEXT: s_setpc_b64 s[30:31]
11 %exp2 = call float @llvm.amdgcn.exp2.f32(float %src)
15 define float @v_fabs_exp2_f32(float %src) {
16 ; GCN-LABEL: v_fabs_exp2_f32:
18 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
19 ; GCN-NEXT: v_exp_f32_e64 v0, |v0|
20 ; GCN-NEXT: s_setpc_b64 s[30:31]
21 %fabs.src = call float @llvm.fabs.f32(float %src)
22 %exp2 = call float @llvm.amdgcn.exp2.f32(float %fabs.src)
26 define float @v_fneg_fabs_exp2_f32(float %src) {
27 ; GCN-LABEL: v_fneg_fabs_exp2_f32:
29 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
30 ; GCN-NEXT: v_exp_f32_e64 v0, -|v0|
31 ; GCN-NEXT: s_setpc_b64 s[30:31]
32 %fabs.src = call float @llvm.fabs.f32(float %src)
33 %neg.fabs.src = fneg float %fabs.src
34 %exp2 = call float @llvm.amdgcn.exp2.f32(float %neg.fabs.src)
38 define half @v_exp2_f16(half %src) {
39 ; GCN-LABEL: v_exp2_f16:
41 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
42 ; GCN-NEXT: v_exp_f16_e32 v0, v0
43 ; GCN-NEXT: s_setpc_b64 s[30:31]
44 %exp2 = call half @llvm.amdgcn.exp2.f16(half %src)
48 define half @v_fabs_exp2_f16(half %src) {
49 ; GCN-LABEL: v_fabs_exp2_f16:
51 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
52 ; GCN-NEXT: v_exp_f16_e64 v0, |v0|
53 ; GCN-NEXT: s_setpc_b64 s[30:31]
54 %fabs.src = call half @llvm.fabs.f16(half %src)
55 %exp2 = call half @llvm.amdgcn.exp2.f16(half %fabs.src)
59 define half @v_fneg_fabs_exp2_f16(half %src) {
60 ; GCN-LABEL: v_fneg_fabs_exp2_f16:
62 ; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
63 ; GCN-NEXT: v_exp_f16_e64 v0, -|v0|
64 ; GCN-NEXT: s_setpc_b64 s[30:31]
65 %fabs.src = call half @llvm.fabs.f16(half %src)
66 %neg.fabs.src = fneg half %fabs.src
67 %exp2 = call half @llvm.amdgcn.exp2.f16(half %neg.fabs.src)
71 declare half @llvm.amdgcn.exp2.f16(half) #0
72 declare float @llvm.amdgcn.exp2.f32(float) #0
73 declare float @llvm.fabs.f32(float) #0
74 declare half @llvm.fabs.f16(half) #0
76 attributes #0 = { nounwind readnone speculatable willreturn }
77 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: