Re: x86 branches vs conditional moves

2017-08-04 Thread Steven Bosscher
On Sat, Jul 8, 2017 at 1:30 AM, Michael Clark wrote: > Why does gcc branch on _Bool, but emits a conditional move for an integer? > can it emit cmovne instead of branching? also curious where one would change > this to learn about GCC internals. The RTL generated for the int and _Bool case is

Re: x86 branches vs conditional moves

2017-07-08 Thread Jeff Law
On 07/08/2017 01:31 AM, Yuri Gribov wrote: > On Sat, Jul 8, 2017 at 12:30 AM, Michael Clark wrote: >> Hi, >> >> Curious about this codegen: >> >> - https://godbolt.org/g/5XxP5S >> >> Why does gcc branch on _Bool, but emits a conditional move for an integer? >> can it emit

Re: x86 branches vs conditional moves

2017-07-08 Thread Yuri Gribov
On Sat, Jul 8, 2017 at 12:30 AM, Michael Clark wrote: > Hi, > > Curious about this codegen: > > - https://godbolt.org/g/5XxP5S > > Why does gcc branch on _Bool, but emits a conditional move for an integer? > can it emit cmovne instead of branching? also curious where one

x86 branches vs conditional moves

2017-07-07 Thread Michael Clark
Hi, Curious about this codegen: - https://godbolt.org/g/5XxP5S Why does gcc branch on _Bool, but emits a conditional move for an integer? can it emit cmovne instead of branching? also curious where one would change this to learn about GCC internals. It’s not a bug, but it is a performance