blob: 00b5eb77b995931cce4088d4f1fc177bc97fd094 [file] [log] [blame]
Matt Arsenault74015162016-05-28 00:19:52 +00001; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=GCN %s
2; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=GCN %s
3
4declare float @llvm.amdgcn.fract.f32(float) #0
5declare double @llvm.amdgcn.fract.f64(double) #0
6
7; GCN-LABEL: {{^}}v_fract_f32:
8; GCN: v_fract_f32_e32 {{v[0-9]+}}, {{s[0-9]+}}
9define 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
12 ret void
13}
14
15; GCN-LABEL: {{^}}v_fract_f64:
16; GCN: v_fract_f64_e32 {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}
17define 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
20 ret void
21}
22
23attributes #0 = { nounwind readnone }
24attributes #1 = { nounwind }