Commit e5009e29 authored by Russ Cox's avatar Russ Cox

6a: assemble CMPPD as 6l expects

libmach: disassemble CMPPD as 6a expects

R=ken2
CC=Charlie Dorian, golang-dev
https://golang.org/cl/1704046
parent bf109827
...@@ -260,7 +260,7 @@ spec8: /* CMPPS/CMPPD */ ...@@ -260,7 +260,7 @@ spec8: /* CMPPS/CMPPD */
{ {
$$.from = $1; $$.from = $1;
$$.to = $3; $$.to = $3;
$$.from.offset = $5; $$.to.offset = $5;
} }
spec9: /* shufl */ spec9: /* shufl */
......
...@@ -695,7 +695,7 @@ static Optable optab0F[256]= ...@@ -695,7 +695,7 @@ static Optable optab0F[256]=
[0xB1] RM,0, "CMPXCHG%S %r,%e", [0xB1] RM,0, "CMPXCHG%S %r,%e",
[0xC0] RMB,0, "XADDB %r,%e", [0xC0] RMB,0, "XADDB %r,%e",
[0xC1] RM,0, "XADD%S %r,%e", [0xC1] RM,0, "XADD%S %r,%e",
[0xC2] RM,Ib, "CMP%s %i,%x,%X", [0xC2] RM,Ib, "CMP%s %x,%X,%#i",
[0xC3] RM,0, "MOVNTI%S %r,%e", [0xC3] RM,0, "MOVNTI%S %r,%e",
[0xC6] RM,Ib, "SHUF%s %i,%x,%X", [0xC6] RM,Ib, "SHUF%s %i,%x,%X",
[0xC8] 0,0, "BSWAP AX", [0xC8] 0,0, "BSWAP AX",
...@@ -2074,6 +2074,7 @@ pea(Instr *ip) ...@@ -2074,6 +2074,7 @@ pea(Instr *ip)
static void static void
prinstr(Instr *ip, char *fmt) prinstr(Instr *ip, char *fmt)
{ {
int sharp;
vlong v; vlong v;
if (ip->prefix) if (ip->prefix)
...@@ -2083,7 +2084,12 @@ prinstr(Instr *ip, char *fmt) ...@@ -2083,7 +2084,12 @@ prinstr(Instr *ip, char *fmt)
*ip->curr++ = *fmt; *ip->curr++ = *fmt;
continue; continue;
} }
switch(*++fmt){ sharp = 0;
if(*++fmt == '#') {
sharp = 1;
++fmt;
}
switch(*fmt){
case '%': case '%':
*ip->curr++ = '%'; *ip->curr++ = '%';
break; break;
...@@ -2107,6 +2113,7 @@ prinstr(Instr *ip, char *fmt) ...@@ -2107,6 +2113,7 @@ prinstr(Instr *ip, char *fmt)
bprint(ip,"%s", ONAME(ip)); bprint(ip,"%s", ONAME(ip));
break; break;
case 'i': case 'i':
if(!sharp)
bprint(ip, "$"); bprint(ip, "$");
v = ip->imm; v = ip->imm;
if(ip->rex & REXW) if(ip->rex & REXW)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment