0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-09-22 10:43:39 -04:00

preinsns.pl: don't allow KTEST to be just TEST

The semantics for KTEST are so very different from TEST that it would
be a bad idea to allow the TEST spelling.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin
2025-09-02 18:18:07 -07:00
parent 9c3d6ff000
commit c6bb32e9d1

View File

@@ -222,6 +222,7 @@ $macros{'k'} = {
} }
# Allow instruction without K # Allow instruction without K
if ($ins !~ /^\bKTEST/) {
my @on; my @on;
foreach my $oi (@ol) { foreach my $oi (@ol) {
# Remove first capital K # Remove first capital K
@@ -229,18 +230,18 @@ $macros{'k'} = {
push(@on, $xins); push(@on, $xins);
} }
push(@ol, @on); push(@ol, @on);
undef @on; }
# Allow SHIFT -> SH # Allow SHIFT -> SH
if ($ins =~ /SHIFT/) { if ($ins =~ /SHIFT/) {
my @on;
foreach my $oi (@ol) { foreach my $oi (@ol) {
# Remove first capital K # Remove first capital K
($xins = $oi) =~ s/SHIFT/SH/; ($xins = $oi) =~ s/SHIFT/SH/;
push(@on, $xins); push(@on, $xins);
} }
}
push(@ol, @on); push(@ol, @on);
undef @on; }
# All instruction patterns except the first are ND # All instruction patterns except the first are ND
for (my $i = 1; $i < scalar(@ol); $i++) { for (my $i = 1; $i < scalar(@ol); $i++) {