1 ; RUN: llc < %s -mtriple=ve -mattr=+vpu | FileCheck %s
5 ; Function Attrs: nounwind
6 define fastcc <256 x i32> @add_vv_v256i32(<256 x i32> %x, <256 x i32> %y) {
7 ; CHECK-LABEL: add_vv_v256i32:
9 ; CHECK-NEXT: lea %s0, 256
11 ; CHECK-NEXT: vadds.w.sx %v0, %v0, %v1
12 ; CHECK-NEXT: b.l.t (, %s10)
13 %z = add <256 x i32> %x, %y
17 ; Function Attrs: nounwind
18 define fastcc <256 x i32> @add_sv_v256i32(i32 %x, <256 x i32> %y) {
19 ; CHECK-LABEL: add_sv_v256i32:
21 ; CHECK-NEXT: and %s0, %s0, (32)0
22 ; CHECK-NEXT: lea %s1, 256
24 ; CHECK-NEXT: vadds.w.sx %v0, %s0, %v0
25 ; CHECK-NEXT: b.l.t (, %s10)
26 %xins = insertelement <256 x i32> undef, i32 %x, i32 0
27 %vx = shufflevector <256 x i32> %xins, <256 x i32> undef, <256 x i32> zeroinitializer
28 %z = add <256 x i32> %vx, %y
32 ; Function Attrs: nounwind
33 define fastcc <256 x i32> @add_vs_v256i32(<256 x i32> %x, i32 %y) {
34 ; CHECK-LABEL: add_vs_v256i32:
36 ; CHECK-NEXT: and %s0, %s0, (32)0
37 ; CHECK-NEXT: lea %s1, 256
39 ; CHECK-NEXT: vadds.w.sx %v0, %s0, %v0
40 ; CHECK-NEXT: b.l.t (, %s10)
41 %yins = insertelement <256 x i32> undef, i32 %y, i32 0
42 %vy = shufflevector <256 x i32> %yins, <256 x i32> undef, <256 x i32> zeroinitializer
43 %z = add <256 x i32> %x, %vy
51 ; Function Attrs: nounwind
52 define fastcc <256 x i64> @add_vv_v256i64(<256 x i64> %x, <256 x i64> %y) {
53 ; CHECK-LABEL: add_vv_v256i64:
55 ; CHECK-NEXT: lea %s0, 256
57 ; CHECK-NEXT: vadds.l %v0, %v0, %v1
58 ; CHECK-NEXT: b.l.t (, %s10)
59 %z = add <256 x i64> %x, %y
63 ; Function Attrs: nounwind
64 define fastcc <256 x i64> @add_sv_v256i64(i64 %x, <256 x i64> %y) {
65 ; CHECK-LABEL: add_sv_v256i64:
67 ; CHECK-NEXT: lea %s1, 256
69 ; CHECK-NEXT: vadds.l %v0, %s0, %v0
70 ; CHECK-NEXT: b.l.t (, %s10)
71 %xins = insertelement <256 x i64> undef, i64 %x, i32 0
72 %vx = shufflevector <256 x i64> %xins, <256 x i64> undef, <256 x i32> zeroinitializer
73 %z = add <256 x i64> %vx, %y
77 ; Function Attrs: nounwind
78 define fastcc <256 x i64> @add_vs_v256i64(<256 x i64> %x, i64 %y) {
79 ; CHECK-LABEL: add_vs_v256i64:
81 ; CHECK-NEXT: lea %s1, 256
83 ; CHECK-NEXT: vadds.l %v0, %s0, %v0
84 ; CHECK-NEXT: b.l.t (, %s10)
85 %yins = insertelement <256 x i64> undef, i64 %y, i32 0
86 %vy = shufflevector <256 x i64> %yins, <256 x i64> undef, <256 x i32> zeroinitializer
87 %z = add <256 x i64> %x, %vy
92 ; We expect this to be widened.
94 ; Function Attrs: nounwind
95 define fastcc <128 x i64> @add_vv_v128i64(<128 x i64> %x, <128 x i64> %y) {
96 ; CHECK-LABEL: add_vv_v128i64:
98 ; CHECK-NEXT: lea %s0, 256
100 ; CHECK-NEXT: vadds.l %v0, %v0, %v1
101 ; CHECK-NEXT: b.l.t (, %s10)
102 %z = add <128 x i64> %x, %y
107 ; We expect promotion.
109 ; Function Attrs: nounwind
110 define fastcc <256 x i16> @add_vv_v256i16(<256 x i16> %x, <256 x i16> %y) {
111 ; CHECK-LABEL: add_vv_v256i16:
113 ; CHECK-NEXT: lea %s0, 256
114 ; CHECK-NEXT: lvl %s0
115 ; CHECK-NEXT: vadds.w.sx %v0, %v0, %v1
116 ; CHECK-NEXT: b.l.t (, %s10)
117 %z = add <256 x i16> %x, %y
122 ; We expect this to be scalarized (for now).
124 ; Function Attrs: nounwind
125 define fastcc <128 x i16> @add_vv_v128i16(<128 x i16> %x, <128 x i16> %y) {
126 ; CHECK-LABEL: add_vv_v128i16:
128 %z = add <128 x i16> %x, %y