brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · f99fe71 Raw
67 lines · plain
1; RUN: llc -mtriple=amdgcn < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s2; RUN: llc -mtriple=amdgcn -mcpu=tonga -mattr=-flat-for-global < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s3 4declare float @llvm.amdgcn.rsq.f32(float) #05declare double @llvm.amdgcn.rsq.f64(double) #06 7; FUNC-LABEL: {{^}}rsq_f32:8; SI: v_rsq_f32_e32 {{v[0-9]+}}, {{s[0-9]+}}9define amdgpu_kernel void @rsq_f32(ptr addrspace(1) %out, float %src) #1 {10  %rsq = call float @llvm.amdgcn.rsq.f32(float %src) #011  store float %rsq, ptr addrspace(1) %out, align 412  ret void13}14 15; TODO: Really these should be constant folded16; FUNC-LABEL: {{^}}rsq_f32_constant_4.017; SI: v_rsq_f32_e32 {{v[0-9]+}}, 4.018define amdgpu_kernel void @rsq_f32_constant_4.0(ptr addrspace(1) %out) #1 {19  %rsq = call float @llvm.amdgcn.rsq.f32(float 4.0) #020  store float %rsq, ptr addrspace(1) %out, align 421  ret void22}23 24; FUNC-LABEL: {{^}}rsq_f32_constant_100.025; SI: v_rsq_f32_e32 {{v[0-9]+}}, 0x42c8000026define amdgpu_kernel void @rsq_f32_constant_100.0(ptr addrspace(1) %out) #1 {27  %rsq = call float @llvm.amdgcn.rsq.f32(float 100.0) #028  store float %rsq, ptr addrspace(1) %out, align 429  ret void30}31 32; FUNC-LABEL: {{^}}rsq_f64:33; SI: v_rsq_f64_e32 {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}34define amdgpu_kernel void @rsq_f64(ptr addrspace(1) %out, double %src) #1 {35  %rsq = call double @llvm.amdgcn.rsq.f64(double %src) #036  store double %rsq, ptr addrspace(1) %out, align 437  ret void38}39 40; TODO: Really these should be constant folded41; FUNC-LABEL: {{^}}rsq_f64_constant_4.042; SI: v_rsq_f64_e32 {{v\[[0-9]+:[0-9]+\]}}, 4.043define amdgpu_kernel void @rsq_f64_constant_4.0(ptr addrspace(1) %out) #1 {44  %rsq = call double @llvm.amdgcn.rsq.f64(double 4.0) #045  store double %rsq, ptr addrspace(1) %out, align 446  ret void47}48 49; FUNC-LABEL: {{^}}rsq_f64_constant_100.050; SI: v_rsq_f64_e32 {{v\[[0-9]+:[0-9]+\]}}, 0x4059000051define amdgpu_kernel void @rsq_f64_constant_100.0(ptr addrspace(1) %out) #1 {52  %rsq = call double @llvm.amdgcn.rsq.f64(double 100.0) #053  store double %rsq, ptr addrspace(1) %out, align 454  ret void55}56 57; FUNC-LABEL: {{^}}rsq_undef_f32:58; SI-NOT: v_rsq_f3259define amdgpu_kernel void @rsq_undef_f32(ptr addrspace(1) %out) #1 {60  %rsq = call float @llvm.amdgcn.rsq.f32(float poison)61  store float %rsq, ptr addrspace(1) %out, align 462  ret void63}64 65attributes #0 = { nounwind readnone }66attributes #1 = { nounwind }67