gentex: added parameter for aliases to instruction
authorMartin Perner <martin@perner.cc>
Wed, 27 Oct 2010 19:17:27 +0000 (21:17 +0200)
committerMartin Perner <martin@perner.cc>
Wed, 27 Oct 2010 19:17:27 +0000 (21:17 +0200)
2_isa/gentex.pl

index 373d576f0ff7aa64d1ab57352956a9d0bef831a2..bee4292f355ed91e0a58702924b999888fc58aba 100755 (executable)
@@ -157,6 +157,21 @@ sub ins {
                $tabular .= "\\paragraph{Example:}~\\\\ \n \\begin{lstlisting} \n ".$_[7]. " \\end{lstlisting}\n";
        }
 
+       if($_[8]) {
+               $tabular .= "\\paragraph{Aliases to this Instruction:}~\\\\\ \n";
+               my @aliases = split(/\|/, $_[8]);
+
+               $tabular .= "\\begin{table}[!h] \n \\centering \n \\begin{tabular}{|c|c|} \\hline \n";
+               $tabular .= "Alias & ".$_[1]." equivalent \\\\ \\hline \n";
+               foreach my $alias (@aliases) {
+                       my $equv;
+                       my $from;
+                       ($from, $equv) = split(/-/, $alias);
+                       $tabular .= $from . " & ".$equv." \\\\ \\hline \n";
+               }
+               $tabular .= "\\end{tabular} \n \\caption{Aliases to the instruction ".$_[1]."} \n \\end{table}";
+       }
+
        print $tabular;
 }