1;RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck --check-prefix=EG-CHECK %s
2;RUN: llc < %s -march=r600 -mcpu=verde -verify-machineinstrs | FileCheck --check-prefix=SI-CHECK %s
3
4;The code generated by urem is long and complex and may frequently change.
5;The goal of this test is to make sure the ISel doesn't fail when it gets
6;a v2i32/v4i32 urem
7
8;EG-CHECK: @test2
9;EG-CHECK: CF_END
10;SI-CHECK: @test2
11;SI-CHECK: S_ENDPGM
12
13define void @test2(<2 x i32> addrspace(1)* %out, <2 x i32> addrspace(1)* %in) {
14  %b_ptr = getelementptr <2 x i32> addrspace(1)* %in, i32 1
15  %a = load <2 x i32> addrspace(1) * %in
16  %b = load <2 x i32> addrspace(1) * %b_ptr
17  %result = urem <2 x i32> %a, %b
18  store <2 x i32> %result, <2 x i32> addrspace(1)* %out
19  ret void
20}
21
22;EG-CHECK: @test4
23;EG-CHECK: CF_END
24;SI-CHECK: @test4
25;SI-CHECK: S_ENDPGM
26
27define void @test4(<4 x i32> addrspace(1)* %out, <4 x i32> addrspace(1)* %in) {
28  %b_ptr = getelementptr <4 x i32> addrspace(1)* %in, i32 1
29  %a = load <4 x i32> addrspace(1) * %in
30  %b = load <4 x i32> addrspace(1) * %b_ptr
31  %result = urem <4 x i32> %a, %b
32  store <4 x i32> %result, <4 x i32> addrspace(1)* %out
33  ret void
34}
35