8293198: [vectorapi] Improve the implementation of VectorMask.indexInRange()

Reviewed-by: jbhateja, qamai, psandoz
This commit is contained in:
Xiaohong Gong 2023-02-10 01:32:05 +00:00
parent b814cfc39d
commit e245620f6f
41 changed files with 632 additions and 42 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -210,6 +210,23 @@ public class VectorSupport {
return defaultImpl.fromBits(bits, s);
}
/* ============================================================================ */
public interface IndexPartiallyInUpperRangeOperation<E,
M extends VectorMask<E>> {
M apply(long offset, long limit);
}
@IntrinsicCandidate
public static
<E,
M extends VectorMask<E>>
M indexPartiallyInUpperRange(Class<? extends M> mClass, Class<E> eClass,
int length, long offset, long limit,
IndexPartiallyInUpperRangeOperation<E, M> defaultImpl) {
assert isNonCapturingLambda(defaultImpl) : defaultImpl;
return defaultImpl.apply(offset, limit);
}
/* ============================================================================ */
public interface ShuffleIotaOperation<S extends VectorSpecies<?>,
SH extends VectorShuffle<?>> {