[vectorIntrinsics] RFR: 8283316: Add new vector operation REVERSE_BYTES

Eric Liu eliu at openjdk.java.net
Fri Mar 18 03:00:00 UTC 2022


On Thu, 17 Mar 2022 15:39:33 GMT, Swati Sharma <duke at openjdk.java.net> wrote:

> Hi All,
> 
> Summary of changes:
> a) Java implementation of new vector operation REVERSE_BYTES for all  integral types.
> b) Extended existing JTREG and JMH suite with test points corresponding to new operations.
> 
> Please review and share your feedback.
> 
> Thanks,
> Swati

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java line 1815:

> 1813:     static int reverseBytes(short a) {
> 1814:         return (short) ((a << 8) | (a >>> 8));
> 1815:     }

May I ask why not using the built-in Short.reverseBytes[1] here?

[1] https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/lang/Short.java#L565

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

PR: https://git.openjdk.java.net/panama-vector/pull/181


More information about the panama-dev mailing list