RFR: 8331577: RISC-V: C2 CountLeadingZerosV [v2]
Hamlin Li
mli at openjdk.org
Fri May 10 14:04:01 UTC 2024
On Fri, 10 May 2024 06:30:54 GMT, Fei Yang <fyang 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.
>
>> > > > 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 Unary & Binary operator [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
Thanks @RealFYang for your reviewing.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19153#issuecomment-2104660027
More information about the hotspot-compiler-dev
mailing list