Re: [PATCH] Use xchg for -Os (PR target/92549)

2019-12-01 Thread Uros Bizjak
On Sun, Dec 1, 2019 at 6:55 PM Jakub Jelinek wrote: > > On Sun, Dec 01, 2019 at 03:43:37PM +0100, Jan Hubicka wrote: > > > PR target/92549 > > > * config/i386/i386.md (peephole2 for *swap): New peephole2. > > > > > > * gcc.target/i386/pr92549.c: New test. > > > > It is very hard to ge

Re: [PATCH] Use xchg for -Os (PR target/92549)

2019-12-01 Thread Jakub Jelinek
On Sun, Dec 01, 2019 at 03:43:37PM +0100, Jan Hubicka wrote: > > PR target/92549 > > * config/i386/i386.md (peephole2 for *swap): New peephole2. > > > > * gcc.target/i386/pr92549.c: New test. > > It is very hard to get a testcase, unforutnately, but I got the > following (locally non

Re: [PATCH] Use xchg for -Os (PR target/92549)

2019-12-01 Thread Jan Hubicka
> Hi! > > xchg instruction is smaller, in some cases much smaller than 3 moves, > (e.g. in the testcase 2 bytes vs. 8 bytes), and is not a performance > disaster, but from Agner Fog tables and > https://stackoverflow.com/questions/45766444/why-is-xchg-reg-reg-a-3-micro-op-instruction-on-modern-int

Re: [PATCH] Use xchg for -Os (PR target/92549)

2019-11-19 Thread Vladimir Makarov
On 11/19/19 4:19 AM, Richard Biener wrote: On Tue, Nov 19, 2019 at 10:04 AM Jakub Jelinek wrote: Hi! xchg instruction is smaller, in some cases much smaller than 3 moves, (e.g. in the testcase 2 bytes vs. 8 bytes), and is not a performance disaster, but from Agner Fog tables and https://stacko

Re: [PATCH] Use xchg for -Os (PR target/92549)

2019-11-19 Thread Jan Hubicka
> Hi! > > xchg instruction is smaller, in some cases much smaller than 3 moves, > (e.g. in the testcase 2 bytes vs. 8 bytes), and is not a performance > disaster, but from Agner Fog tables and > https://stackoverflow.com/questions/45766444/why-is-xchg-reg-reg-a-3-micro-op-instruction-on-modern-int

Re: [PATCH] Use xchg for -Os (PR target/92549)

2019-11-19 Thread Uros Bizjak
On Tue, Nov 19, 2019 at 10:04 AM Jakub Jelinek wrote: > > Hi! > > xchg instruction is smaller, in some cases much smaller than 3 moves, > (e.g. in the testcase 2 bytes vs. 8 bytes), and is not a performance > disaster, but from Agner Fog tables and > https://stackoverflow.com/questions/45766444/wh

Re: [PATCH] Use xchg for -Os (PR target/92549)

2019-11-19 Thread Richard Biener
On Tue, Nov 19, 2019 at 10:04 AM Jakub Jelinek wrote: > > Hi! > > xchg instruction is smaller, in some cases much smaller than 3 moves, > (e.g. in the testcase 2 bytes vs. 8 bytes), and is not a performance > disaster, but from Agner Fog tables and > https://stackoverflow.com/questions/45766444/wh

[PATCH] Use xchg for -Os (PR target/92549)

2019-11-19 Thread Jakub Jelinek
Hi! xchg instruction is smaller, in some cases much smaller than 3 moves, (e.g. in the testcase 2 bytes vs. 8 bytes), and is not a performance disaster, but from Agner Fog tables and https://stackoverflow.com/questions/45766444/why-is-xchg-reg-reg-a-3-micro-op-instruction-on-modern-intel-architect