String intrinsics defunct on arch != amd64 after 8141132: JEP 254: Compact Strings

Vladimir Kozlov vladimir.kozlov at oracle.com
Tue Dec 15 05:37:38 UTC 2015


Yes, we should not use "platform specific" flags in shared code.
I think we should set SpecialString* flags based on presence corresponding ISA in vm_version_<arch>.cpp and remove 
UseSSE42Intrinsics flag and UseSSE checks in shared code and other places related to these intrinsics.

Thanks,
Vladimir


On 11/30/15 10:54 AM, Volker Simonis wrote:
> Hi,
>
> I'm currently trying to fix the String intrinsics
> (SpecialStringCompareTo, SpecialStringEquals, SpecialStringIndexOf) on
> ppc64 after change "8141132: JEP 254: Compact Strings" - at least for
> the case where the strings are not compressed (i.e. UTF16 byte
> arrays).
>
> For SpecialStringCompareTo and SpecialStringEquals this was not too
> hard, but when I wanted to test the intrinsics for
> SpecialStringIndexOf I realized that they never got generated. I think
> it is because of this code in library_call.cpp
>
> bool LibraryCallKit::inline_string_indexOf(StrIntrinsicNode::ArgEnc ae) {
>    if (!Matcher::has_match_rule(Op_StrIndexOf) || !UseSSE42Intrinsics) {
>      return false;
>    }
>
> If "UseSSE42Intrinsics" is false, which it always is on ppc64,
> inline_string_indexOf() will always return false.
>
> So I wonder how this code is supposed to ever work on non-amd64 architectures?
>
> Moreover, "UseSSE42Intrinsics" is clearly a architecture-dependant
> option. I already wondered that according to vm_version_aarch64.cpp it
> seems to exists on aarch64 (is this really true Andrew?). But it's
> surely not available on PowerPC, SPARC, ...
>
> So I think "UseSSE42Intrinsics" should be at least guarded with
> X86_ONLY/AARCH64_ONLY in shared files. Probably even better would be
> to move the check right into the Matcher.
>
> What do you think?
>
> Regards,
> Volker
>


More information about the hotspot-compiler-dev mailing list