RFR: 8331577: RISC-V: C2 CountLeadingZerosV [v2]

Fei Yang fyang at openjdk.org
Fri May 10 06:33:03 UTC 2024


On Thu, 9 May 2024 14:07:00 GMT, Hamlin Li <mli at openjdk.org> wrote:

> > > > Sorry for not being accurate. In fact, I mean requirement at the Java level. Why should we keep the origin value of inactive elements from the input vector? I didn't notice such a requirement before.
> > > 
> > > 
> > > I'm not sure about other places, but in vector APi, if you do operations with a mask, then the untouched (inactive in riscv vector insts) elements should be unmodified, i.e. same as original values.
> > 
> > 
> > It will be helpful if you could point to the specific code or examples.
> 
> For the example usage, please check the test code, e.g. https://github.com/openjdk/jdk/blob/master/test/jdk/jdk/incubator/vector/Byte64VectorTests.java#L5458 For the courterpart of this intrinsic in arm, please check https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/aarch64/aarch64_vector.ad#L6391 Hope these information are helpful.

Yeah, I think you are right. This is also reflected in the vector api source code like [1] [2].

[1] https://github.com/openjdk/jdk/blob/master/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java#L184
[2] https://github.com/openjdk/jdk/blob/master/src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java#L231

-------------

PR Comment: https://git.openjdk.org/jdk/pull/19153#issuecomment-2103955774


More information about the hotspot-compiler-dev mailing list