diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-05-20 09:46:24 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-05-20 09:46:24 -0700 |
commit | fff5a47e65c26bf8974bcd8fcc61b7b82430aa78 (patch) | |
tree | 7bc9299227c4ecd2d633a5bd57c110ee490e6059 /insns.pl | |
parent | 24860b0f0e46182cac0bf4fea13f17f15d8232b2 (diff) | |
download | nasm-fff5a47e65c26bf8974bcd8fcc61b7b82430aa78.tar.gz nasm-fff5a47e65c26bf8974bcd8fcc61b7b82430aa78.tar.bz2 nasm-fff5a47e65c26bf8974bcd8fcc61b7b82430aa78.zip |
Same some space by introducing shorthand byte codes for SSE prefixes
Properly done, all SSE instructions which has the 66/F2/F3 opcode
multiplex need two prefixes: one to control the use of OSP and one to
control the use of REP. However, it's a four-way select: np/66/F2/F3;
so introduce shorthand bytecodes for that purpose.
Diffstat (limited to 'insns.pl')
-rw-r--r-- | insns.pl | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -539,13 +539,13 @@ sub byte_code_compile($) { } elsif ($prefix_ok && $op =~ /^(66|f2|f3|np)$/) { # 66/F2/F3 prefix used as an opcode extension, or np = no prefix if ($op eq '66') { - push(@codes, 0366, 0331); + push(@codes, 0361); } elsif ($op eq 'f2') { - push(@codes, 0332, 0364); + push(@codes, 0362); } elsif ($op eq 'f3') { - push(@codes, 0333, 0364); + push(@codes, 0363); } else { - push(@codes, 0331, 0364); + push(@codes, 0360); } } elsif ($op =~ /^[0-9a-f]{2}$/) { if (defined($litix) && $litix+$codes[$litix]+1 == scalar @codes) { @@ -678,6 +678,7 @@ sub byte_code_compile($) { die "$0: $line: $op without 'i' and 's' operands\n"; } push(@codes, 0172, ($oppos{'s'} << 3)+$oppos{'i'}); + $prefix_ok = 0; } elsif ($op =~ /^(is4|imz2)\=([0-9]+)$/) { my $imm = $2; if (!defined($oppos{'s'})) { @@ -687,6 +688,7 @@ sub byte_code_compile($) { die "$0: $line: invalid imm4 value for $op: $imm\n"; } push(@codes, 0173, ($oppos{'s'} << 4) + $imm); + $prefix_ok = 0; } elsif ($op =~ /^([0-9a-f]{2})\+s$/) { if (!defined($oppos{'i'})) { die "$0: $op without 'i' operand\n"; |