summaryrefslogtreecommitdiff
path: root/insns.pl
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2011-07-07 17:21:24 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2011-07-07 17:21:24 -0700
commitcffe61e776f044c2ce80e7ebe2108ce09c952715 (patch)
tree9dfa2a3f96ad3e4ceb311f90187f7ed917cd165b /insns.pl
parentfc561203fde370a5ab9db2d089053de51f8a5e04 (diff)
downloadnasm-cffe61e776f044c2ce80e7ebe2108ce09c952715.tar.gz
nasm-cffe61e776f044c2ce80e7ebe2108ce09c952715.tar.bz2
nasm-cffe61e776f044c2ce80e7ebe2108ce09c952715.zip
Use a normal quad-case for valueless /is4
When we don't have an immediate for the i-field in /is4, then use a normal quad-bytecode encoding for it to save some small amount of space and re-use existing machinery. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'insns.pl')
-rwxr-xr-xinsns.pl7
1 files changed, 4 insertions, 3 deletions
diff --git a/insns.pl b/insns.pl
index 6db1c82..886c429 100755
--- a/insns.pl
+++ b/insns.pl
@@ -409,7 +409,7 @@ sub count_bytecodes(@) {
$skip = 1;
} elsif (($bc & ~013) == 0144) {
$skip = 1;
- } elsif ($bc == 0172) {
+ } elsif ($bc == 0172 || $bc == 0173) {
$skip = 1;
} elsif ($bc >= 0260 && $bc <= 0270) {
$skip = 2;
@@ -626,7 +626,7 @@ sub startseq($$) {
$c = ($m >> 6);
$m = $m & 31;
$prefix .= sprintf('%s%02X%01X', $vex_class[$c], $m, $wlp & 3);
- } elsif ($c0 >= 0172 && $c0 <= 174) {
+ } elsif ($c0 >= 0172 && $c0 <= 173) {
shift(@codes); # Skip is4 control byte
} else {
# We really need to be able to distinguish "forbidden"
@@ -890,7 +890,8 @@ sub byte_code_compile($$) {
if (defined($oppos{'i'})) {
push(@codes, 0172, ($oppos{'s'} << 3)+$oppos{'i'});
} else {
- push(@codes, 0174, $oppos{'s'});
+ push(@codes, 05) if ($oppos{'s'} & 4);
+ push(@codes, 0174+($oppos{'s'} & 3));
}
$prefix_ok = 0;
} elsif ($op =~ /^\/is4\=([0-9]+)$/) {