@@ -123,8 +123,8 @@ int main(void) {
123
123
return Rdx;
124
124
125
125
{
126
- // Find the last index where A[I] > B[I] and update Rdx when the condition
127
- // is true.
126
+ // Find the last index where A[I] > B[I] and update 32-bits Rdx when the
127
+ // condition is true.
128
128
DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
129
129
int32_t Rdx = -1 ;,
130
130
DEFINE_FINDLAST_LOOP_BODY (
@@ -133,13 +133,27 @@ int main(void) {
133
133
INC_COND (/* Start= */ 0 , /* Step= */ 1 , /* RetTy= */ int32_t )),
134
134
int32_t );
135
135
checkVectorFunction<int32_t , int32_t >(ScalarFn, VectorFn,
136
- " findlast_icmp_true_update " );
136
+ " findlast_icmp_s32_true_update " );
137
137
checkVectorFunction<int32_t , float >(ScalarFn, VectorFn,
138
- " findlast_fcmp_true_update " );
138
+ " findlast_fcmp_s32_true_update " );
139
139
}
140
140
141
141
{
142
- // Update Rdx when the condition A[I] > B[I] is false.
142
+ // Find the last index where A[I] > B[I] and update 16-bits Rdx when the
143
+ // condition is true.
144
+ DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
145
+ int16_t Rdx = -1 ;,
146
+ DEFINE_FINDLAST_LOOP_BODY (
147
+ /* TrueVal= */ I, /* FalseVal= */ Rdx,
148
+ /* ForCond= */
149
+ INC_COND (/* Start= */ 0 , /* Step= */ 1 , /* RetTy= */ int16_t )),
150
+ int16_t );
151
+ checkVectorFunction<int16_t , int16_t >(ScalarFn, VectorFn,
152
+ " findlast_icmp_s16_true_update" );
153
+ }
154
+
155
+ {
156
+ // Update 32-bits Rdx when the condition A[I] > B[I] is false.
143
157
DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
144
158
int32_t Rdx = -1 ;,
145
159
DEFINE_FINDLAST_LOOP_BODY (
@@ -148,13 +162,26 @@ int main(void) {
148
162
INC_COND (/* Start= */ 0 , /* Step= */ 1 , /* RetTy= */ int32_t )),
149
163
int32_t );
150
164
checkVectorFunction<int32_t , int32_t >(ScalarFn, VectorFn,
151
- " findlast_icmp_false_update " );
165
+ " findlast_icmp_s32_false_update " );
152
166
checkVectorFunction<int32_t , float >(ScalarFn, VectorFn,
153
- " findlast_fcmp_false_update" );
167
+ " findlast_fcmp_s32_false_update" );
168
+ }
169
+
170
+ {
171
+ // Update 16-bits Rdx when the condition A[I] > B[I] is false.
172
+ DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
173
+ int16_t Rdx = -1 ;,
174
+ DEFINE_FINDLAST_LOOP_BODY (
175
+ /* TrueVal= */ Rdx, /* FalseVal= */ I,
176
+ /* ForCond= */
177
+ INC_COND (/* Start= */ 0 , /* Step= */ 1 , /* RetTy= */ int16_t )),
178
+ int16_t );
179
+ checkVectorFunction<int16_t , int16_t >(ScalarFn, VectorFn,
180
+ " findlast_icmp_s16_false_update" );
154
181
}
155
182
156
183
{
157
- // Find the last index with the start value TC.
184
+ // Find the last 32-bits index with the start value TC.
158
185
DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
159
186
int32_t Rdx = TC;,
160
187
DEFINE_FINDLAST_LOOP_BODY (
@@ -163,13 +190,26 @@ int main(void) {
163
190
INC_COND (/* Start= */ 0 , /* Step= */ 1 , /* RetTy= */ int32_t )),
164
191
int32_t );
165
192
checkVectorFunction<int32_t , int32_t >(ScalarFn, VectorFn,
166
- " findlast_icmp_start_TC " );
193
+ " findlast_icmp_s32_start_TC " );
167
194
checkVectorFunction<int32_t , float >(ScalarFn, VectorFn,
168
- " findlast_fcmp_start_TC " );
195
+ " findlast_fcmp_s32_start_TC " );
169
196
}
170
197
171
198
{
172
- // Increment the induction variable by 2.
199
+ // Find the last 16-bits index with the start value TC.
200
+ DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
201
+ int16_t Rdx = TC;,
202
+ DEFINE_FINDLAST_LOOP_BODY (
203
+ /* TrueVal= */ I, /* FalseVal= */ Rdx,
204
+ /* ForCond= */
205
+ INC_COND (/* Start= */ 0 , /* Step= */ 1 , /* RetTy= */ int16_t )),
206
+ int16_t );
207
+ checkVectorFunction<int16_t , int16_t >(ScalarFn, VectorFn,
208
+ " findlast_icmp_s16_start_TC" );
209
+ }
210
+
211
+ {
212
+ // Increment the 32-bits induction variable by 2.
173
213
DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
174
214
int32_t Rdx = -1 ;,
175
215
DEFINE_FINDLAST_LOOP_BODY (
@@ -178,13 +218,26 @@ int main(void) {
178
218
INC_COND (/* Start= */ 0 , /* Step= */ 2 , /* RetTy= */ int32_t )),
179
219
int32_t );
180
220
checkVectorFunction<int32_t , int32_t >(ScalarFn, VectorFn,
181
- " findlast_icmp_inc_2 " );
221
+ " findlast_icmp_s32_inc_2 " );
182
222
checkVectorFunction<int32_t , float >(ScalarFn, VectorFn,
183
- " findlast_fcmp_inc_2 " );
223
+ " findlast_fcmp_s32_inc_2 " );
184
224
}
185
225
186
226
{
187
- // Check with decreasing induction variable.
227
+ // Increment the 16-bits induction variable by 2.
228
+ DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
229
+ int16_t Rdx = -1 ;,
230
+ DEFINE_FINDLAST_LOOP_BODY (
231
+ /* TrueVal= */ I, /* FalseVal= */ Rdx,
232
+ /* ForCond= */
233
+ INC_COND (/* Start= */ 0 , /* Step= */ 2 , /* RetTy= */ int16_t )),
234
+ int16_t );
235
+ checkVectorFunction<int16_t , int16_t >(ScalarFn, VectorFn,
236
+ " findlast_icmp_s16_inc_2" );
237
+ }
238
+
239
+ {
240
+ // Check with decreasing 32-bits induction variable.
188
241
DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
189
242
int32_t Rdx = -1 ;,
190
243
DEFINE_FINDLAST_LOOP_BODY (
@@ -193,13 +246,26 @@ int main(void) {
193
246
DEC_COND (/* End= */ 0 , /* Step= */ 1 , /* RetTy= */ int32_t )),
194
247
int32_t );
195
248
checkVectorFunction<int32_t , int32_t >(
196
- ScalarFn, VectorFn, " findlast_icmp_start_decreasing_induction " );
249
+ ScalarFn, VectorFn, " findlast_icmp_s32_start_decreasing_induction " );
197
250
checkVectorFunction<int32_t , float >(
198
- ScalarFn, VectorFn, " findlast_fcmp_start_decreasing_induction" );
251
+ ScalarFn, VectorFn, " findlast_fcmp_s32_start_decreasing_induction" );
252
+ }
253
+
254
+ {
255
+ // Check with decreasing 16-bits induction variable.
256
+ DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
257
+ int16_t Rdx = -1 ;,
258
+ DEFINE_FINDLAST_LOOP_BODY (
259
+ /* TrueVal= */ I, /* FalseVal= */ Rdx,
260
+ /* ForCond= */
261
+ DEC_COND (/* End= */ 0 , /* Step= */ 1 , /* RetTy= */ int16_t )),
262
+ int16_t );
263
+ checkVectorFunction<int16_t , int16_t >(
264
+ ScalarFn, VectorFn, " findlast_icmp_s16_start_decreasing_induction" );
199
265
}
200
266
201
267
{
202
- // Check with the induction variable starts from 3.
268
+ // Check with 32-bits the induction variable starts from 3.
203
269
DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
204
270
int32_t Rdx = -1 ;,
205
271
DEFINE_FINDLAST_LOOP_BODY (
@@ -208,54 +274,106 @@ int main(void) {
208
274
INC_COND (/* Start= */ 3 , /* Step= */ 1 , /* RetTy= */ int32_t )),
209
275
int32_t );
210
276
checkVectorFunction<int32_t , int32_t >(ScalarFn, VectorFn,
211
- " findlast_icmp_iv_start_3 " );
277
+ " findlast_icmp_s32_iv_start_3 " );
212
278
checkVectorFunction<int32_t , float >(ScalarFn, VectorFn,
213
- " findlast_fcmp_iv_start_3 " );
279
+ " findlast_fcmp_s32_iv_start_3 " );
214
280
}
215
281
216
282
{
217
- // Check with start value of 3 and induction variable starts at 3.
283
+ // Check with 16-bits the induction variable starts from 3.
284
+ DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
285
+ int16_t Rdx = -1 ;,
286
+ DEFINE_FINDLAST_LOOP_BODY (
287
+ /* TrueVal= */ I, /* FalseVal= */ Rdx,
288
+ /* ForCond= */
289
+ INC_COND (/* Start= */ 3 , /* Step= */ 1 , /* RetTy= */ int16_t )),
290
+ int16_t );
291
+ checkVectorFunction<int16_t , int16_t >(ScalarFn, VectorFn,
292
+ " findlast_icmp_s16_iv_start_3" );
293
+ }
294
+
295
+ {
296
+ // Check with start value of 3 and 32-bits induction variable starts at 3.
218
297
DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
219
298
int32_t Rdx = 3 ;,
220
299
DEFINE_FINDLAST_LOOP_BODY (
221
300
/* TrueVal= */ I, /* FalseVal= */ Rdx,
222
301
/* ForCond= */
223
302
INC_COND (/* Start= */ 3 , /* Step= */ 1 , /* RetTy= */ int32_t )),
224
303
int32_t );
225
- checkVectorFunction<int32_t , int32_t >(ScalarFn, VectorFn,
226
- " findlast_icmp_start_3_iv_start_3 " );
304
+ checkVectorFunction<int32_t , int32_t >(
305
+ ScalarFn, VectorFn, " findlast_icmp_s32_start_3_iv_start_3 " );
227
306
checkVectorFunction<int32_t , float >(ScalarFn, VectorFn,
228
- " findlast_fcmp_start_3_iv_start_3 " );
307
+ " findlast_fcmp_s32_start_3_iv_start_3 " );
229
308
}
230
309
231
310
{
232
- // Check with start value of 2 and induction variable starts at 3.
311
+ // Check with start value of 3 and 16-bits induction variable starts at 3.
312
+ DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
313
+ int16_t Rdx = 3 ;,
314
+ DEFINE_FINDLAST_LOOP_BODY (
315
+ /* TrueVal= */ I, /* FalseVal= */ Rdx,
316
+ /* ForCond= */
317
+ INC_COND (/* Start= */ 3 , /* Step= */ 1 , /* RetTy= */ int16_t )),
318
+ int16_t );
319
+ checkVectorFunction<int16_t , int16_t >(
320
+ ScalarFn, VectorFn, " findlast_icmp_s16_start_3_iv_start_3" );
321
+ }
322
+
323
+ {
324
+ // Check with start value of 2 and 32-bits induction variable starts at 3.
233
325
DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
234
326
int32_t Rdx = 2 ;,
235
327
DEFINE_FINDLAST_LOOP_BODY (
236
328
/* TrueVal= */ I, /* FalseVal= */ Rdx,
237
329
/* ForCond= */
238
330
INC_COND (/* Start= */ 3 , /* Step= */ 1 , /* RetTy= */ int32_t )),
239
331
int32_t );
240
- checkVectorFunction<int32_t , int32_t >(ScalarFn, VectorFn,
241
- " findlast_icmp_start_2_iv_start_3 " );
332
+ checkVectorFunction<int32_t , int32_t >(
333
+ ScalarFn, VectorFn, " findlast_icmp_s32_start_2_iv_start_3 " );
242
334
checkVectorFunction<int32_t , float >(ScalarFn, VectorFn,
243
- " findlast_fcmp_start_2_iv_start_3 " );
335
+ " findlast_fcmp_s32_start_2_iv_start_3 " );
244
336
}
245
337
246
338
{
247
- // Check with start value of 4 and induction variable starts at 3.
339
+ // Check with start value of 2 and 16-bits induction variable starts at 3.
340
+ DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
341
+ int16_t Rdx = 2 ;,
342
+ DEFINE_FINDLAST_LOOP_BODY (
343
+ /* TrueVal= */ I, /* FalseVal= */ Rdx,
344
+ /* ForCond= */
345
+ INC_COND (/* Start= */ 3 , /* Step= */ 1 , /* RetTy= */ int16_t )),
346
+ int16_t );
347
+ checkVectorFunction<int16_t , int16_t >(
348
+ ScalarFn, VectorFn, " findlast_icmp_s16_start_2_iv_start_3" );
349
+ }
350
+
351
+ {
352
+ // Check with start value of 4 and 32-bits induction variable starts at 3.
248
353
DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
249
354
int32_t Rdx = 4 ;,
250
355
DEFINE_FINDLAST_LOOP_BODY (
251
356
/* TrueVal= */ I, /* FalseVal= */ Rdx,
252
357
/* ForCond= */
253
358
INC_COND (/* Start= */ 3 , /* Step= */ 1 , /* RetTy= */ int32_t )),
254
359
int32_t );
255
- checkVectorFunction<int32_t , int32_t >(ScalarFn, VectorFn,
256
- " findlast_icmp_start_4_iv_start_3 " );
360
+ checkVectorFunction<int32_t , int32_t >(
361
+ ScalarFn, VectorFn, " findlast_icmp_s32_start_4_iv_start_3 " );
257
362
checkVectorFunction<int32_t , float >(ScalarFn, VectorFn,
258
- " findlast_fcmp_start_4_iv_start_3" );
363
+ " findlast_fcmp_s32_start_4_iv_start_3" );
364
+ }
365
+
366
+ {
367
+ // Check with start value of 4 and 16-bits induction variable starts at 3.
368
+ DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
369
+ int16_t Rdx = 4 ;,
370
+ DEFINE_FINDLAST_LOOP_BODY (
371
+ /* TrueVal= */ I, /* FalseVal= */ Rdx,
372
+ /* ForCond= */
373
+ INC_COND (/* Start= */ 3 , /* Step= */ 1 , /* RetTy= */ int16_t )),
374
+ int16_t );
375
+ checkVectorFunction<int16_t , int16_t >(
376
+ ScalarFn, VectorFn, " findlast_icmp_s16_start_4_iv_start_3" );
259
377
}
260
378
261
379
return 0 ;
0 commit comments