1 ; RUN: llc -march=amdgcn -mcpu=verde -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
4 ; The code generated by urem is long and complex and may frequently
5 ; change. The goal of this test is to make sure the ISel doesn't fail
6 ; when it gets a v2i32/v4i32 urem
8 ; FUNC-LABEL: {{^}}test_urem_i32:
11 define void @test_urem_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %in) {
12 %b_ptr = getelementptr i32 addrspace(1)* %in, i32 1
13 %a = load i32 addrspace(1)* %in
14 %b = load i32 addrspace(1)* %b_ptr
15 %result = urem i32 %a, %b
16 store i32 %result, i32 addrspace(1)* %out
20 ; FUNC-LABEL: {{^}}test_urem_v2i32:
23 define void @test_urem_v2i32(<2 x i32> addrspace(1)* %out, <2 x i32> addrspace(1)* %in) {
24 %b_ptr = getelementptr <2 x i32> addrspace(1)* %in, i32 1
25 %a = load <2 x i32> addrspace(1)* %in
26 %b = load <2 x i32> addrspace(1)* %b_ptr
27 %result = urem <2 x i32> %a, %b
28 store <2 x i32> %result, <2 x i32> addrspace(1)* %out
32 ; FUNC-LABEL: {{^}}test_urem_v4i32:
35 define void @test_urem_v4i32(<4 x i32> addrspace(1)* %out, <4 x i32> addrspace(1)* %in) {
36 %b_ptr = getelementptr <4 x i32> addrspace(1)* %in, i32 1
37 %a = load <4 x i32> addrspace(1)* %in
38 %b = load <4 x i32> addrspace(1)* %b_ptr
39 %result = urem <4 x i32> %a, %b
40 store <4 x i32> %result, <4 x i32> addrspace(1)* %out
44 ; FUNC-LABEL: {{^}}test_urem_i64:
47 define void @test_urem_i64(i64 addrspace(1)* %out, i64 addrspace(1)* %in) {
48 %b_ptr = getelementptr i64 addrspace(1)* %in, i64 1
49 %a = load i64 addrspace(1)* %in
50 %b = load i64 addrspace(1)* %b_ptr
51 %result = urem i64 %a, %b
52 store i64 %result, i64 addrspace(1)* %out
56 ; FUNC-LABEL: {{^}}test_urem_v2i64:
59 define void @test_urem_v2i64(<2 x i64> addrspace(1)* %out, <2 x i64> addrspace(1)* %in) {
60 %b_ptr = getelementptr <2 x i64> addrspace(1)* %in, i64 1
61 %a = load <2 x i64> addrspace(1)* %in
62 %b = load <2 x i64> addrspace(1)* %b_ptr
63 %result = urem <2 x i64> %a, %b
64 store <2 x i64> %result, <2 x i64> addrspace(1)* %out
68 ; FUNC-LABEL: {{^}}test_urem_v4i64:
71 define void @test_urem_v4i64(<4 x i64> addrspace(1)* %out, <4 x i64> addrspace(1)* %in) {
72 %b_ptr = getelementptr <4 x i64> addrspace(1)* %in, i64 1
73 %a = load <4 x i64> addrspace(1)* %in
74 %b = load <4 x i64> addrspace(1)* %b_ptr
75 %result = urem <4 x i64> %a, %b
76 store <4 x i64> %result, <4 x i64> addrspace(1)* %out