1; RUN: llc -march=r600 -mcpu=SI < %s 2; RUN: llc -march=r600 -mcpu=redwood < %s 3 4define void @srem_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %in) { 5 %den_ptr = getelementptr i32 addrspace(1)* %in, i32 1 6 %num = load i32 addrspace(1) * %in 7 %den = load i32 addrspace(1) * %den_ptr 8 %result = srem i32 %num, %den 9 store i32 %result, i32 addrspace(1)* %out 10 ret void 11} 12 13define void @srem_i32_4(i32 addrspace(1)* %out, i32 addrspace(1)* %in) { 14 %num = load i32 addrspace(1) * %in 15 %result = srem i32 %num, 4 16 store i32 %result, i32 addrspace(1)* %out 17 ret void 18} 19 20define void @srem_v2i32(<2 x i32> addrspace(1)* %out, <2 x i32> addrspace(1)* %in) { 21 %den_ptr = getelementptr <2 x i32> addrspace(1)* %in, i32 1 22 %num = load <2 x i32> addrspace(1) * %in 23 %den = load <2 x i32> addrspace(1) * %den_ptr 24 %result = srem <2 x i32> %num, %den 25 store <2 x i32> %result, <2 x i32> addrspace(1)* %out 26 ret void 27} 28 29define void @srem_v2i32_4(<2 x i32> addrspace(1)* %out, <2 x i32> addrspace(1)* %in) { 30 %num = load <2 x i32> addrspace(1) * %in 31 %result = srem <2 x i32> %num, <i32 4, i32 4> 32 store <2 x i32> %result, <2 x i32> addrspace(1)* %out 33 ret void 34} 35 36define void @srem_v4i32(<4 x i32> addrspace(1)* %out, <4 x i32> addrspace(1)* %in) { 37 %den_ptr = getelementptr <4 x i32> addrspace(1)* %in, i32 1 38 %num = load <4 x i32> addrspace(1) * %in 39 %den = load <4 x i32> addrspace(1) * %den_ptr 40 %result = srem <4 x i32> %num, %den 41 store <4 x i32> %result, <4 x i32> addrspace(1)* %out 42 ret void 43} 44 45define void @srem_v4i32_4(<4 x i32> addrspace(1)* %out, <4 x i32> addrspace(1)* %in) { 46 %num = load <4 x i32> addrspace(1) * %in 47 %result = srem <4 x i32> %num, <i32 4, i32 4, i32 4, i32 4> 48 store <4 x i32> %result, <4 x i32> addrspace(1)* %out 49 ret void 50} 51