Re: [PATCH 2/3] RISC-V: Additional large constant synthesis improvements

2024-09-05 Thread Raphael Zinsly
On Thu, Sep 5, 2024 at 3:41 PM Jeff Law wrote: > > > > On 9/5/24 12:38 PM, Raphael Zinsly wrote: > > On Thu, Sep 5, 2024 at 3:10 PM Jeff Law wrote: > >> On 9/5/24 6:16 AM, Raphael Zinsly wrote: > >>> On Wed, Sep 4, 2024 at 8:32 PM Jeff Law wrote: > On 9/2/24 2:01 PM, Raphael Moreira Zinsly

Re: [PATCH 2/3] RISC-V: Additional large constant synthesis improvements

2024-09-05 Thread Jeff Law
On 9/5/24 12:38 PM, Raphael Zinsly wrote: On Thu, Sep 5, 2024 at 3:10 PM Jeff Law wrote: On 9/5/24 6:16 AM, Raphael Zinsly wrote: On Wed, Sep 4, 2024 at 8:32 PM Jeff Law wrote: On 9/2/24 2:01 PM, Raphael Moreira Zinsly wrote: ... + bool bit31 = (hival & 0x8000) != 0; + int

Re: [PATCH 2/3] RISC-V: Additional large constant synthesis improvements

2024-09-05 Thread Raphael Zinsly
On Thu, Sep 5, 2024 at 3:10 PM Jeff Law wrote: > On 9/5/24 6:16 AM, Raphael Zinsly wrote: > > On Wed, Sep 4, 2024 at 8:32 PM Jeff Law wrote: > >> On 9/2/24 2:01 PM, Raphael Moreira Zinsly wrote: > >> ... > >>> + bool bit31 = (hival & 0x8000) != 0; > >>> + int trailing_shift = ctz_hw

Re: [PATCH 2/3] RISC-V: Additional large constant synthesis improvements

2024-09-05 Thread Jeff Law
On 9/5/24 6:16 AM, Raphael Zinsly wrote: On Wed, Sep 4, 2024 at 8:32 PM Jeff Law wrote: On 9/2/24 2:01 PM, Raphael Moreira Zinsly wrote: ... + bool bit31 = (hival & 0x8000) != 0; + int trailing_shift = ctz_hwi (loval) - ctz_hwi (hival); + int leading_shift = clz_hwi (lova

Re: [PATCH 2/3] RISC-V: Additional large constant synthesis improvements

2024-09-05 Thread Raphael Zinsly
On Wed, Sep 4, 2024 at 8:32 PM Jeff Law wrote: > On 9/2/24 2:01 PM, Raphael Moreira Zinsly wrote: > ... > > + bool bit31 = (hival & 0x8000) != 0; > > + int trailing_shift = ctz_hwi (loval) - ctz_hwi (hival); > > + int leading_shift = clz_hwi (loval) - clz_hwi (hival); > > +

Re: [PATCH 2/3] RISC-V: Additional large constant synthesis improvements

2024-09-04 Thread Jeff Law
On 9/2/24 2:01 PM, Raphael Moreira Zinsly wrote: Improve handling of large constants in riscv_build_integer, generate better code for constants where the high half can be constructed by shifting/shiftNadding the low half or if the halves differ by less than 2k. gcc/ChangeLog: * config

[PATCH 2/3] RISC-V: Additional large constant synthesis improvements

2024-09-02 Thread Raphael Moreira Zinsly
Improve handling of large constants in riscv_build_integer, generate better code for constants where the high half can be constructed by shifting/shiftNadding the low half or if the halves differ by less than 2k. gcc/ChangeLog: * config/riscv/riscv.cc (riscv_build_integer): Detect new case