RFR (S): JDK-8213479: Missing x86_64.ad patterns for 8-bit logical operators with destination in memory

Vladimir Kozlov vladimir.kozlov at oracle.com
Wed Nov 7 19:46:42 UTC 2018


On 11/7/18 11:33 AM, B. Blaser wrote:
> Hi Vladimir,
> 
> On Wed, 7 Nov 2018 at 19:59, Vladimir Kozlov <vladimir.kozlov at oracle.com> wrote:
>>
>> Hi Bernard,
>>
>> I am concern about next statement in Intel's Manual for these byte instructions:
>>
>> "*In 64-bit mode, r/m8 can not be encoded to access the following byte registers if a REX prefix is
>> used: AH, BH, CH, DH."
> 
> yes, that's right but I guess we use AL, BL, CL and DL?

Yes, I reread document and it is only AH, BH, CH, DH which we are not using. The code is good.

> 
>> Also I have question about applications which benefit from it. Which applications has such pattern?
>> I did not find it in discussion you pointed.
> 
> for example:
> 
> http://hg.openjdk.java.net/jdk/jdk/file/f6583d7cff56/src/java.base/share/classes/java/lang/invoke/LambdaFormBuffer.java#l42
> http://hg.openjdk.java.net/jdk/jdk/file/f6583d7cff56/src/java.base/share/classes/java/lang/invoke/LambdaFormBuffer.java#l234
> http://hg.openjdk.java.net/jdk/jdk/file/f6583d7cff56/src/java.base/share/classes/java/lang/invoke/LambdaFormBuffer.java#l293
> 
> would benefit from these instructions.

Right.

> 
> Please, let me know if you have any other comment.
No more comments.

Thanks,
Vladimir

> 
> Thanks,
> Bernard
> 
>> Thanks,
>> Vladimir
>>
>> On 11/7/18 10:10 AM, B. Blaser wrote:
>>> Hi,
>>>
>>> Please review the following small fix for [1] briefly discussed in thread [2]:
>>>
>>> http://cr.openjdk.java.net/~bsrbnd/jdk8213479/webrev.00/
>>>
>>> It adds missing patterns to x86_64.ad for 8-bit logical operators with
>>> destination in memory.
>>> For example, the following method would use 4 instructions and 2
>>> registers instead of currently 10 instructions and 5 registers, see
>>> [1]:
>>>
>>>       private static byte and = 0b0011, or = 0b0011, xor = 0b0011;
>>>       private static byte mask = 0b0101;
>>>
>>>       public static void test() {
>>>           and &= mask;
>>>
>>>           or |= mask;
>>>
>>>           xor ^= mask;
>>>       }
>>>
>>> Tier1 is OK (hotspot+jdk+langtools).
>>>
>>> Any feedback is welcome,
>>> Bernard
>>>
>>> [1] https://bugs.openjdk.java.net/browse/JDK-8213479
>>> [2] http://mail.openjdk.java.net/pipermail/jdk-dev/2018-November/002181.html
>>>


More information about the hotspot-dev mailing list