xref: /aosp_15_r20/external/llvm/test/CodeGen/AMDGPU/ftrunc.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=amdgcn < %s | FileCheck -check-prefix=SI --check-prefix=FUNC %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=amdgcn -mcpu=tonga < %s | FileCheck -check-prefix=SI --check-prefix=FUNC %s
3*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG --check-prefix=FUNC %s
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Workerdeclare float @llvm.trunc.f32(float) nounwind readnone
6*9880d681SAndroid Build Coastguard Workerdeclare <2 x float> @llvm.trunc.v2f32(<2 x float>) nounwind readnone
7*9880d681SAndroid Build Coastguard Workerdeclare <3 x float> @llvm.trunc.v3f32(<3 x float>) nounwind readnone
8*9880d681SAndroid Build Coastguard Workerdeclare <4 x float> @llvm.trunc.v4f32(<4 x float>) nounwind readnone
9*9880d681SAndroid Build Coastguard Workerdeclare <8 x float> @llvm.trunc.v8f32(<8 x float>) nounwind readnone
10*9880d681SAndroid Build Coastguard Workerdeclare <16 x float> @llvm.trunc.v16f32(<16 x float>) nounwind readnone
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker; FUNC-LABEL: {{^}}ftrunc_f32:
13*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
14*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
15*9880d681SAndroid Build Coastguard Workerdefine void @ftrunc_f32(float addrspace(1)* %out, float %x) {
16*9880d681SAndroid Build Coastguard Worker  %y = call float @llvm.trunc.f32(float %x) nounwind readnone
17*9880d681SAndroid Build Coastguard Worker  store float %y, float addrspace(1)* %out
18*9880d681SAndroid Build Coastguard Worker  ret void
19*9880d681SAndroid Build Coastguard Worker}
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Worker; FUNC-LABEL: {{^}}ftrunc_v2f32:
22*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
23*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
24*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
25*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
26*9880d681SAndroid Build Coastguard Workerdefine void @ftrunc_v2f32(<2 x float> addrspace(1)* %out, <2 x float> %x) {
27*9880d681SAndroid Build Coastguard Worker  %y = call <2 x float> @llvm.trunc.v2f32(<2 x float> %x) nounwind readnone
28*9880d681SAndroid Build Coastguard Worker  store <2 x float> %y, <2 x float> addrspace(1)* %out
29*9880d681SAndroid Build Coastguard Worker  ret void
30*9880d681SAndroid Build Coastguard Worker}
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard Worker; FIXME-FUNC-LABEL: {{^}}ftrunc_v3f32:
33*9880d681SAndroid Build Coastguard Worker; FIXME-EG: TRUNC
34*9880d681SAndroid Build Coastguard Worker; FIXME-EG: TRUNC
35*9880d681SAndroid Build Coastguard Worker; FIXME-EG: TRUNC
36*9880d681SAndroid Build Coastguard Worker; FIXME-SI: v_trunc_f32_e32
37*9880d681SAndroid Build Coastguard Worker; FIXME-SI: v_trunc_f32_e32
38*9880d681SAndroid Build Coastguard Worker; FIXME-SI: v_trunc_f32_e32
39*9880d681SAndroid Build Coastguard Worker; define void @ftrunc_v3f32(<3 x float> addrspace(1)* %out, <3 x float> %x) {
40*9880d681SAndroid Build Coastguard Worker;   %y = call <3 x float> @llvm.trunc.v3f32(<3 x float> %x) nounwind readnone
41*9880d681SAndroid Build Coastguard Worker;   store <3 x float> %y, <3 x float> addrspace(1)* %out
42*9880d681SAndroid Build Coastguard Worker;   ret void
43*9880d681SAndroid Build Coastguard Worker; }
44*9880d681SAndroid Build Coastguard Worker
45*9880d681SAndroid Build Coastguard Worker; FUNC-LABEL: {{^}}ftrunc_v4f32:
46*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
47*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
48*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
49*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
50*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
51*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
52*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
53*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
54*9880d681SAndroid Build Coastguard Workerdefine void @ftrunc_v4f32(<4 x float> addrspace(1)* %out, <4 x float> %x) {
55*9880d681SAndroid Build Coastguard Worker  %y = call <4 x float> @llvm.trunc.v4f32(<4 x float> %x) nounwind readnone
56*9880d681SAndroid Build Coastguard Worker  store <4 x float> %y, <4 x float> addrspace(1)* %out
57*9880d681SAndroid Build Coastguard Worker  ret void
58*9880d681SAndroid Build Coastguard Worker}
59*9880d681SAndroid Build Coastguard Worker
60*9880d681SAndroid Build Coastguard Worker; FUNC-LABEL: {{^}}ftrunc_v8f32:
61*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
62*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
63*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
64*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
65*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
66*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
67*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
68*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
69*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
70*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
71*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
72*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
73*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
74*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
75*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
76*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
77*9880d681SAndroid Build Coastguard Workerdefine void @ftrunc_v8f32(<8 x float> addrspace(1)* %out, <8 x float> %x) {
78*9880d681SAndroid Build Coastguard Worker  %y = call <8 x float> @llvm.trunc.v8f32(<8 x float> %x) nounwind readnone
79*9880d681SAndroid Build Coastguard Worker  store <8 x float> %y, <8 x float> addrspace(1)* %out
80*9880d681SAndroid Build Coastguard Worker  ret void
81*9880d681SAndroid Build Coastguard Worker}
82*9880d681SAndroid Build Coastguard Worker
83*9880d681SAndroid Build Coastguard Worker; FUNC-LABEL: {{^}}ftrunc_v16f32:
84*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
85*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
86*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
87*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
88*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
89*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
90*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
91*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
92*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
93*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
94*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
95*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
96*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
97*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
98*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
99*9880d681SAndroid Build Coastguard Worker; EG: TRUNC
100*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
101*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
102*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
103*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
104*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
105*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
106*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
107*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
108*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
109*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
110*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
111*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
112*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
113*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
114*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
115*9880d681SAndroid Build Coastguard Worker; SI: v_trunc_f32_e32
116*9880d681SAndroid Build Coastguard Workerdefine void @ftrunc_v16f32(<16 x float> addrspace(1)* %out, <16 x float> %x) {
117*9880d681SAndroid Build Coastguard Worker  %y = call <16 x float> @llvm.trunc.v16f32(<16 x float> %x) nounwind readnone
118*9880d681SAndroid Build Coastguard Worker  store <16 x float> %y, <16 x float> addrspace(1)* %out
119*9880d681SAndroid Build Coastguard Worker  ret void
120*9880d681SAndroid Build Coastguard Worker}
121