This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] RISC-V: Only relax to C.LUI when imm != 0 and rd != 0/2
- From: Nick Clifton <nickc at redhat dot com>
- To: Palmer Dabbelt <palmer at dabbelt dot com>, binutils at sourceware dot org
- Cc: patches at groups dot riscv dot org, Andrew Waterman <andrew at sifive dot com>
- Date: Mon, 23 Oct 2017 10:45:43 +0100
- Subject: Re: [PATCH] RISC-V: Only relax to C.LUI when imm != 0 and rd != 0/2
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=nickc at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D5C1185A05
- References: <20171020230600.18778-1-palmer@dabbelt.com>
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