1 ; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=GCN %s
2 ; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=GCN %s
4 declare float @llvm.amdgcn.fract.f32(float) #0
5 declare double @llvm.amdgcn.fract.f64(double) #0
7 ; GCN-LABEL: {{^}}v_fract_f32:
8 ; GCN: v_fract_f32_e32 {{v[0-9]+}}, {{s[0-9]+}}
9 define amdgpu_kernel void @v_fract_f32(float addrspace(1)* %out, float %src) #1 {
10 %fract = call float @llvm.amdgcn.fract.f32(float %src)
11 store float %fract, float addrspace(1)* %out
15 ; GCN-LABEL: {{^}}v_fract_f64:
16 ; GCN: v_fract_f64_e32 {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}
17 define amdgpu_kernel void @v_fract_f64(double addrspace(1)* %out, double %src) #1 {
18 %fract = call double @llvm.amdgcn.fract.f64(double %src)
19 store double %fract, double addrspace(1)* %out
23 ; GCN-LABEL: {{^}}v_fract_undef_f32:
24 ; GCN-NOT: v_fract_f32
25 ; GCN-NOT: store_dword
26 define amdgpu_kernel void @v_fract_undef_f32(float addrspace(1)* %out) #1 {
27 %fract = call float @llvm.amdgcn.fract.f32(float undef)
28 store float %fract, float addrspace(1)* %out
32 attributes #0 = { nounwind readnone }
33 attributes #1 = { nounwind }