Re: [PATCH] xtensa: Optimize stack frame adjustment more

2023-01-06 Thread Takayuki 'January June' Suwa via Gcc-patches
On 2023/01/06 17:05, Max Filippov wrote: > On Thu, Jan 5, 2023 at 10:57 PM Takayuki 'January June' Suwa > wrote: >> By using the helper function, it makes stack frame adjustment logic >> simplified and instruction count less in some cases. > > I've built a couple linux configurations with and

Re: [PATCH] xtensa: Optimize stack frame adjustment more

2023-01-06 Thread Max Filippov via Gcc-patches
On Thu, Jan 5, 2023 at 10:57 PM Takayuki 'January June' Suwa wrote: > By using the helper function, it makes stack frame adjustment logic > simplified and instruction count less in some cases. I've built a couple linux configurations with and without this change and I observe consistent code

Re: [PATCH] xtensa: Optimize stack frame adjustment more

2023-01-05 Thread Takayuki 'January June' Suwa via Gcc-patches
On 2023/01/06 15:26, Max Filippov wrote: > On Thu, Jan 5, 2023 at 7:35 PM Takayuki 'January June' Suwa > wrote: >> On second thought, it cannot be a good idea to split addition/subtraction to >> the stack pointer. >> >>> -4aaf: b0a192 movia9, 0x1b0 >>> -4ab2: 1f9a

Re: [PATCH] xtensa: Optimize stack frame adjustment more

2023-01-05 Thread Max Filippov via Gcc-patches
On Thu, Jan 5, 2023 at 7:35 PM Takayuki 'January June' Suwa wrote: > On second thought, it cannot be a good idea to split addition/subtraction to > the stack pointer. > > > -4aaf: b0a192 movia9, 0x1b0 > > -4ab2: 1f9aadd.n a1, a15, a9 > > > +4aaf:

Re: [PATCH] xtensa: Optimize stack frame adjustment more

2023-01-05 Thread Takayuki 'January June' Suwa via Gcc-patches
On 2023/01/06 6:32, Max Filippov wrote: > Hi Suwa-san, Hi! > > On Thu, Jan 5, 2023 at 3:57 AM Takayuki 'January June' Suwa > wrote: >> >> This patch introduces a convenient helper function for integer immediate >> addition with scratch register as needed, that splits and emits either >> up to

Re: [PATCH] xtensa: Optimize stack frame adjustment more

2023-01-05 Thread Max Filippov via Gcc-patches
Hi Suwa-san, On Thu, Jan 5, 2023 at 3:57 AM Takayuki 'January June' Suwa wrote: > > This patch introduces a convenient helper function for integer immediate > addition with scratch register as needed, that splits and emits either > up to two ADDI/ADDMI machine instructions or an addition by

[PATCH] xtensa: Optimize stack frame adjustment more

2023-01-05 Thread Takayuki 'January June' Suwa via Gcc-patches
This patch introduces a convenient helper function for integer immediate addition with scratch register as needed, that splits and emits either up to two ADDI/ADDMI machine instructions or an addition by register following an immediate integer load (which may later be transformed by