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