This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] RISC-V: Only relax to C.LUI when imm != 0 and rd != 0/2


Hi Palmer,

> 2017-10-20  Andrew Waterman  <andrew@sifive.com>
> 
>         * elfnn-riscv.c (_bfd_riscv_relax_lui): Don't relax to c.lui
>         when rd is x0.
>
> include/ChangeLog
> 
> 2017-10-20  Andrew Waterman  <andrew@sifive.com>
> 
>         * opcode/riscv.h (VALID_RVC_LUI_IMM): c.lui can't load the
>         immediate 0.

Please could you, or Andrew, add a gas testsuite entry to check that this
change remains effective in the future ?

Also:

> -      /* Replace LUI with C.LUI if legal (i.e., rd != x2/sp).  */
> +      /* Replace LUI with C.LUI if legal (i.e., rd != x0 or x2/sp).  */

I would suggest changing this comment to:

        /* Replace LUI with C.LUI if legal (i.e., rd != x0 and rd != x2/sp).  */

just to make the logic clear.

Cheers
  Nick


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]