Skip to content

Commit a3fd34a

Browse files
author
H. Peter Anvin
committed
x86/insns.pl: sort conditional instructions alphabetically
Makes the build a bit more predictable and debuggable. Signed-off-by: H. Peter Anvin <[email protected]>
1 parent a2eabbe commit a3fd34a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

x86/insns.pl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,16 @@ (@)
131131
'nbe' => 7, 'ne' => 5, 'nge' => 12, 'nle' => 15,
132132
'np' => 11, 'p' => 10 );
133133
134+
my @conds = sort keys(%conds);
135+
134136
# Generate conditional form patterns if applicable
135137
sub conditional_forms(@) {
136138
my @field_list = ();
137139
138140
foreach my $fields (@_) {
139141
# This is a case sensitive match!
140142
if ($fields->[0] !~ /cc/) {
143+
# Not a conditional instruction pattern
141144
push(@field_list, $fields);
142145
next;
143146
}
@@ -147,7 +150,7 @@ (@)
147150
next;
148151
}
149152
150-
foreach my $cc (keys(%conds)) {
153+
foreach my $cc (@conds) {
151154
my @ff = @$fields;
152155
153156
$ff[0] =~ s/cc/\U$cc/;
@@ -156,8 +159,8 @@ (@)
156159
warn "$fname:$line: invalid conditional encoding";
157160
next;
158161
}
159-
160162
$ff[2] = $1.sprintf('%02x', hex($2)^$conds{$cc}).$3;
163+
161164
unless (defined($condd{$cc}) || $ff[3] =~ /\bND\b/) {
162165
$ff[3] .= ',ND';
163166
}

0 commit comments

Comments
 (0)