powerpc optimiser incorrectly failed to realise that, almost uniquely, RLWMI does a read-modify-write of its destination, and therefore: 1. peep.c must mark the instruction as "read, read, rar" in copyu 2. peep.c must not allow the instruction to act like a move in subprop (in the sense that it fully-replaces a register's contents). the error affected only programs that used right shifts of vlongs. Reference: /n/sources/patch/applied/qc-peep Date: Mon Mar 7 01:11:50 CET 2011 Signed-off-by: forsyth@terzarima.net --- /sys/src/cmd/qc/peep.c Mon Mar 7 01:07:41 2011 +++ /sys/src/cmd/qc/peep.c Mon Mar 7 01:07:38 2011 @@ -423,8 +423,6 @@ case AREMU: case ARLWNM: case ARLWNMCC: - case ARLWMI: - case ARLWMICC: case AFADD: case AFADDS: @@ -621,7 +619,6 @@ print(" (???)"); return 2; - case ANOP: /* read, write */ case AMOVW: case AMOVH: @@ -666,6 +663,12 @@ return 1; return 0; + case ARLWMI: /* read read rar */ + case ARLWMICC: + if(copyas(&p->to, v)) + return 2; + /* fall through */ + case AADD: /* read read write */ case AADDC: case AADDE: @@ -693,8 +696,6 @@ case ADIVWU: case AREM: case AREMU: - case ARLWMI: - case ARLWMICC: case ARLWNM: case ARLWNMCC: