This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/2, expr.c] Optimize switch with sign-extended index.
- From: Jim Wilson <jimw at sifive dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Jim Wilson <jimw at sifive dot com>
- Date: Wed, 9 May 2018 14:20:39 -0700
- Subject: Re: [PATCH 1/2, expr.c] Optimize switch with sign-extended index.
- References: <20180502220516.6521-1-jimw@sifive.com>
On Wed, May 2, 2018 at 3:05 PM, Jim Wilson <jimw@sifive.com> wrote:
> This improves the code for a switch statement on targets that sign-extend
> function arguments, such as RISC-V. Given a simple testcase
> ...
> gcc/
> * expr.c (do_tablejump): When converting index to Pmode, if we have a
> sign extended promoted subreg, and the range does not have the sign bit
> set, then do a sign extend.
Ping.
Jim