1 ; RUN: llc -march=amdgcn < %s | FileCheck -check-prefix=SI --check-prefix=FUNC %s
2 ; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global < %s | FileCheck -check-prefix=SI --check-prefix=FUNC %s
3 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG --check-prefix=FUNC %s
5 declare float @llvm.trunc.f32(float) nounwind readnone
6 declare <2 x float> @llvm.trunc.v2f32(<2 x float>) nounwind readnone
7 declare <3 x float> @llvm.trunc.v3f32(<3 x float>) nounwind readnone
8 declare <4 x float> @llvm.trunc.v4f32(<4 x float>) nounwind readnone
9 declare <8 x float> @llvm.trunc.v8f32(<8 x float>) nounwind readnone
10 declare <16 x float> @llvm.trunc.v16f32(<16 x float>) nounwind readnone
12 ; FUNC-LABEL: {{^}}ftrunc_f32:
15 define amdgpu_kernel void @ftrunc_f32(float addrspace(1)* %out, float %x) {
16 %y = call float @llvm.trunc.f32(float %x) nounwind readnone
17 store float %y, float addrspace(1)* %out
21 ; FUNC-LABEL: {{^}}ftrunc_v2f32:
26 define amdgpu_kernel void @ftrunc_v2f32(<2 x float> addrspace(1)* %out, <2 x float> %x) {
27 %y = call <2 x float> @llvm.trunc.v2f32(<2 x float> %x) nounwind readnone
28 store <2 x float> %y, <2 x float> addrspace(1)* %out
32 ; FIXME-FUNC-LABEL: {{^}}ftrunc_v3f32:
36 ; FIXME-SI: v_trunc_f32_e32
37 ; FIXME-SI: v_trunc_f32_e32
38 ; FIXME-SI: v_trunc_f32_e32
39 ; define amdgpu_kernel void @ftrunc_v3f32(<3 x float> addrspace(1)* %out, <3 x float> %x) {
40 ; %y = call <3 x float> @llvm.trunc.v3f32(<3 x float> %x) nounwind readnone
41 ; store <3 x float> %y, <3 x float> addrspace(1)* %out
45 ; FUNC-LABEL: {{^}}ftrunc_v4f32:
54 define amdgpu_kernel void @ftrunc_v4f32(<4 x float> addrspace(1)* %out, <4 x float> %x) {
55 %y = call <4 x float> @llvm.trunc.v4f32(<4 x float> %x) nounwind readnone
56 store <4 x float> %y, <4 x float> addrspace(1)* %out
60 ; FUNC-LABEL: {{^}}ftrunc_v8f32:
77 define amdgpu_kernel void @ftrunc_v8f32(<8 x float> addrspace(1)* %out, <8 x float> %x) {
78 %y = call <8 x float> @llvm.trunc.v8f32(<8 x float> %x) nounwind readnone
79 store <8 x float> %y, <8 x float> addrspace(1)* %out
83 ; FUNC-LABEL: {{^}}ftrunc_v16f32:
100 ; SI: v_trunc_f32_e32
101 ; SI: v_trunc_f32_e32
102 ; SI: v_trunc_f32_e32
103 ; SI: v_trunc_f32_e32
104 ; SI: v_trunc_f32_e32
105 ; SI: v_trunc_f32_e32
106 ; SI: v_trunc_f32_e32
107 ; SI: v_trunc_f32_e32
108 ; SI: v_trunc_f32_e32
109 ; SI: v_trunc_f32_e32
110 ; SI: v_trunc_f32_e32
111 ; SI: v_trunc_f32_e32
112 ; SI: v_trunc_f32_e32
113 ; SI: v_trunc_f32_e32
114 ; SI: v_trunc_f32_e32
115 ; SI: v_trunc_f32_e32
116 define amdgpu_kernel void @ftrunc_v16f32(<16 x float> addrspace(1)* %out, <16 x float> %x) {
117 %y = call <16 x float> @llvm.trunc.v16f32(<16 x float> %x) nounwind readnone
118 store <16 x float> %y, <16 x float> addrspace(1)* %out