By: Wilco (Wilco.Dijkstra.delete@this.ntlworld.com), February 19, 2013 2:20 pm
Room: Moderated Discussions
anon (anon.delete@this.anon.com) on February 19, 2013 1:56 am wrote:
> Wilco (Wilco.Dijkstra.delete@this.ntlworld.com) on February 18, 2013 5:14 pm wrote:
> > Linus Torvalds (torvalds.delete@this.linux-foundation.org) on February 17, 2013 4:08 pm wrote:
> > > Wilco (Wilco.Dijkstra.delete@this.ntlworld.com) on February 17, 2013 1:47 pm wrote:
> > > >
> > > > One condition bit for arithmetic and logical operations is enough,
> > > > more than 90% of the time you only need a zero/non-zero
> > > > result.
> > >
> > > Not true.
> > >
> > > I just checked. At least for Linux, compare-against zero is just
> > > under 80% of the conditional branches. Not "more than 90%".
> >
> > That's not at all what I measured. In GCC, there are just 1609 non-compare ALU instructions
> > followed by a branch are for equality. 94% of those are for equality. Just 3 instructions,
> > adds, subs and movs followed by beq/bne account for 80%.
>
> Are you measuring static or dynamic instructions?
Just static of course. When you design a new ISA you obviously run lots of traces. I suppose for applications which don't use many loops, like GCC, dynamic stats will be fairly similar. When you do have loops which iterate a lot, the way the loop optimizer works (unrolling, downcount to zero etc) would skew the stats significantly.
Wilco
> Wilco (Wilco.Dijkstra.delete@this.ntlworld.com) on February 18, 2013 5:14 pm wrote:
> > Linus Torvalds (torvalds.delete@this.linux-foundation.org) on February 17, 2013 4:08 pm wrote:
> > > Wilco (Wilco.Dijkstra.delete@this.ntlworld.com) on February 17, 2013 1:47 pm wrote:
> > > >
> > > > One condition bit for arithmetic and logical operations is enough,
> > > > more than 90% of the time you only need a zero/non-zero
> > > > result.
> > >
> > > Not true.
> > >
> > > I just checked. At least for Linux, compare-against zero is just
> > > under 80% of the conditional branches. Not "more than 90%".
> >
> > That's not at all what I measured. In GCC, there are just 1609 non-compare ALU instructions
> > followed by a branch are for equality. 94% of those are for equality. Just 3 instructions,
> > adds, subs and movs followed by beq/bne account for 80%.
>
> Are you measuring static or dynamic instructions?
Just static of course. When you design a new ISA you obviously run lots of traces. I suppose for applications which don't use many loops, like GCC, dynamic stats will be fairly similar. When you do have loops which iterate a lot, the way the loop optimizer works (unrolling, downcount to zero etc) would skew the stats significantly.
Wilco