summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--disasm.c2
-rw-r--r--insns.h2
-rwxr-xr-xinsns.pl12
3 files changed, 8 insertions, 8 deletions
diff --git a/disasm.c b/disasm.c
index 81282e61..ba282d34 100644
--- a/disasm.c
+++ b/disasm.c
@@ -1081,7 +1081,7 @@ int32_t disasm(uint8_t *data, char *output, int outbufsize, int segsize,
prefix.vex_lp = prefix.vex[1] & 7;
}
- ix = itable_vex[RV_VEX][prefix.vex_m][prefix.vex_lp];
+ ix = itable_vex[RV_VEX][prefix.vex_m][prefix.vex_lp & 3];
}
end_prefix = true;
break;
diff --git a/insns.h b/insns.h
index 4ae2499c..4f3dd80b 100644
--- a/insns.h
+++ b/insns.h
@@ -32,7 +32,7 @@ struct disasm_index {
/* Tables for the assembler and disassembler, respectively */
extern const struct itemplate * const nasm_instructions[];
extern const struct disasm_index itable[256];
-extern const struct disasm_index * const itable_vex[2][32][8];
+extern const struct disasm_index * const itable_vex[2][32][4];
/* Common table for the byte codes */
extern const uint8_t nasm_bytecodes[];
diff --git a/insns.pl b/insns.pl
index 3313a6c2..adc1814b 100755
--- a/insns.pl
+++ b/insns.pl
@@ -52,8 +52,8 @@ $vex_classes = scalar(@vex_class);
for ($c = 0; $c < $vex_classes; $c++) {
$vexmap{$vex_class[$c]} = $c;
for ($m = 0; $m < 32; $m++) {
- for ($lp = 0; $lp < 8; $lp++) {
- push(@vexlist, sprintf("%s%02X%01X", $vex_class[$c], $m, $lp));
+ for ($p = 0; $p < 4; $p++) {
+ push(@vexlist, sprintf("%s%02X%01X", $vex_class[$c], $m, $p));
}
}
}
@@ -319,15 +319,15 @@ if ( !defined($output) || $output eq 'd' ) {
print D "};\n";
}
- printf D "\nconst struct disasm_index * const itable_vex[%d][32][8] =\n",
+ printf D "\nconst struct disasm_index * const itable_vex[%d][32][4] =\n",
$vex_classes;
print D "{\n";
for ($c = 0; $c < $vex_classes; $c++) {
print D " {\n";
for ($m = 0; $m < 32; $m++) {
print D " {\n";
- for ($lp = 0; $lp < 8; $lp++) {
- $vp = sprintf("%s%02X%01X", $vex_class[$c], $m, $lp);
+ for ($p = 0; $p < 4; $p++) {
+ $vp = sprintf("%s%02X%01X", $vex_class[$c], $m, $p);
if ($is_prefix{$vp}) {
printf D " itable_%s,\n", $vp;
} else {
@@ -628,7 +628,7 @@ sub startseq($$) {
$wlp = shift(@codes);
$c = ($m >> 6);
$m = $m & 31;
- $prefix .= sprintf('%s%02X%01X', $vex_class[$c], $m, $wlp & 7);
+ $prefix .= sprintf('%s%02X%01X', $vex_class[$c], $m, $wlp & 3);
} elsif ($c0 >= 0172 && $c0 <= 174) {
shift(@codes); # Skip is4 control byte
} else {