Add tokens vex.ww and vex.wx; vex.wx is the default

Add vex.ww (for VEX.W follows REX.W) and vex.wx (for VEX.W is a don't
care); vex.wx is the default since that seems to match existing usage
better.
This commit is contained in:
H. Peter Anvin 2008-05-22 11:24:35 -07:00
parent 7c71949931
commit bd420c7095
3 changed files with 17 additions and 6 deletions

View File

@ -64,9 +64,11 @@
* VEX prefixes are followed by the sequence:
* \mm\wlp where mm is the M field; and wlp is:
* 00 0ww lpp
* ww = 0 for W = 0
* ww = 1 for W = 1
* ww = 2 for W used as REX.W
* [w0] ww = 0 for W = 0
* [w1] ww = 1 for W = 1
* [wx] ww = 2 for W don't care (always assembled as 0)
* [ww] ww = 3 for W used as REX.W
*
*
* \310 - indicates fixed 16-bit address size, i.e. optional 0x67.
* \311 - indicates fixed 32-bit address size, i.e. optional 0x67.
@ -1159,13 +1161,14 @@ static int64_t calcsize(int32_t segment, int64_t offset, int bits,
}
switch (ins->vex_wlp & 030) {
case 000:
case 020:
ins->rex &= ~REX_W;
break;
case 010:
ins->rex |= REX_W;
bad32 &= ~REX_W;
break;
default:
case 030:
/* Follow REX_W */
break;
}

View File

@ -709,9 +709,13 @@ static int matches(const struct itemplate *t, uint8_t *data,
case 010:
if (!(prefix->rex & REX_W))
return false;
ins->rex &= ~REX_W;
break;
case 020: /* VEX.W is a don't care */
ins->rex &= ~REX_W;
break;
case 030:
break;
default:
break; /* XXX: Need to do anything special here? */
}
if ((vexwlp & 007) != prefix->vex_lp)

View File

@ -611,6 +611,10 @@ sub byte_code_compile($) {
$w = 0;
} elsif ($oq eq 'w1') {
$w = 1;
} elsif ($oq eq 'wx') {
$w = 2;
} elsif ($oq eq 'ww') {
$w = 3;
} elsif ($oq eq '66') {
$p = 1;
} elsif ($oq eq 'f3') {