<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"MS PGothic";
        panose-1:2 11 6 0 7 2 5 8 2 4;}
@font-face
        {font-family:"\@MS PGothic";
        panose-1:2 11 6 0 7 2 5 8 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"MS PGothic",sans-serif;
        mso-fareast-language:JA;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"MS PGothic",sans-serif;
        mso-fareast-language:JA;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Hi Michihiro,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">thanks. This proposal makes the java code much more intrinsics friendly.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">We should wait for feedback from the core lib folks. Maybe they have some requirements or other proposals.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">I think these intrinsics should be interesting for Oracle, Intel and others, too.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Btw. I think you can further simplify the code in library_call.cpp (no phi). But we can discuss details when the direction regarding
 the java classes is clear.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US">Martin<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Michihiro Horie <HORIE@jp.ibm.com>
<br>
<b>Sent:</b> Mittwoch, 21. November 2018 17:14<br>
<b>To:</b> core-libs-dev@openjdk.java.net; Doerr, Martin <martin.doerr@sap.com><br>
<b>Cc:</b> hotspot-compiler-dev@openjdk.java.net; Simonis, Volker <volker.simonis@sap.com>; Gustavo Romero <gromero@linux.vnet.ibm.com><br>
<b>Subject:</b> RE: 8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p><span style="font-size:10.0pt;color:#2F2F2F">Hi Martin,</span><br>
<br>
<span style="font-size:10.0pt;color:#2F2F2F">I send this RFR to core-libs-dev too, because it changes the class library.
</span><br>
<br>
<span style="font-size:10.0pt;color:#2F2F2F">Through trial and error, I separated Latin1 block as in the
</span><br>
<a href="http://cr.openjdk.java.net/~mhorie/8213754/webrev.01/"><span style="font-size:10.0pt;color:#BFBF00">http://cr.openjdk.java.net/~mhorie/8213754/webrev.01/</span></a><br>
<br>
<span style="font-size:10.0pt;color:#2F2F2F">I followed the coding way of Character.isWhitespace() that invokes each ChracterData’s isWhitespace() to refactor isDigit(), isLowerCase(), and isUpperCase().</span><br>
<br>
<span style="font-size:10.0pt;color:#2F2F2F">I think this change is also useful on x86, using STTNI.</span><br>
<br>
<br>
<span style="font-size:10.0pt">Best regards,<br>
--</span><span style="font-family:"Arial",sans-serif"><br>
Michihiro,<br>
IBM Research - Tokyo</span><br>
<br>
<br>
<span style="font-family:"Arial",sans-serif">----- Original message -----<br>
From: "Michihiro Horie" <<a href="mailto:HORIE@jp.ibm.com">HORIE@jp.ibm.com</a>><br>
Sent by: "hotspot-compiler-dev" <<a href="mailto:hotspot-compiler-dev-bounces@openjdk.java.net">hotspot-compiler-dev-bounces@openjdk.java.net</a>><br>
To: "Doerr, Martin" <<a href="mailto:martin.doerr@sap.com">martin.doerr@sap.com</a>><br>
Cc: "Simonis, Volker" <<a href="mailto:volker.simonis@sap.com">volker.simonis@sap.com</a>>, "<a href="mailto:ppc-aix-port-dev@openjdk.java.net">ppc-aix-port-dev@openjdk.java.net</a>" <<a href="mailto:ppc-aix-port-dev@openjdk.java.net">ppc-aix-port-dev@openjdk.java.net</a>>,
 "<a href="mailto:hotspot-compiler-dev@openjdk.java.net">hotspot-compiler-dev@openjdk.java.net</a>" <<a href="mailto:hotspot-compiler-dev@openjdk.java.net">hotspot-compiler-dev@openjdk.java.net</a>><br>
Subject: RE: 8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace<br>
Date: Wed, Nov 21, 2018 1:53 AM</span><o:p></o:p></p>
<p><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#2F2F2F">Hi Martin,</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#2F2F2F"><br>
Thank you for giving your helpful comments. I did not recognize “generate_method_call_static” prevents any optimizations, but I now checked it actually degraded the performance, thanks.
</span><span style="font-family:"Arial",sans-serif"><br>
<br>
>Please note that we don’t have a machine, yet. So other people will have to test.</span><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#2F2F2F"><br>
I think Gustavo can help testing this change when its' ready.</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#2F2F2F"><br>
>Would it be possible to introduce more fine-grained intrinsics such that the “slow” path is outside of them?<br>
> <br>
>Maybe you can factor out as in the following example?<br>
>if (latin1) return isLatin1Digit(codePoint);<br>
>with isLatin1Digit as HotSpotIntrinsicCandidate.</span><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><br>
Thanks for an example, please let me try to separate the Latin block from other blocks for some time.</span><span style="font-family:"Arial",sans-serif"><br>
<br>
</span><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><br>
Best regards,<br>
--<br>
Michihiro,<br>
IBM Research - Tokyo</span><span style="font-family:"Arial",sans-serif"><br>
<br>
</span><img border="0" width="16" height="16" style="width:.1666in;height:.1666in" id="_x0000_i1025" src="cid:image001.gif@01D481C0.2C5503E0" alt="Inactive hide details for "Doerr, Martin" ---2018/11/20 01:55:27---Hi Michihiro, first of all, thanks for working on Power9 opt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#424282">"Doerr,
 Martin" ---2018/11/20 01:55:27---Hi Michihiro, first of all, thanks for working on Power9 optimizations. Please note that we don't ha</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#5F5F5F"><br>
From: </span><span style="font-size:10.0pt;font-family:"Arial",sans-serif">"Doerr, Martin" <<a href="mailto:martin.doerr@sap.com">martin.doerr@sap.com</a>><span style="color:#5F5F5F"><br>
To: </span>Michihiro Horie <<a href="mailto:HORIE@jp.ibm.com">HORIE@jp.ibm.com</a>>, "<a href="mailto:hotspot-compiler-dev@openjdk.java.net">hotspot-compiler-dev@openjdk.java.net</a>" <<a href="mailto:hotspot-compiler-dev@openjdk.java.net">hotspot-compiler-dev@openjdk.java.net</a>>,
 "<a href="mailto:ppc-aix-port-dev@openjdk.java.net">ppc-aix-port-dev@openjdk.java.net</a>" <<a href="mailto:ppc-aix-port-dev@openjdk.java.net">ppc-aix-port-dev@openjdk.java.net</a>><span style="color:#5F5F5F"><br>
Cc: </span>"Simonis, Volker" <<a href="mailto:volker.simonis@sap.com">volker.simonis@sap.com</a>>, "Lindenmaier, Goetz" <<a href="mailto:goetz.lindenmaier@sap.com">goetz.lindenmaier@sap.com</a>>, Gustavo Romero <<a href="mailto:gromero@linux.vnet.ibm.com">gromero@linux.vnet.ibm.com</a>><span style="color:#5F5F5F"><br>
Date: </span>2018/11/20 01:55<span style="color:#5F5F5F"><br>
Subject: </span>RE: 8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace</span><o:p></o:p></p>
<div class="MsoNormal">
<hr size="2" width="100%" align="left">
</div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif"><br>
<br>
<br>
Hi Michihiro,<br>
<br>
first of all, thanks for working on Power9 optimizations. Please note that we don’t have a machine, yet. So other people will have to test.<br>
<br>
I think it may be problematic to insert a slow path by “generate_method_call_static”. This may be a performance disadvantage for some users of other encodings because your intrinsics prevent inlining and further optimizations.<br>
Would it be possible to introduce more fine-grained intrinsics such that the “slow” path is outside of them?<br>
<br>
Maybe you can factor out as in the following example?<br>
if (latin1) return isLatin1Digit(codePoint);<br>
with isLatin1Digit as HotSpotIntrinsicCandidate.<br>
<br>
I can’t judge if this is needed, but I think this should be discussed first before going into the details.<br>
<br>
Best regards,<br>
Martin<br>
<br>
<b><br>
From:</b> Michihiro Horie <<a href="mailto:HORIE@jp.ibm.com">HORIE@jp.ibm.com</a>><b><br>
Sent:</b> Freitag, 16. November 2018 12:53<b><br>
To:</b> <a href="mailto:hotspot-compiler-dev@openjdk.java.net">hotspot-compiler-dev@openjdk.java.net</a>;
<a href="mailto:ppc-aix-port-dev@openjdk.java.net">ppc-aix-port-dev@openjdk.java.net</a><b><br>
Cc:</b> Doerr, Martin <<a href="mailto:martin.doerr@sap.com">martin.doerr@sap.com</a>>; Simonis, Volker <<a href="mailto:volker.simonis@sap.com">volker.simonis@sap.com</a>>; Lindenmaier, Goetz <<a href="mailto:goetz.lindenmaier@sap.com">goetz.lindenmaier@sap.com</a>>;
 Gustavo Romero <<a href="mailto:gromero@linux.vnet.ibm.com">gromero@linux.vnet.ibm.com</a>><b><br>
Subject:</b> RFR: 8213754: PPC64: Add Intrinsics for isDigit/isLowerCase/isUpperCase/isWhitespace
</span><o:p></o:p></p>
<p><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#2F2F2F">Dear all,</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#2F2F2F"><br>
Would you please review following change?</span><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#2F2F2F"><br>
Bug: </span><a href="https://bugs.openjdk.java.net/browse/JDK-8213754" target="_blank"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">https://bugs.openjdk.java.net/browse/JDK-8213754</span></a><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#2F2F2F"><br>
Webrev: </span><a href="http://cr.openjdk.java.net/~mhorie/8213754/webrev.00" target="_blank"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">http://cr.openjdk.java.net/~mhorie/8213754/webrev.00</span></a><span style="font-family:"Arial",sans-serif"><br>
</span><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#2F2F2F"><br>
This change includes the intrinsics of Character isDigit, isLowerCase, isUpperCase, and isWhitespace to support the Latin1 block using POWER9’s instructions cmprb and cmpeqb. The cmprb enables to compare a character with 1 or 2 ranged bytes, while the cmpeqb
 compares one with 1 to 8 values. Simple micro benchmark attached showed improvements by 20-40%.
</span><span style="font-family:"Arial",sans-serif"><br>
<i><br>
(See attached file: Latin1Test.java)</i><br>
<br>
</span><span style="font-size:10.0pt;font-family:"Arial",sans-serif"><br>
Best regards,<br>
--<br>
Michihiro,<br>
IBM Research - Tokyo</span><o:p></o:p></p>
<p><o:p> </o:p></p>
</div>
</body>
</html>