1 ; RUN: llc < %s -mtriple=ve-unknown-unknown | FileCheck %s
3 define signext i8 @func8s(i8 signext %a, i8 signext %b) {
6 ; CHECK-NEXT: nnd %s0, %s0, %s1
7 ; CHECK-NEXT: b.l.t (, %s10)
13 define zeroext i8 @func8z(i8 zeroext %a, i8 zeroext %b) {
14 ; CHECK-LABEL: func8z:
16 ; CHECK-NEXT: nnd %s0, %s0, %s1
17 ; CHECK-NEXT: b.l.t (, %s10)
19 %res = and i8 %b, %not
23 define signext i8 @funci8s(i8 signext %a) {
24 ; CHECK-LABEL: funci8s:
26 ; CHECK-NEXT: or %s1, 5, (0)1
27 ; CHECK-NEXT: nnd %s0, %s0, %s1
28 ; CHECK-NEXT: b.l.t (, %s10)
34 define zeroext i8 @funci8z(i8 zeroext %a) {
35 ; CHECK-LABEL: funci8z:
37 ; CHECK-NEXT: lea %s1, 251
38 ; CHECK-NEXT: nnd %s0, %s0, %s1
39 ; CHECK-NEXT: b.l.t (, %s10)
41 %res = and i8 -5, %not
45 define signext i16 @func16s(i16 signext %a, i16 signext %b) {
46 ; CHECK-LABEL: func16s:
48 ; CHECK-NEXT: nnd %s0, %s0, %s1
49 ; CHECK-NEXT: b.l.t (, %s10)
51 %res = and i16 %not, %b
55 define zeroext i16 @func16z(i16 zeroext %a, i16 zeroext %b) {
56 ; CHECK-LABEL: func16z:
58 ; CHECK-NEXT: nnd %s0, %s0, %s1
59 ; CHECK-NEXT: b.l.t (, %s10)
61 %res = and i16 %b, %not
65 define signext i16 @funci16s(i16 signext %a) {
66 ; CHECK-LABEL: funci16s:
68 ; CHECK-NEXT: xor %s0, -1, %s0
69 ; CHECK-NEXT: b.l.t (, %s10)
71 %res = and i16 %not, 65535
75 define zeroext i16 @funci16z(i16 zeroext %a) {
76 ; CHECK-LABEL: funci16z:
78 ; CHECK-NEXT: nnd %s0, %s0, (52)0
79 ; CHECK-NEXT: b.l.t (, %s10)
81 %res = and i16 4095, %not
85 define signext i32 @func32s(i32 signext %a, i32 signext %b) {
86 ; CHECK-LABEL: func32s:
88 ; CHECK-NEXT: nnd %s0, %s0, %s1
89 ; CHECK-NEXT: b.l.t (, %s10)
91 %res = and i32 %not, %b
95 define zeroext i32 @func32z(i32 zeroext %a, i32 zeroext %b) {
96 ; CHECK-LABEL: func32z:
98 ; CHECK-NEXT: nnd %s0, %s0, %s1
99 ; CHECK-NEXT: b.l.t (, %s10)
100 %not = xor i32 %a, -1
101 %res = and i32 %not, %b
105 define signext i32 @funci32s(i32 signext %a) {
106 ; CHECK-LABEL: funci32s:
108 ; CHECK-NEXT: nnd %s0, %s0, (36)0
109 ; CHECK-NEXT: b.l.t (, %s10)
110 %not = xor i32 %a, -1
111 %res = and i32 %not, 268435455
115 define zeroext i32 @funci32z(i32 zeroext %a) {
116 ; CHECK-LABEL: funci32z:
118 ; CHECK-NEXT: nnd %s0, %s0, (36)0
119 ; CHECK-NEXT: b.l.t (, %s10)
120 %not = xor i32 %a, -1
121 %res = and i32 %not, 268435455
125 define i64 @func64(i64 %a, i64 %b) {
126 ; CHECK-LABEL: func64:
128 ; CHECK-NEXT: nnd %s0, %s0, %s1
129 ; CHECK-NEXT: b.l.t (, %s10)
130 %not = xor i64 %a, -1
131 %res = and i64 %not, %b
135 define i64 @func64_2(i64 %a, i64 %b) {
136 ; CHECK-LABEL: func64_2:
138 ; CHECK-NEXT: nnd %s0, %s1, %s0
139 ; CHECK-NEXT: b.l.t (, %s10)
140 %not = xor i64 %b, -1
141 %res = and i64 %not, %a
145 define i64 @func64i(i64 %a) {
146 ; CHECK-LABEL: func64i:
148 ; CHECK-NEXT: nnd %s0, %s0, (24)0
149 ; CHECK-NEXT: b.l.t (, %s10)
150 %not = xor i64 %a, -1
151 %res = and i64 %not, 1099511627775
155 define i128 @func128(i128 %a, i128 %b) {
156 ; CHECK-LABEL: func128:
158 ; CHECK-NEXT: nnd %s0, %s0, %s2
159 ; CHECK-NEXT: nnd %s1, %s1, %s3
160 ; CHECK-NEXT: b.l.t (, %s10)
161 %not = xor i128 %a, -1
162 %res = and i128 %b, %not
166 define i128 @funci128(i128 %a) {
167 ; CHECK-LABEL: funci128:
169 ; CHECK-NEXT: or %s1, 5, (0)1
170 ; CHECK-NEXT: nnd %s0, %s0, %s1
171 ; CHECK-NEXT: or %s1, 0, (0)1
172 ; CHECK-NEXT: b.l.t (, %s10)
173 %not = xor i128 %a, -1
174 %res = and i128 %not, 5
178 define i64 @func64_nnd_fold(i64 %x, i64 %y, i64 %m) {
179 ; CHECK-LABEL: func64_nnd_fold:
181 ; CHECK-NEXT: nnd %s1, %s2, %s1
182 ; CHECK-NEXT: and %s0, %s0, %s2
183 ; CHECK-NEXT: or %s0, %s0, %s1
184 ; CHECK-NEXT: b.l.t (, %s10)
187 %res = xor i64 %A, %y
191 define i64 @func64iy_nnd_fold(i64 %x, i64 %m) {
192 ; CHECK-LABEL: func64iy_nnd_fold:
194 ; CHECK-NEXT: nnd %s0, %s0, %s1
195 ; CHECK-NEXT: or %s1, -64, %s1
196 ; CHECK-NEXT: nnd %s0, %s0, %s1
197 ; CHECK-NEXT: b.l.t (, %s10)
200 %res = xor i64 %A, -64
204 define i64 @func64im_nnd_fold(i64 %x, i64 %y) {
205 ; CHECK-LABEL: func64im_nnd_fold:
207 ; CHECK-NEXT: xor %s0, %s0, %s1
208 ; CHECK-NEXT: and %s0, 30, %s0
209 ; CHECK-NEXT: xor %s0, %s0, %s1
210 ; CHECK-NEXT: b.l.t (, %s10)
213 %res = xor i64 %A, %y