By: rwessel (robertwessel.delete@this.yahoo.com), February 14, 2013 4:03 pm
Room: Moderated Discussions
Etienne (etienne_lorrain.delete@this.yahoo.fr) on February 14, 2013 6:00 am wrote:
> Maynard Handley (name99.delete@this.redheron.com) on February 13, 2013 3:53 pm wrote:
> > The right solution is what it has always been --- the PPC/POWER solution.
> > (a) Multiple condition registers.
> > ...
> > (c) Compares can choose which condition register to modify.
>
> But then you need (and do not have on PPC) complex conditional jumps in most
> real world examples where you need to "jump if (R1 < R2) and (R2 Conditional jumps (on PPC) cannot reference multiple condition registers, so
> the compiler has to set a single condition bit "if (R1 < R2) and (R2 so it has to only test "(R2 < R6)" if "(R1 I did not see a C compiler using efficiently multiple condition codes, but
> I nearly only used GCC on PPC so my experience is to be taken with a pinch of salt.
If you managed to get conditions into different condition code regs on PPC, there are instructions to perform logical operations on them For example, you could use a crand on the "less than" bits of two CR fields to create a third CR that would have the combined result.
The big nuisance on PPC is that most results only go to one place (CR0 for integer operation, CR1 for FP), and if you want to save it, you have to explicitly movc it to another CR.
> Maynard Handley (name99.delete@this.redheron.com) on February 13, 2013 3:53 pm wrote:
> > The right solution is what it has always been --- the PPC/POWER solution.
> > (a) Multiple condition registers.
> > ...
> > (c) Compares can choose which condition register to modify.
>
> But then you need (and do not have on PPC) complex conditional jumps in most
> real world examples where you need to "jump if (R1 < R2) and (R2 Conditional jumps (on PPC) cannot reference multiple condition registers, so
> the compiler has to set a single condition bit "if (R1 < R2) and (R2 so it has to only test "(R2 < R6)" if "(R1 I did not see a C compiler using efficiently multiple condition codes, but
> I nearly only used GCC on PPC so my experience is to be taken with a pinch of salt.
If you managed to get conditions into different condition code regs on PPC, there are instructions to perform logical operations on them For example, you could use a crand on the "less than" bits of two CR fields to create a third CR that would have the combined result.
The big nuisance on PPC is that most results only go to one place (CR0 for integer operation, CR1 for FP), and if you want to save it, you have to explicitly movc it to another CR.