x86: StrIndexOfChar and UseSSE

Tobias Hartmann tobias.hartmann at oracle.com
Wed May 25 13:53:40 UTC 2016


Hi Andrew,

On 25.05.2016 12:12, Andrew Haley wrote:
> In x86.ad we have:
> 
>   const bool Matcher::match_rule_supported(int opcode) {
>     if (!has_match_rule(opcode))
>       return false;
> 
>     bool ret_value = true;
>     switch (opcode) {
> ...
> 
>       case Op_StrIndexOfChar:
>         if (!(UseSSE > 4))
>           ret_value = false;
>         break;
> 
> ...
>     }
> 
>     return ret_value;  // Per default match rules are supported.
>   }
> 
> So we won't use the StrIndexOfChar intrinsic unless UseSSE > 4.
> 
> In vm_version_x86.cpp we have:
> 
>   // UseSSE is set to the smaller of what hardware supports and what
>   // the command line requires.  I.e., you cannot set UseSSE to 2 on
>   // older Pentiums which do not support it.
>   if (UseSSE > 4) UseSSE=4;
> 
> So, UseSSE can never be > 4.  So we will never use the StrIndexOfChar
> intrinsic.
> 
> What gives?  What is the intrinsic for?

Thanks for reporting this! Yes, as in MacroAssembler::string_indexof_char() this should be UseSSE >= 4. Not sure how this slipped through unnoticed.

I filed JDK-8157842 [1] and will take care of it.

Thanks,
Tobias

[1] https://bugs.openjdk.java.net/browse/JDK-8157842

> 
> Andrew.
> 


More information about the hotspot-dev mailing list