it's fine to use movem (ldm) to help copy several words at once, but if words loaded are subsequently stored by single MOVs as they can be, the registers need to be allocated so the result is in the original order. Reference: /n/sources/patch/applied/5c-sugen Date: Wed Jul 4 17:49:39 CES 2007 Signed-off-by: forsyth@terzarima.net --- /sys/src/cmd/5c/cgen.c Wed Jul 4 17:48:01 2007 +++ /sys/src/cmd/5c/cgen.c Wed Jul 4 17:47:57 2007 @@ -1071,6 +1071,10 @@ } regalloc(&nod3, ®node, Z); regalloc(&nod4, ®node, Z); + if(nod3.reg > nod4.reg){ + /* code below assumes nod3 loaded first */ + Node t = nod3; nod3 = nod4; nod4 = t; + } nod0 = *nodconst((1<