annotate llvm/test/CodeGen/AMDGPU/fneg-combines.si.ll @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children 2e18cbf3894f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; RUN: llc -march=amdgcn -mcpu=tahiti -start-after=sink -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=GCN -check-prefix=GCN-SAFE -check-prefix=SI -check-prefix=FUNC %s
anatofuz
parents:
diff changeset
2 ; RUN: llc -enable-no-signed-zeros-fp-math -march=amdgcn -mcpu=tahiti -start-after=sink -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefix=GCN -check-prefix=GCN-NSZ -check-prefix=SI -check-prefix=FUNC %s
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 ; --------------------------------------------------------------------------------
anatofuz
parents:
diff changeset
5 ; rcp_legacy tests
anatofuz
parents:
diff changeset
6 ; --------------------------------------------------------------------------------
anatofuz
parents:
diff changeset
7
anatofuz
parents:
diff changeset
8 ; GCN-LABEL: {{^}}v_fneg_rcp_legacy_f32:
anatofuz
parents:
diff changeset
9 ; GCN: {{buffer|flat}}_load_dword [[A:v[0-9]+]]
anatofuz
parents:
diff changeset
10 ; GCN: v_rcp_legacy_f32_e64 [[RESULT:v[0-9]+]], -[[A]]
anatofuz
parents:
diff changeset
11 ; GCN: {{buffer|flat}}_store_dword [[RESULT]]
anatofuz
parents:
diff changeset
12 define amdgpu_kernel void @v_fneg_rcp_legacy_f32(float addrspace(1)* %out, float addrspace(1)* %a.ptr) #0 {
anatofuz
parents:
diff changeset
13 %tid = call i32 @llvm.amdgcn.workitem.id.x()
anatofuz
parents:
diff changeset
14 %tid.ext = sext i32 %tid to i64
anatofuz
parents:
diff changeset
15 %a.gep = getelementptr inbounds float, float addrspace(1)* %a.ptr, i64 %tid.ext
anatofuz
parents:
diff changeset
16 %out.gep = getelementptr inbounds float, float addrspace(1)* %out, i64 %tid.ext
anatofuz
parents:
diff changeset
17 %a = load volatile float, float addrspace(1)* %a.gep
anatofuz
parents:
diff changeset
18 %rcp = call float @llvm.amdgcn.rcp.legacy(float %a)
anatofuz
parents:
diff changeset
19 %fneg = fsub float -0.000000e+00, %rcp
anatofuz
parents:
diff changeset
20 store float %fneg, float addrspace(1)* %out.gep
anatofuz
parents:
diff changeset
21 ret void
anatofuz
parents:
diff changeset
22 }
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 declare i32 @llvm.amdgcn.workitem.id.x() #1
anatofuz
parents:
diff changeset
25 declare float @llvm.amdgcn.rcp.legacy(float) #1
anatofuz
parents:
diff changeset
26
anatofuz
parents:
diff changeset
27 attributes #0 = { nounwind }
anatofuz
parents:
diff changeset
28 attributes #1 = { nounwind readnone }