xref: /llvm-project/llvm/test/CodeGen/AMDGPU/fconst64.ll (revision 9e9907f1cfa424366fba58d9520f9305b537cec9)
1; RUN: llc < %s -mtriple=amdgcn -mcpu=tahiti -verify-machineinstrs | FileCheck %s
2; RUN: llc < %s -mtriple=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck %s
3
4; CHECK: {{^}}fconst_f64:
5; CHECK-DAG: s_mov_b32 {{s[0-9]+}}, 0x40140000
6; CHECK-DAG: s_mov_b32 {{s[0-9]+}}, 0
7
8define amdgpu_kernel void @fconst_f64(ptr addrspace(1) %out, ptr addrspace(1) %in) {
9   %tid = call i32 @llvm.amdgcn.workitem.id.x()
10   %gep = getelementptr inbounds double, ptr addrspace(1) %in, i32 %tid
11   %r1 = load double, ptr addrspace(1) %gep
12   %r2 = fadd double %r1, 5.000000e+00
13   store double %r2, ptr addrspace(1) %out
14   ret void
15}
16
17declare i32 @llvm.amdgcn.workitem.id.x() #1
18
19attributes #0 = { nounwind }
20attributes #1 = { nounwind readnone }
21