RFR: 8320448: Accelerate IndexOf using AVX2 [v43]
Sandhya Viswanathan
sviswanathan at openjdk.org
Tue May 28 20:28:16 UTC 2024
On Tue, 28 May 2024 17:59:49 GMT, Scott Gibbons <sgibbons at openjdk.org> wrote:
>> src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp line 578:
>>
>>> 576: // helper jumps to L_checkRangeAndReturn with a (-1) return value.
>>> 577: big_case_loop_helper(false, 0, L_checkRangeAndReturn, L_loopTop, mask, hsPtrRet, needleLen,
>>> 578: needle, haystack, hsLength, tmp1, tmp2, tmp3, rScratch, ae, _masm);
>>
>> If we run out of haystack instead of jumping to L_checkRangeAndReturn, we could directly jump to L_retrunError.
>
> Again, I think we ought to leave this in. Although it executes ~3 instructions that may not be necessary in some cases I think it's best to perform the check. Once we have a good enough test to check reading past the end of the haystack we can change it.
In this particular case, we are returning -1 (NoMatch), so no need to do L_checkRangeAndReturn here, we could directly jump to L_returnError.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16753#discussion_r1617853337
More information about the hotspot-compiler-dev
mailing list