Re: RISC-V sign extension query

2023-09-27 Thread Jeff Law
On 9/27/23 00:29, Vineet Gupta wrote: Hi Jeff, We touched upon this in our airport "rendezvous". I'm curious if you have the wip bits lying around - (a) to get a feel for how this could be done and (b) to see why REE and/or similar construct in CSE don't work as expected. Not in any us

Re: RISC-V sign extension query

2023-09-26 Thread Vineet Gupta
Hi Jeff, On 9/19/23 07:59, Jeff Law wrote: On 9/18/23 21:37, Vineet Gupta wrote: On 9/18/23 19:41, Jeff Law wrote: On 9/18/23 13:45, Vineet Gupta wrote: For the cases which do require sign extends, but not being eliminated due to "missing definition(s)" I'm working on adapting Ajit's RE

Re: RISC-V sign extension query

2023-09-19 Thread Jeff Law
On 9/18/23 21:37, Vineet Gupta wrote: On 9/18/23 19:41, Jeff Law wrote: On 9/18/23 13:45, Vineet Gupta wrote: For the cases which do require sign extends, but not being eliminated due to "missing definition(s)" I'm working on adapting Ajit's REE ABI interfaces work [2] to work for RISC-V

Re: RISC-V sign extension query

2023-09-18 Thread Vineet Gupta
On 9/18/23 19:41, Jeff Law wrote: On 9/18/23 13:45, Vineet Gupta wrote: For the cases which do require sign extends, but not being eliminated due to "missing definition(s)" I'm working on adapting Ajit's REE ABI interfaces work [2] to work for RISC-V as well. I wonder if we could walk the DE

PR 111/466 (was Re: RISC-V sign extension query)

2023-09-18 Thread Vineet Gupta
On 9/18/23 19:41, Jeff Law wrote: On 9/18/23 13:45, Vineet Gupta wrote: For the cases which do require sign extends, but not being eliminated due to "missing definition(s)" I'm working on adapting Ajit's REE ABI interfaces work [2] to work for RISC-V as well. I wonder if we could walk the DEC

Re: RISC-V sign extension query

2023-09-18 Thread Jeff Law via Gcc-patches
On 9/18/23 13:45, Vineet Gupta wrote: For the cases which do require sign extends, but not being eliminated due to "missing definition(s)" I'm working on adapting Ajit's REE ABI interfaces work [2] to work for RISC-V as well. I wonder if we could walk the DECL_ARGUMENTS for current_functio

Re: RISC-V sign extension query

2023-09-18 Thread Jeff Law via Gcc-patches
On 9/18/23 13:45, Vineet Gupta wrote: Hi Jeff, Andrew I've been looking into redundant sign extension and while there are things to be improved in REE, there's something I wanted to confirm before heading off into the weeds. Consider the test below: int foo(int unused, int n, unsigned y,

Re: RISC-V sign extension query

2023-09-18 Thread Vineet Gupta
On 9/18/23 13:10, Andrew Waterman wrote: Vineet, Your understanding of the ABI is correct; both int and unsigned int arguments must already be sign-extended. The sext.w is semantically unnecessary; the bltu could correctly reference a1 instead of a6. Good luck eliminating it! Thanks for the

Re: RISC-V sign extension query

2023-09-18 Thread Andrew Waterman via Gcc-patches
Vineet, Your understanding of the ABI is correct; both int and unsigned int arguments must already be sign-extended. The sext.w is semantically unnecessary; the bltu could correctly reference a1 instead of a6. Good luck eliminating it! Andrew On Mon, Sep 18, 2023 at 12:45 PM Vineet Gupta wro

RISC-V sign extension query

2023-09-18 Thread Vineet Gupta
Hi Jeff, Andrew I've been looking into redundant sign extension and while there are things to be improved in REE, there's something I wanted to confirm before heading off into the weeds. Consider the test below: int foo(int unused, int n, unsigned y, unsigned delta){   int s = 0;   unsigned