On Thu, 22 May 2025 08:14:35 GMT, Per Minborg <pminb...@openjdk.org> wrote:
>> This PR builds on a concept John Rose told me about some time ago. Instead >> of combining memory operations of various sizes, a single large and skewed >> memory operation can be made to clean up the tail of remaining bytes. >> >> This has the effect of simplifying and shortening the code. The number of >> branches to evaluate is reduced. > > Per Minborg has updated the pull request incrementally with one additional > commit since the last revision: > > Correct typo in comment src/java.base/share/classes/jdk/internal/foreign/SegmentBulkOperations.java line 93: > 91: case 2 -> { > 92: SCOPED_MEMORY_ACCESS.putShortUnaligned(dst.sessionImpl(), > dst.unsafeGetBase(), dst.unsafeGetOffset(), (short) longValue, > !Architecture.isLittleEndian()); > 93: SCOPED_MEMORY_ACCESS.putShortUnaligned(dst.sessionImpl(), > dst.unsafeGetBase(), dst.unsafeGetOffset() + len - Short.BYTES, (short) > longValue, !Architecture.isLittleEndian()); So that I understand, since this configuration might pick up both length = 2 and length = 3, in 50% of cases there's a redundant store? This is also true for length = 4, 5, 6, 7 -- but in this case the chance of redundant store is reduced to 25%. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25383#discussion_r2102016436