mask compress for Paul

This commit is contained in:
Emanuel Peter 2026-01-14 09:55:12 +01:00
parent c057462bee
commit 42401e2d84
3 changed files with 4 additions and 4 deletions

View File

@ -456,9 +456,9 @@ public class TestVectorAlgorithms {
@IR(counts = {IRNode.LOAD_VECTOR_I, "> 0",
IRNode.VECTOR_MASK_CMP, "> 0",
IRNode.VECTOR_TEST, "> 0",
IRNode.VECTOR_LONG_TO_MASK, "> 0",
IRNode.COMPRESS_VI, "> 0",
IRNode.STORE_VECTOR_MASKED, "> 0"},
applyIfCPUFeature = {"avx", "true"})
applyIfCPUFeature = {"avx2", "true"})
public Object filterI_VectorAPI(int[] a, int[] r, int threshold) {
return VectorAlgorithmsImpl.filterI_VectorAPI(a, r, threshold);
}

View File

@ -358,7 +358,7 @@ public class VectorAlgorithmsImpl {
var mask = v.compare(VectorOperators.GE, thresholds);
v = v.compress(mask);
int trueCount = mask.trueCount();
var prefixMask = VectorMask.fromLong(SPECIES_I, (1L << trueCount) - 1);
var prefixMask = mask.compress();
v.intoArray(r, j, prefixMask);
j += trueCount;
}

View File

@ -358,7 +358,7 @@ public class VectorAlgorithmsImpl {
var mask = v.compare(VectorOperators.GE, thresholds);
v = v.compress(mask);
int trueCount = mask.trueCount();
var prefixMask = VectorMask.fromLong(SPECIES_I, (1L << trueCount) - 1);
var prefixMask = mask.compress();
v.intoArray(r, j, prefixMask);
j += trueCount;
}