Re: [gcc-15 2/3] RISC-V: avoid LUI based const mat: keep stack offsets aligned

2024-03-22 Thread Jeff Law
On 3/19/24 2:05 PM, Vineet Gupta wrote: On 3/19/24 06:10, Jeff Law wrote: On 3/19/24 12:48 AM, Andrew Waterman wrote: On Mon, Mar 18, 2024 at 5:28 PM Vineet Gupta wrote: On 3/16/24 13:21, Jeff Law wrote: | 59944:add s0,sp,2047 < | 59948:mv a2,a0 | 5994c:m

Re: [gcc-15 2/3] RISC-V: avoid LUI based const mat: keep stack offsets aligned

2024-03-20 Thread Jeff Law
On 3/19/24 2:05 PM, Vineet Gupta wrote: Just to be clear, the changes don't misalign the stack pointer at all. They merely have the potential to create *another* pointer into the stack which may or may not be aligned. Which is totally normal, it's no different than taking the address of a ch

Re: [gcc-15 2/3] RISC-V: avoid LUI based const mat: keep stack offsets aligned

2024-03-19 Thread Palmer Dabbelt
On Tue, 19 Mar 2024 13:05:54 PDT (-0700), Vineet Gupta wrote: On 3/19/24 06:10, Jeff Law wrote: On 3/19/24 12:48 AM, Andrew Waterman wrote: On Mon, Mar 18, 2024 at 5:28 PM Vineet Gupta wrote: On 3/16/24 13:21, Jeff Law wrote: | 59944:add s0,sp,2047 < | 59948:mv a2

Re: [gcc-15 2/3] RISC-V: avoid LUI based const mat: keep stack offsets aligned

2024-03-19 Thread Andrew Waterman
On Tue, Mar 19, 2024 at 1:05 PM Vineet Gupta wrote: > > > > On 3/19/24 06:10, Jeff Law wrote: > > On 3/19/24 12:48 AM, Andrew Waterman wrote: > >> On Mon, Mar 18, 2024 at 5:28 PM Vineet Gupta wrote: > >>> On 3/16/24 13:21, Jeff Law wrote: > | 59944:add s0,sp,2047 < > |

Re: [gcc-15 2/3] RISC-V: avoid LUI based const mat: keep stack offsets aligned

2024-03-19 Thread Vineet Gupta
On 3/19/24 06:10, Jeff Law wrote: > On 3/19/24 12:48 AM, Andrew Waterman wrote: >> On Mon, Mar 18, 2024 at 5:28 PM Vineet Gupta wrote: >>> On 3/16/24 13:21, Jeff Law wrote: | 59944:add s0,sp,2047 < | 59948:mv a2,a0 | 5994c:mv a3,a1 | 59

Re: [gcc-15 2/3] RISC-V: avoid LUI based const mat: keep stack offsets aligned

2024-03-19 Thread Jeff Law
On 3/19/24 12:48 AM, Andrew Waterman wrote: On Mon, Mar 18, 2024 at 5:28 PM Vineet Gupta wrote: On 3/16/24 13:21, Jeff Law wrote: | 59944:add s0,sp,2047 < | 59948:mv a2,a0 | 5994c:mv a3,a1 | 59950:mv a0,sp | 59954:li a4,1 | 599

Re: [gcc-15 2/3] RISC-V: avoid LUI based const mat: keep stack offsets aligned

2024-03-18 Thread Andrew Waterman
On Mon, Mar 18, 2024 at 5:28 PM Vineet Gupta wrote: > > > > On 3/16/24 13:21, Jeff Law wrote: > > | 59944:add s0,sp,2047 < > > | 59948:mv a2,a0 > > | 5994c:mv a3,a1 > > | 59950:mv a0,sp > > | 59954:li a4,1 > > | 59958:lui a1,0x1

Re: [gcc-15 2/3] RISC-V: avoid LUI based const mat: keep stack offsets aligned

2024-03-18 Thread Vineet Gupta
On 3/16/24 13:21, Jeff Law wrote: > | 59944:add s0,sp,2047 < > | 59948:mv a2,a0 > | 5994c:mv a3,a1 > | 59950:mv a0,sp > | 59954:li a4,1 > | 59958:lui a1,0x1 > | 5995c:add s0,s0,1 <--- > | 59960:jal 59a3c

Re: [gcc-15 2/3] RISC-V: avoid LUI based const mat: keep stack offsets aligned

2024-03-16 Thread Jeff Law
On 3/16/24 11:35 AM, Vineet Gupta wrote: Noticed that new sum of two s12 splitter was generating following: | 059930 : | 59930: add sp,sp,-16 | 59934: lui t0,0xf | 59938: sd s0,0(sp) | 5993c: sd ra,8(sp) | 59940: add sp,sp,t0 | 59

[gcc-15 2/3] RISC-V: avoid LUI based const mat: keep stack offsets aligned

2024-03-16 Thread Vineet Gupta
Noticed that new sum of two s12 splitter was generating following: | 059930 : | 59930: add sp,sp,-16 | 59934: lui t0,0xf | 59938: sd s0,0(sp) | 5993c: sd ra,8(sp) | 59940: add sp,sp,t0 | 59944: add s0,sp,2047 < | 59948: