RFR:8144771: AVX3 patch for MacroAssembler::string_compare

Vladimir Kozlov vladimir.kozlov at oracle.com
Tue Dec 8 02:10:31 UTC 2015


http://cr.openjdk.java.net/~kvn/8144771/webrev.01/

Vladimir

On 12/7/15 5:50 PM, Civlin, Jan wrote:
> Tobias,
>
> Thank you for spotting this.
> These comments were from the design and reflected the original order str1/str2. I'm removing them since the function calls say enough.
> The order should remain str2/str1 since the "result" is modified in the "str1" line.
>
> Vladimir,
> could you please upload the updated patch (I still do not have an access).
>
>
> Yes, the test has been run:
>
> [jcivlin at SKY71 test]$ date; echo $JAVA_HOME; ls -l $JAVA_HOME/lib/amd64/server/libjvm.so; time /home/jcivlin/Tools/jtreg/bin/jtreg compiler/intrinsics/string/TestStringIntrinsics.java
> Mon Dec  7 11:00:07 PST 2015
> /home/jcivlin/Java/mberg-100915-11K/build/linux-x86_64-normal-server-release/jdk
> -rwxrwxr-x 1 jcivlin jcivlin 17999532 Dec  2 22:13 /home/jcivlin/Java/mberg-100915-11K/build/linux-x86_64-normal-server-release/jdk/lib/amd64/server/libjvm.so
> Test results: passed: 1
> Report written to /home/jcivlin/Java/mberg-100915-11K/hotspot/test/JTreport/html/report.html
> Results written to /home/jcivlin/Java/mberg-100915-11K/hotspot/test/JTwork
>
> Thank you,
>
> Jan
>
> -----Original Message-----
> From: Tobias Hartmann [mailto:tobias.hartmann at oracle.com]
> Sent: Monday, December 07, 2015 6:39 AM
> To: Civlin, Jan; hotspot compiler
> Cc: Vladimir Kozlov
> Subject: Re: RFR:8144771: AVX3 patch for MacroAssembler::string_compare
>
> Hi Jan,
>
> the intrinsic looks good to me (not a reviewer). Here are two minor suggestions:
> - The following comments are wrong:
>    8355     } else { //ae == StrIntrinsicNode::UL
>    8356       load_unsigned_short(cnt1, Address(str2, result, scale2));   // L string
>    8357       load_unsigned_byte(result, Address(str1, result, scale1)); // U string
>    The first line then loads a UTF16 (two-byte) String and the second line loads a Latin1 (one-byte) String. Maybe you should also exchange the lines to first load str1 and then load str2. I would omit the comment after "else" because ae could either be UL or LU (both have the Latin1 string in str1).
> - Missing whitespace after comma:
>    8143       cmpl(cnt2,stride2x2);
>
> I assume you executed the hotspot JTREG tests (including /compiler/intrinsics/string/TestStringIntrinsics.java).
>
> Best,
> Tobias
>
> On 05.12.2015 05:07, Civlin, Jan wrote:
>> We would like to contribute AVX3 patch for MacroAssembler::string_compare.
>>
>> This utilizes 512 bits registers on AVX3 architecture and delivers performance gain (speed-up) on long strings at about x 1.33 and on random string about x 1.22. This was measured vs AVX2 (256 bits registers).
>>
>>
>> Contributors:
>> MacroAssembler::string_compare - Jan Civlin.
>> Rest of code, including all x86 AVX3 extensions  - Michael Berg
>>
>>
>> Bug-id: https://bugs.openjdk.java.net/browse/JDK-8144771
>> Webrev:  http://cr.openjdk.java.net/~kvn/8144771/webrev/


More information about the hotspot-compiler-dev mailing list