On 05/02/2018 04:05 PM, Jim Wilson wrote:
> This improves the code for a switch statement on targets that sign-extend
> function arguments, such as RISC-V. Given a simple testcase
>
> extern void asdf(int);
> void foo(int x) {
> switch (x) {
> case 0: asdf(10); break;
> case 1: asdf(11); br
On Thu, May 17, 2018 at 12:25 AM, Eric Botcazou wrote:
> The patch looks OK to me, modulo:
>
>> + && ! (INTVAL (range) & (HOST_WIDE_INT_1U << (width - 1
>
> I'd use UINTVAL instead of INTVAL here.
Thanks. Committed with that change.
Jim
> The following patch implements this optimization. It checks for a range
> that does not have the sign-bit set, and an index value that is already
> sign extended, and then does a sign extend instead of an zero extend.
>
> This has been tested with a riscv{32,64}-{elf,linux} builds and testsuite
On Wed, May 9, 2018 at 2:20 PM, Jim Wilson wrote:
> On Wed, May 2, 2018 at 3:05 PM, Jim Wilson 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_tableju
On Wed, May 2, 2018 at 3:05 PM, Jim Wilson 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
>
On Thu, May 3, 2018 at 11:29 PM, Jim Wilson wrote:
> On Thu, May 3, 2018 at 12:29 AM, Richard Biener
> wrote:
>> Just as a note, IIRC all the SUBREG_PROMOTED_* stuff is quite fragile
>> - I remember
>> Eric fixing things up a bit but some verification would be nice to
>> have (instrumentation
>>
On Thu, May 3, 2018 at 12:29 AM, Richard Biener
wrote:
> Just as a note, IIRC all the SUBREG_PROMOTED_* stuff is quite fragile
> - I remember
> Eric fixing things up a bit but some verification would be nice to
> have (instrumentation
> at RTL level that for SUBREG_PROMOTED_* the bits are as expec
On Thu, May 3, 2018 at 12:05 AM, Jim Wilson wrote:
> This improves the code for a switch statement on targets that sign-extend
> function arguments, such as RISC-V. Given a simple testcase
>
> extern void asdf(int);
> void foo(int x) {
> switch (x) {
> case 0: asdf(10); break;
> case 1: asd
This improves the code for a switch statement on targets that sign-extend
function arguments, such as RISC-V. Given a simple testcase
extern void asdf(int);
void foo(int x) {
switch (x) {
case 0: asdf(10); break;
case 1: asdf(11); break;
case 2: asdf(12); break;
case 3: asdf(13); break;