@@ -123,8 +123,8 @@ int main(void) {
123123 return Rdx;
124124
125125 {
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.
128128 DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
129129 int32_t Rdx = -1 ;,
130130 DEFINE_FINDLAST_LOOP_BODY (
@@ -133,13 +133,27 @@ int main(void) {
133133 INC_COND (/* Start= */ 0 , /* Step= */ 1 , /* RetTy= */ int32_t )),
134134 int32_t );
135135 checkVectorFunction<int32_t , int32_t >(ScalarFn, VectorFn,
136- " findlast_icmp_true_update " );
136+ " findlast_icmp_s32_true_update " );
137137 checkVectorFunction<int32_t , float >(ScalarFn, VectorFn,
138- " findlast_fcmp_true_update " );
138+ " findlast_fcmp_s32_true_update " );
139139 }
140140
141141 {
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.
143157 DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
144158 int32_t Rdx = -1 ;,
145159 DEFINE_FINDLAST_LOOP_BODY (
@@ -148,13 +162,26 @@ int main(void) {
148162 INC_COND (/* Start= */ 0 , /* Step= */ 1 , /* RetTy= */ int32_t )),
149163 int32_t );
150164 checkVectorFunction<int32_t , int32_t >(ScalarFn, VectorFn,
151- " findlast_icmp_false_update " );
165+ " findlast_icmp_s32_false_update " );
152166 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" );
154181 }
155182
156183 {
157- // Find the last index with the start value TC.
184+ // Find the last 32-bits index with the start value TC.
158185 DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
159186 int32_t Rdx = TC;,
160187 DEFINE_FINDLAST_LOOP_BODY (
@@ -163,13 +190,26 @@ int main(void) {
163190 INC_COND (/* Start= */ 0 , /* Step= */ 1 , /* RetTy= */ int32_t )),
164191 int32_t );
165192 checkVectorFunction<int32_t , int32_t >(ScalarFn, VectorFn,
166- " findlast_icmp_start_TC " );
193+ " findlast_icmp_s32_start_TC " );
167194 checkVectorFunction<int32_t , float >(ScalarFn, VectorFn,
168- " findlast_fcmp_start_TC " );
195+ " findlast_fcmp_s32_start_TC " );
169196 }
170197
171198 {
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.
173213 DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
174214 int32_t Rdx = -1 ;,
175215 DEFINE_FINDLAST_LOOP_BODY (
@@ -178,13 +218,26 @@ int main(void) {
178218 INC_COND (/* Start= */ 0 , /* Step= */ 2 , /* RetTy= */ int32_t )),
179219 int32_t );
180220 checkVectorFunction<int32_t , int32_t >(ScalarFn, VectorFn,
181- " findlast_icmp_inc_2 " );
221+ " findlast_icmp_s32_inc_2 " );
182222 checkVectorFunction<int32_t , float >(ScalarFn, VectorFn,
183- " findlast_fcmp_inc_2 " );
223+ " findlast_fcmp_s32_inc_2 " );
184224 }
185225
186226 {
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.
188241 DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
189242 int32_t Rdx = -1 ;,
190243 DEFINE_FINDLAST_LOOP_BODY (
@@ -193,13 +246,26 @@ int main(void) {
193246 DEC_COND (/* End= */ 0 , /* Step= */ 1 , /* RetTy= */ int32_t )),
194247 int32_t );
195248 checkVectorFunction<int32_t , int32_t >(
196- ScalarFn, VectorFn, " findlast_icmp_start_decreasing_induction " );
249+ ScalarFn, VectorFn, " findlast_icmp_s32_start_decreasing_induction " );
197250 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" );
199265 }
200266
201267 {
202- // Check with the induction variable starts from 3.
268+ // Check with 32-bits the induction variable starts from 3.
203269 DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
204270 int32_t Rdx = -1 ;,
205271 DEFINE_FINDLAST_LOOP_BODY (
@@ -208,54 +274,106 @@ int main(void) {
208274 INC_COND (/* Start= */ 3 , /* Step= */ 1 , /* RetTy= */ int32_t )),
209275 int32_t );
210276 checkVectorFunction<int32_t , int32_t >(ScalarFn, VectorFn,
211- " findlast_icmp_iv_start_3 " );
277+ " findlast_icmp_s32_iv_start_3 " );
212278 checkVectorFunction<int32_t , float >(ScalarFn, VectorFn,
213- " findlast_fcmp_iv_start_3 " );
279+ " findlast_fcmp_s32_iv_start_3 " );
214280 }
215281
216282 {
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.
218297 DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
219298 int32_t Rdx = 3 ;,
220299 DEFINE_FINDLAST_LOOP_BODY (
221300 /* TrueVal= */ I, /* FalseVal= */ Rdx,
222301 /* ForCond= */
223302 INC_COND (/* Start= */ 3 , /* Step= */ 1 , /* RetTy= */ int32_t )),
224303 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 " );
227306 checkVectorFunction<int32_t , float >(ScalarFn, VectorFn,
228- " findlast_fcmp_start_3_iv_start_3 " );
307+ " findlast_fcmp_s32_start_3_iv_start_3 " );
229308 }
230309
231310 {
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.
233325 DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
234326 int32_t Rdx = 2 ;,
235327 DEFINE_FINDLAST_LOOP_BODY (
236328 /* TrueVal= */ I, /* FalseVal= */ Rdx,
237329 /* ForCond= */
238330 INC_COND (/* Start= */ 3 , /* Step= */ 1 , /* RetTy= */ int32_t )),
239331 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 " );
242334 checkVectorFunction<int32_t , float >(ScalarFn, VectorFn,
243- " findlast_fcmp_start_2_iv_start_3 " );
335+ " findlast_fcmp_s32_start_2_iv_start_3 " );
244336 }
245337
246338 {
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.
248353 DEFINE_SCALAR_AND_VECTOR_FN2_TYPE (
249354 int32_t Rdx = 4 ;,
250355 DEFINE_FINDLAST_LOOP_BODY (
251356 /* TrueVal= */ I, /* FalseVal= */ Rdx,
252357 /* ForCond= */
253358 INC_COND (/* Start= */ 3 , /* Step= */ 1 , /* RetTy= */ int32_t )),
254359 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 " );
257362 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" );
259377 }
260378
261379 return 0 ;
0 commit comments