[12] RFR 8206895: aarch64: rework error-prone cmp instruction

Boris Ulasevich boris.ulasevich at bell-sw.com
Wed Jul 11 15:42:26 UTC 2018

Please review the following patch:

cmp instruction overloading introduced to force user to specify 
immediate value type implicitly. The only allowed type is unsigned char. 
For immediate values outside of byte range subs macro should be called 

cmp calls all over the codes was fixed accordingly to the following plan:
   cmp(reg, imm8)  -> cmp(reg, (u1)imm8)
   cmp(reg, imm12) -> subs(zr, reg, imm12)
   cmp(reg, imm64) -> subs(scratch, reg, imm64)

The change was tested with jtreg tests.


On 09.07.2018 18:54, Andrew Haley wrote:
> On 07/09/2018 04:33 PM, Boris Ulasevich wrote:
>> sorry. updated review link:
>> http://cr.openjdk.java.net/~bulasevich/8206895/webrev.01
>> On 09.07.2018 18:32, Boris Ulasevich wrote:
>>> I am not sure how to mark instruction deprecated.
> http://mail.openjdk.java.net/pipermail/aarch64-port-dev/2018-May/005840.html
>   Why don't just remove
>>> it and update all the usage points? Here is the updated review:
>>> http://cr.openjdk.java.net/~bulasevich/8206895/webrev.01
>>> Boris
>>> On 09.07.2018 17:50, Andrew Haley wrote:
>>>> On 07/09/2018 03:31 PM, Boris Ulasevich wrote:
>>>>> http://cr.openjdk.java.net/~bulasevich/8206895/webrev.00
>>>>> https://bugs.openjdk.java.net/browse/JDK-8206895
>>>>> Byte form of cmp instruction was added. For bigger constants we are
>>>>> supposed to state _imm12 postfix implicitly or use cmp(reg,reg,imm)
>>>>> macro.
>>>> I don't think that making cmp an alias for subs helps anyone:
>>>> +  inline void cmp(Register Rd, Register Rn, unsigned imm32)  {
>>>> subs(Rd, Rn, imm32); }
>>>> I think the best suggestion was to make the 8-bit cmp the only form
>>>> allowed, mark the larger cmp as deprecated, and force the user to use
>>>> subs.  That would be easier to read than cmp_imm12().

More information about the hotspot-dev mailing list