11/*
22 * Copyright (c) 2025, Arm Limited. All rights reserved.
3+ * Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
34 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
45 *
56 * This code is free software; you can redistribute it and/or modify it
@@ -185,8 +186,14 @@ public static void selectFromTwoVector_Byte64() {
185186
186187 @ Test
187188 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VB , IRNode .VECTOR_SIZE_16 , ">0" },
188- applyIfCPUFeature = {"asimd" , "true" },
189+ applyIfCPUFeatureAnd = {"asimd" , "true" , "sve2" , "false " },
189190 applyIf = {"MaxVectorSize" , ">=16" })
191+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VB , IRNode .VECTOR_SIZE_16 , ">0" },
192+ applyIfCPUFeature = {"sve2" , "true" },
193+ applyIf = {"MaxVectorSize" , "16" })
194+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VB , IRNode .VECTOR_SIZE_16 , "0" },
195+ applyIfCPUFeature = {"sve2" , "true" },
196+ applyIf = {"MaxVectorSize" , ">16" })
190197 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VB , IRNode .VECTOR_SIZE_16 , ">0" },
191198 applyIfCPUFeatureAnd = {"avx512_vbmi" , "true" , "avx512vl" , "true" },
192199 applyIf = {"MaxVectorSize" , ">=16" })
@@ -200,7 +207,10 @@ public static void selectFromTwoVector_Byte128() {
200207 applyIf = {"MaxVectorSize" , ">=32" })
201208 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VB , IRNode .VECTOR_SIZE_32 , ">0" },
202209 applyIfCPUFeature = {"sve2" , "true" },
203- applyIf = {"MaxVectorSize" , ">=32" })
210+ applyIf = {"MaxVectorSize" , "32" })
211+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VB , IRNode .VECTOR_SIZE_32 , "0" },
212+ applyIfCPUFeature = {"sve2" , "true" },
213+ applyIf = {"MaxVectorSize" , ">32" })
204214 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VB , IRNode .VECTOR_SIZE_32 , ">0" },
205215 applyIfCPUFeatureAnd = {"avx512_vbmi" , "true" , "avx512vl" , "true" },
206216 applyIf = {"MaxVectorSize" , ">=32" })
@@ -214,7 +224,10 @@ public static void selectFromTwoVector_Byte256() {
214224 applyIf = {"MaxVectorSize" , ">=64" })
215225 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VB , IRNode .VECTOR_SIZE_64 , ">0" },
216226 applyIfCPUFeature = {"sve2" , "true" },
217- applyIf = {"MaxVectorSize" , ">=64" })
227+ applyIf = {"MaxVectorSize" , "64" })
228+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VB , IRNode .VECTOR_SIZE_64 , "0" },
229+ applyIfCPUFeature = {"sve2" , "true" },
230+ applyIf = {"MaxVectorSize" , ">64" })
218231 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VB , IRNode .VECTOR_SIZE_64 , ">0" },
219232 applyIfCPUFeatureAnd = {"avx512_vbmi" , "true" , "avx512f" , "true" },
220233 applyIf = {"MaxVectorSize" , ">=64" })
@@ -248,7 +261,10 @@ public static void selectFromTwoVector_Short64() {
248261 applyIf = {"MaxVectorSize" , ">=16" })
249262 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VS , IRNode .VECTOR_SIZE_8 , ">0" },
250263 applyIfCPUFeature = {"sve2" , "true" },
251- applyIf = {"MaxVectorSize" , ">=16" })
264+ applyIf = {"MaxVectorSize" , "16" })
265+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VS , IRNode .VECTOR_SIZE_8 , "0" },
266+ applyIfCPUFeature = {"sve2" , "true" },
267+ applyIf = {"MaxVectorSize" , ">16" })
252268 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VS , IRNode .VECTOR_SIZE_8 , ">0" },
253269 applyIfCPUFeatureAnd = {"avx512bw" , "true" , "avx512vl" , "true" },
254270 applyIf = {"MaxVectorSize" , ">=16" })
@@ -262,7 +278,10 @@ public static void selectFromTwoVector_Short128() {
262278 applyIf = {"MaxVectorSize" , ">=32" })
263279 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VS , IRNode .VECTOR_SIZE_16 , ">0" },
264280 applyIfCPUFeature = {"sve2" , "true" },
265- applyIf = {"MaxVectorSize" , ">=32" })
281+ applyIf = {"MaxVectorSize" , "32" })
282+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VS , IRNode .VECTOR_SIZE_16 , "0" },
283+ applyIfCPUFeature = {"sve2" , "true" },
284+ applyIf = {"MaxVectorSize" , ">32" })
266285 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VS , IRNode .VECTOR_SIZE_16 , ">0" },
267286 applyIfCPUFeatureAnd = {"avx512bw" , "true" , "avx512vl" , "true" },
268287 applyIf = {"MaxVectorSize" , ">=32" })
@@ -276,7 +295,10 @@ public static void selectFromTwoVector_Short256() {
276295 applyIf = {"MaxVectorSize" , ">=64" })
277296 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VS , IRNode .VECTOR_SIZE_32 , ">0" },
278297 applyIfCPUFeature = {"sve2" , "true" },
279- applyIf = {"MaxVectorSize" , ">=64" })
298+ applyIf = {"MaxVectorSize" , "64" })
299+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VS , IRNode .VECTOR_SIZE_32 , "0" },
300+ applyIfCPUFeature = {"sve2" , "true" },
301+ applyIf = {"MaxVectorSize" , ">64" })
280302 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VS , IRNode .VECTOR_SIZE_32 , ">0" },
281303 applyIfCPUFeatureAnd = {"avx512bw" , "true" , "avx512f" , "true" },
282304 applyIf = {"MaxVectorSize" , ">=64" })
@@ -309,7 +331,13 @@ public static void selectFromTwoVector_Int64() {
309331 applyIfCPUFeatureAnd = {"asimd" , "true" , "sve2" , "false" },
310332 applyIf = {"MaxVectorSize" , ">=16" })
311333 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VI , IRNode .VECTOR_SIZE_4 , ">0" },
312- applyIfCPUFeatureOr = {"sve2" , "true" , "avx512vl" , "true" },
334+ applyIfCPUFeature = {"sve2" , "true" },
335+ applyIf = {"MaxVectorSize" , "16" })
336+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VI , IRNode .VECTOR_SIZE_4 , "0" },
337+ applyIfCPUFeature = {"sve2" , "true" },
338+ applyIf = {"MaxVectorSize" , ">16" })
339+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VI , IRNode .VECTOR_SIZE_4 , ">0" },
340+ applyIfCPUFeature = {"avx512vl" , "true" },
313341 applyIf = {"MaxVectorSize" , ">=16" })
314342 public static void selectFromTwoVector_Int128 () {
315343 IntSelectFromTwoVectorKernel (IntVector .SPECIES_128 , ia , ib , iindex [1 ]);
@@ -320,7 +348,13 @@ public static void selectFromTwoVector_Int128() {
320348 applyIfCPUFeatureAnd = {"asimd" , "true" , "sve2" , "false" },
321349 applyIf = {"MaxVectorSize" , ">=32" })
322350 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VI , IRNode .VECTOR_SIZE_8 , ">0" },
323- applyIfCPUFeatureOr = {"sve2" , "true" , "avx512vl" , "true" },
351+ applyIfCPUFeature = {"sve2" , "true" },
352+ applyIf = {"MaxVectorSize" , "32" })
353+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VI , IRNode .VECTOR_SIZE_8 , "0" },
354+ applyIfCPUFeature = {"sve2" , "true" },
355+ applyIf = {"MaxVectorSize" , ">32" })
356+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VI , IRNode .VECTOR_SIZE_8 , ">0" },
357+ applyIfCPUFeature = {"avx512vl" , "true" },
324358 applyIf = {"MaxVectorSize" , ">=32" })
325359 public static void selectFromTwoVector_Int256 () {
326360 IntSelectFromTwoVectorKernel (IntVector .SPECIES_256 , ia , ib , iindex [2 ]);
@@ -331,7 +365,13 @@ public static void selectFromTwoVector_Int256() {
331365 applyIfCPUFeatureAnd = {"asimd" , "true" , "sve2" , "false" },
332366 applyIf = {"MaxVectorSize" , ">=64" })
333367 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VI , IRNode .VECTOR_SIZE_16 , ">0" },
334- applyIfCPUFeatureOr = {"sve2" , "true" , "avx512f" , "true" },
368+ applyIfCPUFeature = {"sve2" , "true" },
369+ applyIf = {"MaxVectorSize" , "64" })
370+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VI , IRNode .VECTOR_SIZE_16 , "0" },
371+ applyIfCPUFeature = {"sve2" , "true" },
372+ applyIf = {"MaxVectorSize" , ">64" })
373+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VI , IRNode .VECTOR_SIZE_16 , ">0" },
374+ applyIfCPUFeature = {"avx512f" , "true" },
335375 applyIf = {"MaxVectorSize" , ">=64" })
336376 public static void selectFromTwoVector_Int512 () {
337377 IntSelectFromTwoVectorKernel (IntVector .SPECIES_512 , ia , ib , iindex [3 ]);
@@ -362,7 +402,13 @@ public static void selectFromTwoVector_Float64() {
362402 applyIfCPUFeatureAnd = {"asimd" , "true" , "sve2" , "false" },
363403 applyIf = {"MaxVectorSize" , ">=16" })
364404 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VF , IRNode .VECTOR_SIZE_4 , ">0" },
365- applyIfCPUFeatureOr = {"sve2" , "true" , "avx512vl" , "true" },
405+ applyIfCPUFeature = {"sve2" , "true" },
406+ applyIf = {"MaxVectorSize" , "16" })
407+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VF , IRNode .VECTOR_SIZE_4 , "0" },
408+ applyIfCPUFeature = {"sve2" , "true" },
409+ applyIf = {"MaxVectorSize" , ">16" })
410+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VF , IRNode .VECTOR_SIZE_4 , ">0" },
411+ applyIfCPUFeature = {"avx512vl" , "true" },
366412 applyIf = {"MaxVectorSize" , ">=16" })
367413 public static void selectFromTwoVector_Float128 () {
368414 FloatSelectFromTwoVectorKernel (FloatVector .SPECIES_128 , fa , fb , findex [1 ]);
@@ -373,7 +419,13 @@ public static void selectFromTwoVector_Float128() {
373419 applyIfCPUFeatureAnd = {"asimd" , "true" , "sve2" , "false" },
374420 applyIf = {"MaxVectorSize" , ">=32" })
375421 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VF , IRNode .VECTOR_SIZE_8 , ">0" },
376- applyIfCPUFeatureOr = {"sve2" , "true" , "avx512vl" , "true" },
422+ applyIfCPUFeature = {"sve2" , "true" },
423+ applyIf = {"MaxVectorSize" , "32" })
424+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VF , IRNode .VECTOR_SIZE_8 , "0" },
425+ applyIfCPUFeature = {"sve2" , "true" },
426+ applyIf = {"MaxVectorSize" , ">32" })
427+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VF , IRNode .VECTOR_SIZE_8 , ">0" },
428+ applyIfCPUFeature = {"avx512vl" , "true" },
377429 applyIf = {"MaxVectorSize" , ">=32" })
378430 public static void selectFromTwoVector_Float256 () {
379431 FloatSelectFromTwoVectorKernel (FloatVector .SPECIES_256 , fa , fb , findex [2 ]);
@@ -384,7 +436,13 @@ public static void selectFromTwoVector_Float256() {
384436 applyIfCPUFeatureAnd = {"asimd" , "true" , "sve2" , "false" },
385437 applyIf = {"MaxVectorSize" , ">=64" })
386438 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VF , IRNode .VECTOR_SIZE_16 , ">0" },
387- applyIfCPUFeatureOr = {"sve2" , "true" , "avx512f" , "true" },
439+ applyIfCPUFeature = {"sve2" , "true" },
440+ applyIf = {"MaxVectorSize" , "64" })
441+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VF , IRNode .VECTOR_SIZE_16 , "0" },
442+ applyIfCPUFeature = {"sve2" , "true" },
443+ applyIf = {"MaxVectorSize" , ">64" })
444+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VF , IRNode .VECTOR_SIZE_16 , ">0" },
445+ applyIfCPUFeature = {"avx512f" , "true" },
388446 applyIf = {"MaxVectorSize" , ">=64" })
389447 public static void selectFromTwoVector_Float512 () {
390448 FloatSelectFromTwoVectorKernel (FloatVector .SPECIES_512 , fa , fb , findex [3 ]);
@@ -407,7 +465,13 @@ public static void DoubleSelectFromTwoVectorKernel(VectorSpecies SPECIES, double
407465 applyIfCPUFeatureAnd = {"asimd" , "true" , "sve2" , "false" },
408466 applyIf = {"MaxVectorSize" , ">=16" })
409467 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VD , IRNode .VECTOR_SIZE_2 , ">0" },
410- applyIfCPUFeatureOr = {"sve2" , "true" , "avx512vl" , "true" },
468+ applyIfCPUFeature = {"sve2" , "true" },
469+ applyIf = {"MaxVectorSize" , "16" })
470+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VD , IRNode .VECTOR_SIZE_2 , "0" },
471+ applyIfCPUFeature = {"sve2" , "true" },
472+ applyIf = {"MaxVectorSize" , ">16" })
473+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VD , IRNode .VECTOR_SIZE_2 , ">0" },
474+ applyIfCPUFeature = {"avx512vl" , "true" },
411475 applyIf = {"MaxVectorSize" , ">=16" })
412476 public static void selectFromTwoVector_Double128 () {
413477 DoubleSelectFromTwoVectorKernel (DoubleVector .SPECIES_128 , da , db , dindex [0 ]);
@@ -418,7 +482,13 @@ public static void selectFromTwoVector_Double128() {
418482 applyIfCPUFeatureAnd = {"asimd" , "true" , "sve2" , "false" },
419483 applyIf = {"MaxVectorSize" , ">=32" })
420484 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VD , IRNode .VECTOR_SIZE_4 , ">0" },
421- applyIfCPUFeatureOr = {"sve2" , "true" , "avx512vl" , "true" },
485+ applyIfCPUFeature = {"sve2" , "true" },
486+ applyIf = {"MaxVectorSize" , "32" })
487+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VD , IRNode .VECTOR_SIZE_4 , "0" },
488+ applyIfCPUFeature = {"sve2" , "true" },
489+ applyIf = {"MaxVectorSize" , ">32" })
490+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VD , IRNode .VECTOR_SIZE_4 , ">0" },
491+ applyIfCPUFeature = {"avx512vl" , "true" },
422492 applyIf = {"MaxVectorSize" , ">=32" })
423493 public static void selectFromTwoVector_Double256 () {
424494 DoubleSelectFromTwoVectorKernel (DoubleVector .SPECIES_256 , da , db , dindex [1 ]);
@@ -429,7 +499,13 @@ public static void selectFromTwoVector_Double256() {
429499 applyIfCPUFeatureAnd = {"asimd" , "true" , "sve2" , "false" },
430500 applyIf = {"MaxVectorSize" , ">=64" })
431501 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VD , IRNode .VECTOR_SIZE_8 , ">0" },
432- applyIfCPUFeatureOr = {"sve2" , "true" , "avx512f" , "true" },
502+ applyIfCPUFeature = {"sve2" , "true" },
503+ applyIf = {"MaxVectorSize" , "64" })
504+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VD , IRNode .VECTOR_SIZE_8 , "0" },
505+ applyIfCPUFeature = {"sve2" , "true" },
506+ applyIf = {"MaxVectorSize" , ">64" })
507+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VD , IRNode .VECTOR_SIZE_8 , ">0" },
508+ applyIfCPUFeature = {"avx512f" , "true" },
433509 applyIf = {"MaxVectorSize" , ">=64" })
434510 public static void selectFromTwoVector_Double512 () {
435511 DoubleSelectFromTwoVectorKernel (DoubleVector .SPECIES_512 , da , db , dindex [2 ]);
@@ -452,7 +528,13 @@ public static void LongSelectFromTwoVectorKernel(VectorSpecies SPECIES, long[] l
452528 applyIfCPUFeatureAnd = {"asimd" , "true" , "sve2" , "false" },
453529 applyIf = {"MaxVectorSize" , ">=16" })
454530 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VL , IRNode .VECTOR_SIZE_2 , ">0" },
455- applyIfCPUFeatureOr = {"sve2" , "true" , "avx512vl" , "true" },
531+ applyIfCPUFeature = {"sve2" , "true" },
532+ applyIf = {"MaxVectorSize" , "16" })
533+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VL , IRNode .VECTOR_SIZE_2 , "0" },
534+ applyIfCPUFeature = {"sve2" , "true" },
535+ applyIf = {"MaxVectorSize" , ">16" })
536+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VL , IRNode .VECTOR_SIZE_2 , ">0" },
537+ applyIfCPUFeature = {"avx512vl" , "true" },
456538 applyIf = {"MaxVectorSize" , ">=16" })
457539 public static void selectFromTwoVector_Long128 () {
458540 LongSelectFromTwoVectorKernel (LongVector .SPECIES_128 , la , lb , lindex [0 ]);
@@ -463,7 +545,13 @@ public static void selectFromTwoVector_Long128() {
463545 applyIfCPUFeatureAnd = {"asimd" , "true" , "sve2" , "false" },
464546 applyIf = {"MaxVectorSize" , ">=32" })
465547 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VL , IRNode .VECTOR_SIZE_4 , ">0" },
466- applyIfCPUFeatureOr = {"sve2" , "true" , "avx512vl" , "true" },
548+ applyIfCPUFeature = {"sve2" , "true" },
549+ applyIf = {"MaxVectorSize" , "32" })
550+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VL , IRNode .VECTOR_SIZE_4 , "0" },
551+ applyIfCPUFeature = {"sve2" , "true" },
552+ applyIf = {"MaxVectorSize" , ">32" })
553+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VL , IRNode .VECTOR_SIZE_4 , ">0" },
554+ applyIfCPUFeature = {"avx512vl" , "true" },
467555 applyIf = {"MaxVectorSize" , ">=32" })
468556 public static void selectFromTwoVector_Long256 () {
469557 LongSelectFromTwoVectorKernel (LongVector .SPECIES_256 , la , lb , lindex [1 ]);
@@ -474,7 +562,13 @@ public static void selectFromTwoVector_Long256() {
474562 applyIfCPUFeatureAnd = {"asimd" , "true" , "sve2" , "false" },
475563 applyIf = {"MaxVectorSize" , ">=64" })
476564 @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VL , IRNode .VECTOR_SIZE_8 , ">0" },
477- applyIfCPUFeatureOr = {"sve2" , "true" , "avx512f" , "true" },
565+ applyIfCPUFeature = {"sve2" , "true" },
566+ applyIf = {"MaxVectorSize" , "64" })
567+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VL , IRNode .VECTOR_SIZE_8 , "0" },
568+ applyIfCPUFeature = {"sve2" , "true" },
569+ applyIf = {"MaxVectorSize" , ">64" })
570+ @ IR (counts = {IRNode .SELECT_FROM_TWO_VECTOR_VL , IRNode .VECTOR_SIZE_8 , ">0" },
571+ applyIfCPUFeature = {"avx512f" , "true" },
478572 applyIf = {"MaxVectorSize" , ">=64" })
479573 public static void selectFromTwoVector_Long512 () {
480574 LongSelectFromTwoVectorKernel (LongVector .SPECIES_512 , la , lb , lindex [2 ]);
0 commit comments