RFR: 8295948: Support for Zicbop/prefetch instructions on RISC-V [v2]

Ludovic Henry luhenry at openjdk.org
Thu Nov 3 12:31:26 UTC 2022


On Thu, 3 Nov 2022 12:20:06 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> We would need to check for `UseZicbop` in any case; the access to a global variable is then required.
>> 
>> It would be the same issue as https://github.com/openjdk/jdk/pull/10884/files/e968f7164124dcf560807c9ff7765e6f82b64cdd#diff-e3c18b8b83898e82b5a3069319df6a47468e91cc2527bf065e704a685a20f26bR5196 without the stub.
>> 
>> I've to admit that the `interval` naming here is confusing since no implementation ever uses it as an interval but alway as an offset. Also, the callers assume it to be an offset, like `ContiguousSpace::prepare_for_compaction` for example.
>
> Yes, I agree that a check for UseZicbop option would be necessary. But I still don't understand why we should implement this through a stub here. It looks to me that CPP code with inline assembly would also do. At least this could help eliminate the prologue & epilogue cost of calling the stub.

We can definitely go with inline assembly here, just not sure that `prefetch.r` or `prefetch.w` would be recognized by the assembler. However, given that `prefetch.*` is an `ori` under the hood, we can simply use that.

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

PR: https://git.openjdk.org/jdk/pull/10884


More information about the hotspot-dev mailing list