small changes from go's 6l. there's a further change to optab.c, but that one is wrong (unless my amd64 manual is wrong) --- it turns out that intel deprecates the use of /63 without rex.w, so i'll make a further change once i've checked it. Reference: /n/sources/patch/applied/6l-20111130 Date: Thu Dec 1 18:30:19 CET 2011 Signed-off-by: forsyth@terzarima.net --- /sys/src/cmd/6l/span.c Wed Nov 30 11:37:30 2011 +++ /sys/src/cmd/6l/span.c Wed Nov 30 11:37:24 2011 @@ -1574,7 +1574,7 @@ /* * as befits the whole approach of the architecture, * the rex prefix must appear before the first opcode byte - * (and thus after any 66/67/f2/f3 prefix bytes, but + * (and thus after any 66/67/f2/f3/26/2e/3e prefix bytes, but * before the 0f opcode escape!), or it might be ignored. * note that the handbook often misleadingly shows 66/f2/f3 in `opcode'. */ @@ -1583,7 +1583,7 @@ n = andptr - and; for(np = 0; np < n; np++) { c = and[np]; - if(c != 0x66 && c != 0xf2 && c != 0xf3 && c != 0x67) + if(c != 0xf2 && c != 0xf3 && (c < 0x64 || c > 0x67) && c != 0x2e && c != 0x3e && c != 0x26) break; } memmove(and+np+1, and+np, n-np); --- /sys/src/cmd/6l/optab.c Wed Nov 30 11:37:38 2011 +++ /sys/src/cmd/6l/optab.c Wed Nov 30 11:37:33 2011 @@ -753,7 +753,7 @@ { AMOVBWSX, ymb_rl, Pq, 0xbe }, { AMOVBWZX, ymb_rl, Pq, 0xb6 }, { AMOVO, yxmov, Pe, 0x6f,0x7f }, - { AMOVOU, yxmov, Pf2, 0x6f,0x7f }, + { AMOVOU, yxmov, Pf3, 0x6f,0x7f }, { AMOVHLPS, yxr, Pm, 0x12 }, { AMOVHPD, yxmov, Pe, 0x16,0x17 }, { AMOVHPS, yxmov, Pm, 0x16,0x17 }, @@ -877,9 +877,9 @@ { APOPQ, ypopl, Py, 0x58,0x8f,(00) }, { APOPW, ypopl, Pe, 0x58,0x8f,(00) }, { APOR, ymm, Py, 0xeb,Pe,0xeb }, - { APSADBW, yxm, Pw, Pe,0xf6 }, + { APSADBW, yxm, Pq, 0xf6 }, { APSHUFHW, yxshuf, Pf3, 0x70 }, - { APSHUFL, yxm, Pw, Pe,0x70 }, + { APSHUFL, yxshuf, Pq, 0x70 }, { APSHUFLW, yxshuf, Pf2, 0x70 }, { APSHUFW, ymshuf, Pm, 0x70 }, { APSLLO, ypsdq, Pq, 0x73,(07) },