On Thu, 19 Jan 2023 03:51:28 GMT, Quan Anh Mai <qa...@openjdk.org> wrote:

>> This "offset < 0" path can be optimized out by compiler if the "offset >= 0" 
>> in the common cases (i.e. normal loop with no tail loop).
>
> Yes but I don't think it is common enough to deserve special treatment. A 
> fast path should be common for this branch otherwise we are regressing the 
> common path for the corner cases.

The special handling here is necessary for me, because we do not have the 
instruction supports in compiler intrinsification. Besides, the original API 
implementation also has the special handle for "offset < 0", which means this 
API itself accepts the negative offset as the valid argument.  We have to cover 
it here as well to make the implementation comprehensive.

 Maybe I misunderstood what you mean. Could you please give an alternative 
solution besides  the current implementation for such corner cases? Thanks in 
advance!

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

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

Reply via email to