1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -march=ve -mattr=+vpu | FileCheck %s
4 declare <256 x i32> @llvm.vp.srem.v256i32(<256 x i32>, <256 x i32>, <256 x i1>, i32)
6 define fastcc <256 x i32> @test_vp_srem_v256i32_vv(<256 x i32> %i0, <256 x i32> %i1, <256 x i1> %m, i32 %n) {
7 ; CHECK-LABEL: test_vp_srem_v256i32_vv:
9 ; CHECK-NEXT: and %s0, %s0, (32)0
11 ; CHECK-NEXT: vdivs.w.sx %v2, %v0, %v1, %vm1
12 ; CHECK-NEXT: vmuls.w.sx %v1, %v1, %v2, %vm1
13 ; CHECK-NEXT: vsubs.w.sx %v0, %v0, %v1, %vm1
14 ; CHECK-NEXT: b.l.t (, %s10)
15 %r0 = call <256 x i32> @llvm.vp.srem.v256i32(<256 x i32> %i0, <256 x i32> %i1, <256 x i1> %m, i32 %n)
19 define fastcc <256 x i32> @test_vp_srem_v256i32_rv(i32 %s0, <256 x i32> %i1, <256 x i1> %m, i32 %n) {
20 ; CHECK-LABEL: test_vp_srem_v256i32_rv:
22 ; CHECK-NEXT: and %s1, %s1, (32)0
23 ; CHECK-NEXT: and %s0, %s0, (32)0
25 ; CHECK-NEXT: vdivs.w.sx %v1, %s0, %v0, %vm1
26 ; CHECK-NEXT: vmuls.w.sx %v0, %v0, %v1, %vm1
27 ; CHECK-NEXT: vsubs.w.sx %v0, %s0, %v0, %vm1
28 ; CHECK-NEXT: b.l.t (, %s10)
29 %xins = insertelement <256 x i32> undef, i32 %s0, i32 0
30 %i0 = shufflevector <256 x i32> %xins, <256 x i32> undef, <256 x i32> zeroinitializer
31 %r0 = call <256 x i32> @llvm.vp.srem.v256i32(<256 x i32> %i0, <256 x i32> %i1, <256 x i1> %m, i32 %n)
35 define fastcc <256 x i32> @test_vp_srem_v256i32_vr(<256 x i32> %i0, i32 %s1, <256 x i1> %m, i32 %n) {
36 ; CHECK-LABEL: test_vp_srem_v256i32_vr:
38 ; CHECK-NEXT: and %s1, %s1, (32)0
39 ; CHECK-NEXT: and %s0, %s0, (32)0
41 ; CHECK-NEXT: vdivs.w.sx %v1, %v0, %s0, %vm1
42 ; CHECK-NEXT: vmuls.w.sx %v1, %s0, %v1, %vm1
43 ; CHECK-NEXT: vsubs.w.sx %v0, %v0, %v1, %vm1
44 ; CHECK-NEXT: b.l.t (, %s10)
45 %yins = insertelement <256 x i32> undef, i32 %s1, i32 0
46 %i1 = shufflevector <256 x i32> %yins, <256 x i32> undef, <256 x i32> zeroinitializer
47 %r0 = call <256 x i32> @llvm.vp.srem.v256i32(<256 x i32> %i0, <256 x i32> %i1, <256 x i1> %m, i32 %n)
52 declare <256 x i64> @llvm.vp.srem.v256i64(<256 x i64>, <256 x i64>, <256 x i1>, i32)
54 define fastcc <256 x i64> @test_vp_int_v256i64_vv(<256 x i64> %i0, <256 x i64> %i1, <256 x i1> %m, i32 %n) {
55 ; CHECK-LABEL: test_vp_int_v256i64_vv:
57 ; CHECK-NEXT: and %s0, %s0, (32)0
59 ; CHECK-NEXT: vdivs.l %v2, %v0, %v1, %vm1
60 ; CHECK-NEXT: vmuls.l %v1, %v1, %v2, %vm1
61 ; CHECK-NEXT: vsubs.l %v0, %v0, %v1, %vm1
62 ; CHECK-NEXT: b.l.t (, %s10)
63 %r0 = call <256 x i64> @llvm.vp.srem.v256i64(<256 x i64> %i0, <256 x i64> %i1, <256 x i1> %m, i32 %n)
67 define fastcc <256 x i64> @test_vp_srem_v256i64_rv(i64 %s0, <256 x i64> %i1, <256 x i1> %m, i32 %n) {
68 ; CHECK-LABEL: test_vp_srem_v256i64_rv:
70 ; CHECK-NEXT: and %s1, %s1, (32)0
72 ; CHECK-NEXT: vdivs.l %v1, %s0, %v0, %vm1
73 ; CHECK-NEXT: vmuls.l %v0, %v0, %v1, %vm1
74 ; CHECK-NEXT: vsubs.l %v0, %s0, %v0, %vm1
75 ; CHECK-NEXT: b.l.t (, %s10)
76 %xins = insertelement <256 x i64> undef, i64 %s0, i32 0
77 %i0 = shufflevector <256 x i64> %xins, <256 x i64> undef, <256 x i32> zeroinitializer
78 %r0 = call <256 x i64> @llvm.vp.srem.v256i64(<256 x i64> %i0, <256 x i64> %i1, <256 x i1> %m, i32 %n)
82 define fastcc <256 x i64> @test_vp_srem_v256i64_vr(<256 x i64> %i0, i64 %s1, <256 x i1> %m, i32 %n) {
83 ; CHECK-LABEL: test_vp_srem_v256i64_vr:
85 ; CHECK-NEXT: and %s1, %s1, (32)0
87 ; CHECK-NEXT: vdivs.l %v1, %v0, %s0, %vm1
88 ; CHECK-NEXT: vmuls.l %v1, %s0, %v1, %vm1
89 ; CHECK-NEXT: vsubs.l %v0, %v0, %v1, %vm1
90 ; CHECK-NEXT: b.l.t (, %s10)
91 %yins = insertelement <256 x i64> undef, i64 %s1, i32 0
92 %i1 = shufflevector <256 x i64> %yins, <256 x i64> undef, <256 x i32> zeroinitializer
93 %r0 = call <256 x i64> @llvm.vp.srem.v256i64(<256 x i64> %i0, <256 x i64> %i1, <256 x i1> %m, i32 %n)