[aarch64-port-dev ] AArch64: Why should we use rscratch1 instead of the temp register passed in?

dean.long at oracle.com dean.long at oracle.com
Wed Sep 12 03:30:47 UTC 2018


Isn't this the same problem LIR_Assembler::emit_typecheck_helper() is 
solving with this code:

   *if*  (obj <https://java.se.oracle.com/source/s?defs=obj&project=jdk-jdk>  ==k_RInfo <https://java.se.oracle.com/source/s?defs=k_RInfo&project=jdk-jdk>) {
     k_RInfo <https://java.se.oracle.com/source/s?defs=k_RInfo&project=jdk-jdk>  =dst <https://java.se.oracle.com/source/s?defs=dst&project=jdk-jdk>;
   }*else*  *if*  (obj <https://java.se.oracle.com/source/s?defs=obj&project=jdk-jdk>  ==klass_RInfo 
<https://java.se.oracle.com/source/s?defs=klass_RInfo&project=jdk-jdk>) {
     klass_RInfo 
<https://java.se.oracle.com/source/s?defs=klass_RInfo&project=jdk-jdk>  =dst <https://java.se.oracle.com/source/s?defs=dst&project=jdk-jdk>;
   }
   *if*  (k->is_loaded 
<https://java.se.oracle.com/source/s?defs=is_loaded&project=jdk-jdk>() && !UseCompressedClassPointers 
<https://java.se.oracle.com/source/s?defs=UseCompressedClassPointers&project=jdk-jdk>) {
     select_different_registers 
<https://java.se.oracle.com/source/s?defs=select_different_registers&project=jdk-jdk>(obj <https://java.se.oracle.com/source/s?defs=obj&project=jdk-jdk>,dst <https://java.se.oracle.com/source/s?defs=dst&project=jdk-jdk>,k_RInfo <https://java.se.oracle.com/source/s?defs=k_RInfo&project=jdk-jdk>,klass_RInfo 
<https://java.se.oracle.com/source/s?defs=klass_RInfo&project=jdk-jdk>);

(though the if-else and the select_different_registers appear to me to 
be doing the same thing here.)

There's an input operand that isn't live after this instruction, so its 
register can be reused by the result or one of the temps. If it's a 
temp, find out which one and use the result register instead.

dl


On 9/11/18 6:00 PM, Pengfei Li (Arm Technology China) wrote:
> Hi Roman,
>
>> .. the opr3 is marked as 'temp' (if it's assigned a valid value) which means it
>> should be live for the lifetime of the instruction, but not before or after it.
>> Maybe that comment is obsolete? Have you tried to use opr3/Rscratch ?
>
> Thanks for your reply.
>
> I've tried to use Rscratch and assertion failed at http://hg.openjdk.java.net/jdk/jdk/file/bbc7157ad9c5/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp#l1774.
> RA assigns the same register (rscratch) to Rdividend just as your comment said. So that comment is not obsolete.
>
> --
> Thanks,
> Pengfei



More information about the aarch64-port-dev mailing list