Re: [PATCH] RISC-V: Optimise adding a (larger than simm12) constant

2022-11-21 Thread Philipp Tomsich
On Mon, 21 Nov 2022 at 04:11, Kito Cheng wrote: > > > @@ -464,6 +464,60 @@ > >[(set_attr "type" "arith") > > (set_attr "mode" "DI")]) > > > > +(define_expand "add3" > > + [(set (match_operand:GPR 0 "register_operand" "=r,r") > > + (plus:GPR (match_operand:GPR 1

Re: [PATCH] RISC-V: Optimise adding a (larger than simm12) constant

2022-11-20 Thread Kito Cheng via Gcc-patches
> @@ -464,6 +464,60 @@ >[(set_attr "type" "arith") > (set_attr "mode" "DI")]) > > +(define_expand "add3" > + [(set (match_operand:GPR 0 "register_operand" "=r,r") > + (plus:GPR (match_operand:GPR 1 "register_operand" " r,r") > + (match_operand:GPR

Re: [PATCH] RISC-V: Optimise adding a (larger than simm12) constant

2022-11-18 Thread Jeff Law
On 11/18/22 14:26, Philipp Tomsich wrote: On Fri, 18 Nov 2022 at 22:13, Jeff Law wrote: On 11/9/22 16:07, Philipp Tomsich wrote: Handling the register-const_int addition has very quickly escalated to creating a full sign-extended 32bit constant and performing a register-register for RISC-V

Re: [PATCH] RISC-V: Optimise adding a (larger than simm12) constant

2022-11-18 Thread Philipp Tomsich
On Fri, 18 Nov 2022 at 22:13, Jeff Law wrote: > > > On 11/9/22 16:07, Philipp Tomsich wrote: > > Handling the register-const_int addition has very quickly escalated to > > creating a full sign-extended 32bit constant and performing a > > register-register for RISC-V in GCC so far, resulting in

Re: [PATCH] RISC-V: Optimise adding a (larger than simm12) constant

2022-11-18 Thread Jeff Law via Gcc-patches
On 11/9/22 16:07, Philipp Tomsich wrote: Handling the register-const_int addition has very quickly escalated to creating a full sign-extended 32bit constant and performing a register-register for RISC-V in GCC so far, resulting in sequences like (for the case of "a + 2048"): li

[PATCH] RISC-V: Optimise adding a (larger than simm12) constant

2022-11-09 Thread Philipp Tomsich
Handling the register-const_int addition has very quickly escalated to creating a full sign-extended 32bit constant and performing a register-register for RISC-V in GCC so far, resulting in sequences like (for the case of "a + 2048"): li a5,4096 addia5,a5,-2048 add