Request for reviews (L): 6761600: Use SSE 4.2 In STTNI Intrinsics

Vladimir Kozlov Vladimir.Kozlov at Sun.COM
Fri Feb 6 10:22:24 PST 2009


Changpeng,

Good work.

src/cpu/x86/vm/assembler_x86.cpp:
Remove Macro NOT_LP64() around asserts in new instructions.
VM_Version::supports_sse4_2() should be checked on LP64 also
since not all 64-bits CPUs support it.


src/cpu/x86/vm/vm_version_x86_32.cpp:
src/cpu/x86/vm/vm_version_x86_64.cpp:
Remove UseUnalignedLoadStores check in the next code,
it is not needed and it is wrong to have it since it depends on
UseXMMForArrayCopy flag. The top check supports_sse4_2() && supports_ht()
is enough for movdqu verification.

+         if(FLAG_IS_DEFAULT(UseSSE42Intrinsics) &&
+            UseUnalignedLoadStores){ //sse42 intrinsics depend on movdqu
+             UseSSE42Intrinsics = true;
           }


In both x86_32.ad and x86_64.ad try to use short forward branches masm.jccb()
starting from the bottom of the assembler code. Then try to use all
intrinsics with all flags variations and revert back to long jump those branches
VM will complain about.


cpu/x86/vm/x86_32.ad:
align comments:

!       masm.andl(rsi, 0xfffffff8); // rsi holds the vector count
!       masm.andl(rdi, 0x00000007);       // rdi holds the tail count

In enc_String_Equals() and enc_String_IndexOf()
use movptr() for value_offset.


src/share/vm/adlc/formssel.cpp:
Missing checks for AryEq.

src/share/vm/classfile/vmSymbols.hpp:
Remove empty after indexOf_name since equals() also j.l.String method:
      do_name(     indexOf_name,       "indexOf") 
 


+   do_intrinsic(_equals, java_lang_String, equals_name, object_boolean_signature,  F_R)


src/share/vm/opto/library_call.cpp:
Add that it because spec allow to specify NULL as argument:
+   //should not do null check for argument for string_equals.

Remove next line
+   //argument = do_null_check(argument, T_OBJECT);

Thanks,
Vladimir

Changpeng Fang wrote:
> http://webrev.invokedynamic.info/cfang/6761600/index.html
> 
> Works on 6761600 : Use SSE 4.2 in intrinsics for String.compareTo(),
> String.equals(), String.indexOf() and Arrays.equals(), among which,
> String.equals() and String.indexOf() are intrinsified for the first time.
> 
> Problem: Use SSE 4.2 instructions for STTNI intrinsics for for Nehalem
>               improvements
> 
> Solution:
>    Implemented both 32 and 64-bit versions for X86.  Introduced  a new
> flag  UseSSE42Intrinsics, with the default TRUE on systems that support
> SSE4.2 (false otherwise).
> 
> Reviewed by:
> 
> Fix verified (y/n): y
> 
> Other testing:  JPRT,
> 
> 



More information about the hotspot-compiler-dev mailing list