RFR: 8356760: VectorAPI: Optimize VectorMask.fromLong for all-true/all-false cases [v3]
erifan
duke at openjdk.org
Mon Jul 7 03:46:38 UTC 2025
On Fri, 4 Jul 2025 12:04:06 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:
> > > public static final VectorSpecies FSP = FloatVector.SPECIES_512;
> > > public static long micro1(long a) {
> > > long mask = Math.min(-1, Math.max(-1, a));
> > > return VectorMask.fromLong(FSP, mask).toLong();
> > > }
> > > public static long micro2() {
> > > return FSP.maskAll(true).toLong();
> > > }
> >
> >
> > With this JMH method we can not see obvious performance improvement, because the hot spots are other instructions. Adding a loop is better.
>
> There is no hard and fast rule for the inclusion of a loop in a JMH micro in that case?
You mean adding a loop is not a block, right ?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25793#issuecomment-3043388905
More information about the hotspot-compiler-dev
mailing list