R600/SI: Add a stub GCNTargetMachine
[oota-llvm.git] / test / CodeGen / R600 / llvm.AMDGPU.rsq.ll
1 ; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2 ; RUN: llc -march=r600 -mcpu=cypress -verify-machineinstrs < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
3
4 declare float @llvm.AMDGPU.rsq.f32(float) nounwind readnone
5
6 ; FUNC-LABEL: {{^}}rsq_f32:
7 ; SI: v_rsq_f32_e32 {{v[0-9]+}}, {{s[0-9]+}}
8 ; EG: RECIPSQRT_IEEE
9 define void @rsq_f32(float addrspace(1)* %out, float %src) nounwind {
10   %rsq = call float @llvm.AMDGPU.rsq.f32(float %src) nounwind readnone
11   store float %rsq, float addrspace(1)* %out, align 4
12   ret void
13 }
14
15 ; TODO: Really these should be constant folded
16 ; FUNC-LABEL: {{^}}rsq_f32_constant_4.0
17 ; SI: v_rsq_f32_e32 {{v[0-9]+}}, 4.0
18 ; EG: RECIPSQRT_IEEE
19 define void @rsq_f32_constant_4.0(float addrspace(1)* %out) nounwind {
20   %rsq = call float @llvm.AMDGPU.rsq.f32(float 4.0) nounwind readnone
21   store float %rsq, float addrspace(1)* %out, align 4
22   ret void
23 }
24
25 ; FUNC-LABEL: {{^}}rsq_f32_constant_100.0
26 ; SI: v_rsq_f32_e32 {{v[0-9]+}}, 0x42c80000
27 ; EG: RECIPSQRT_IEEE
28 define void @rsq_f32_constant_100.0(float addrspace(1)* %out) nounwind {
29   %rsq = call float @llvm.AMDGPU.rsq.f32(float 100.0) nounwind readnone
30   store float %rsq, float addrspace(1)* %out, align 4
31   ret void
32 }