Re: [PATCH] xtensa: Optimize integer constant addition that is between -32896 and 32639
On Sun, Jun 26, 2022 at 7:53 AM Takayuki 'January June' Suwa wrote: > > Such constants are often subject to the constant synthesis: > > int test(int a) { > return a - 31999; > } > > test: > movia3, 1 > addmi a3, a3, -0x7d00 > add a2, a2, a3 >
[PATCH] xtensa: Optimize integer constant addition that is between -32896 and 32639
Such constants are often subject to the constant synthesis: int test(int a) { return a - 31999; } test: movia3, 1 addmi a3, a3, -0x7d00 add a2, a2, a3 ret This patch optimizes such case as follows: test: addia2, a2, 1