source: icGREP/icgrep-devel/llvm-3.6.1.src/test/CodeGen/R600/fminnum.ll @ 4664

Last change on this file since 4664 was 4664, checked in by cameron, 4 years ago

Upgrade LLVM to 3.6.1

File size: 6.6 KB
Line 
1; RUN: llc -march=amdgcn -mcpu=SI < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2; RUN: llc -march=amdgcn -mcpu=tonga < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
3
4declare float @llvm.minnum.f32(float, float) #0
5declare <2 x float> @llvm.minnum.v2f32(<2 x float>, <2 x float>) #0
6declare <4 x float> @llvm.minnum.v4f32(<4 x float>, <4 x float>) #0
7declare <8 x float> @llvm.minnum.v8f32(<8 x float>, <8 x float>) #0
8declare <16 x float> @llvm.minnum.v16f32(<16 x float>, <16 x float>) #0
9
10; FUNC-LABEL: @test_fmin_f32
11; SI: v_min_f32_e32
12define void @test_fmin_f32(float addrspace(1)* %out, float %a, float %b) nounwind {
13  %val = call float @llvm.minnum.f32(float %a, float %b) #0
14  store float %val, float addrspace(1)* %out, align 4
15  ret void
16}
17
18; FUNC-LABEL: @test_fmin_v2f32
19; SI: v_min_f32_e32
20; SI: v_min_f32_e32
21define void @test_fmin_v2f32(<2 x float> addrspace(1)* %out, <2 x float> %a, <2 x float> %b) nounwind {
22  %val = call <2 x float> @llvm.minnum.v2f32(<2 x float> %a, <2 x float> %b) #0
23  store <2 x float> %val, <2 x float> addrspace(1)* %out, align 8
24  ret void
25}
26
27; FUNC-LABEL: @test_fmin_v4f32
28; SI: v_min_f32_e32
29; SI: v_min_f32_e32
30; SI: v_min_f32_e32
31; SI: v_min_f32_e32
32define void @test_fmin_v4f32(<4 x float> addrspace(1)* %out, <4 x float> %a, <4 x float> %b) nounwind {
33  %val = call <4 x float> @llvm.minnum.v4f32(<4 x float> %a, <4 x float> %b) #0
34  store <4 x float> %val, <4 x float> addrspace(1)* %out, align 16
35  ret void
36}
37
38; FUNC-LABEL: @test_fmin_v8f32
39; SI: v_min_f32_e32
40; SI: v_min_f32_e32
41; SI: v_min_f32_e32
42; SI: v_min_f32_e32
43; SI: v_min_f32_e32
44; SI: v_min_f32_e32
45; SI: v_min_f32_e32
46; SI: v_min_f32_e32
47define void @test_fmin_v8f32(<8 x float> addrspace(1)* %out, <8 x float> %a, <8 x float> %b) nounwind {
48  %val = call <8 x float> @llvm.minnum.v8f32(<8 x float> %a, <8 x float> %b) #0
49  store <8 x float> %val, <8 x float> addrspace(1)* %out, align 32
50  ret void
51}
52
53; FUNC-LABEL: @test_fmin_v16f32
54; SI: v_min_f32_e32
55; SI: v_min_f32_e32
56; SI: v_min_f32_e32
57; SI: v_min_f32_e32
58; SI: v_min_f32_e32
59; SI: v_min_f32_e32
60; SI: v_min_f32_e32
61; SI: v_min_f32_e32
62; SI: v_min_f32_e32
63; SI: v_min_f32_e32
64; SI: v_min_f32_e32
65; SI: v_min_f32_e32
66; SI: v_min_f32_e32
67; SI: v_min_f32_e32
68; SI: v_min_f32_e32
69; SI: v_min_f32_e32
70define void @test_fmin_v16f32(<16 x float> addrspace(1)* %out, <16 x float> %a, <16 x float> %b) nounwind {
71  %val = call <16 x float> @llvm.minnum.v16f32(<16 x float> %a, <16 x float> %b) #0
72  store <16 x float> %val, <16 x float> addrspace(1)* %out, align 64
73  ret void
74}
75
76; FUNC-LABEL: @constant_fold_fmin_f32
77; SI-NOT: v_min_f32_e32
78; SI: v_mov_b32_e32 [[REG:v[0-9]+]], 1.0
79; SI: buffer_store_dword [[REG]]
80define void @constant_fold_fmin_f32(float addrspace(1)* %out) nounwind {
81  %val = call float @llvm.minnum.f32(float 1.0, float 2.0) #0
82  store float %val, float addrspace(1)* %out, align 4
83  ret void
84}
85
86; FUNC-LABEL: @constant_fold_fmin_f32_nan_nan
87; SI-NOT: v_min_f32_e32
88; SI: v_mov_b32_e32 [[REG:v[0-9]+]], 0x7fc00000
89; SI: buffer_store_dword [[REG]]
90define void @constant_fold_fmin_f32_nan_nan(float addrspace(1)* %out) nounwind {
91  %val = call float @llvm.minnum.f32(float 0x7FF8000000000000, float 0x7FF8000000000000) #0
92  store float %val, float addrspace(1)* %out, align 4
93  ret void
94}
95
96; FUNC-LABEL: @constant_fold_fmin_f32_val_nan
97; SI-NOT: v_min_f32_e32
98; SI: v_mov_b32_e32 [[REG:v[0-9]+]], 1.0
99; SI: buffer_store_dword [[REG]]
100define void @constant_fold_fmin_f32_val_nan(float addrspace(1)* %out) nounwind {
101  %val = call float @llvm.minnum.f32(float 1.0, float 0x7FF8000000000000) #0
102  store float %val, float addrspace(1)* %out, align 4
103  ret void
104}
105
106; FUNC-LABEL: @constant_fold_fmin_f32_nan_val
107; SI-NOT: v_min_f32_e32
108; SI: v_mov_b32_e32 [[REG:v[0-9]+]], 1.0
109; SI: buffer_store_dword [[REG]]
110define void @constant_fold_fmin_f32_nan_val(float addrspace(1)* %out) nounwind {
111  %val = call float @llvm.minnum.f32(float 0x7FF8000000000000, float 1.0) #0
112  store float %val, float addrspace(1)* %out, align 4
113  ret void
114}
115
116; FUNC-LABEL: @constant_fold_fmin_f32_p0_p0
117; SI-NOT: v_min_f32_e32
118; SI: v_mov_b32_e32 [[REG:v[0-9]+]], 0
119; SI: buffer_store_dword [[REG]]
120define void @constant_fold_fmin_f32_p0_p0(float addrspace(1)* %out) nounwind {
121  %val = call float @llvm.minnum.f32(float 0.0, float 0.0) #0
122  store float %val, float addrspace(1)* %out, align 4
123  ret void
124}
125
126; FUNC-LABEL: @constant_fold_fmin_f32_p0_n0
127; SI-NOT: v_min_f32_e32
128; SI: v_mov_b32_e32 [[REG:v[0-9]+]], 0
129; SI: buffer_store_dword [[REG]]
130define void @constant_fold_fmin_f32_p0_n0(float addrspace(1)* %out) nounwind {
131  %val = call float @llvm.minnum.f32(float 0.0, float -0.0) #0
132  store float %val, float addrspace(1)* %out, align 4
133  ret void
134}
135
136; FUNC-LABEL: @constant_fold_fmin_f32_n0_p0
137; SI-NOT: v_min_f32_e32
138; SI: v_mov_b32_e32 [[REG:v[0-9]+]], 0x80000000
139; SI: buffer_store_dword [[REG]]
140define void @constant_fold_fmin_f32_n0_p0(float addrspace(1)* %out) nounwind {
141  %val = call float @llvm.minnum.f32(float -0.0, float 0.0) #0
142  store float %val, float addrspace(1)* %out, align 4
143  ret void
144}
145
146; FUNC-LABEL: @constant_fold_fmin_f32_n0_n0
147; SI-NOT: v_min_f32_e32
148; SI: v_mov_b32_e32 [[REG:v[0-9]+]], 0x80000000
149; SI: buffer_store_dword [[REG]]
150define void @constant_fold_fmin_f32_n0_n0(float addrspace(1)* %out) nounwind {
151  %val = call float @llvm.minnum.f32(float -0.0, float -0.0) #0
152  store float %val, float addrspace(1)* %out, align 4
153  ret void
154}
155
156; FUNC-LABEL: @fmin_var_immediate_f32
157; SI: v_min_f32_e64 {{v[0-9]+}}, 2.0, {{s[0-9]+}}
158define void @fmin_var_immediate_f32(float addrspace(1)* %out, float %a) nounwind {
159  %val = call float @llvm.minnum.f32(float %a, float 2.0) #0
160  store float %val, float addrspace(1)* %out, align 4
161  ret void
162}
163
164; FUNC-LABEL: @fmin_immediate_var_f32
165; SI: v_min_f32_e64 {{v[0-9]+}}, 2.0, {{s[0-9]+}}
166define void @fmin_immediate_var_f32(float addrspace(1)* %out, float %a) nounwind {
167  %val = call float @llvm.minnum.f32(float 2.0, float %a) #0
168  store float %val, float addrspace(1)* %out, align 4
169  ret void
170}
171
172; FUNC-LABEL: @fmin_var_literal_f32
173; SI: v_mov_b32_e32 [[REG:v[0-9]+]], 0x42c60000
174; SI: v_min_f32_e32 {{v[0-9]+}}, {{s[0-9]+}}, [[REG]]
175define void @fmin_var_literal_f32(float addrspace(1)* %out, float %a) nounwind {
176  %val = call float @llvm.minnum.f32(float %a, float 99.0) #0
177  store float %val, float addrspace(1)* %out, align 4
178  ret void
179}
180
181; FUNC-LABEL: @fmin_literal_var_f32
182; SI: v_mov_b32_e32 [[REG:v[0-9]+]], 0x42c60000
183; SI: v_min_f32_e32 {{v[0-9]+}}, {{s[0-9]+}}, [[REG]]
184define void @fmin_literal_var_f32(float addrspace(1)* %out, float %a) nounwind {
185  %val = call float @llvm.minnum.f32(float 99.0, float %a) #0
186  store float %val, float addrspace(1)* %out, align 4
187  ret void
188}
189
190attributes #0 = { nounwind readnone }
Note: See TracBrowser for help on using the repository browser.