X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=regcomp.pl;h=17472cc8110f1494430a4e8d35afe7dd65a416a5;hb=201e8cd610f560e48eaf6a9d3e533e99fa050d83;hp=2e84604b5f988b070e107c085e755a98988ec475;hpb=6bda09f9db748451f9bb2b0d8c798ce595a6609c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/regcomp.pl b/regcomp.pl index 2e84604..17472cc 100644 --- a/regcomp.pl +++ b/regcomp.pl @@ -48,19 +48,16 @@ while () { $ind++; $name[$ind]="$real$suffix"; $type[$ind]=$type; - $rest[$ind]="Regmatch state for $type"; + $rest[$ind]="state for $type"; } } } } } -my ($width,$rwidth,$twidth)=(0,0,0); -for (1..@name) { - $width=length($name[$_]) if $name[$_] and $width $tot - 1 ; -$ind = 0; -while (++$ind <= $tot) { + +for ($ind=1; $ind <= $lastregop ; $ind++) { my $oind = $ind - 1; printf OUT "#define\t%*s\t%d\t/* %#04x %s */\n", -$width, $name[$ind], $ind-1, $ind-1, $rest[$ind]; - print OUT "\n\t/* ------------ States ------------- */\n\n" - if $ind == $lastregop and $lastregop != $tot; +} +print OUT "\t/* ------------ States ------------- */\n"; +for ( ; $ind <= $tot ; $ind++) { + printf OUT "#define\t%*s\t(REGNODE_MAX + %d)\t/* %s */\n", + -$width, $name[$ind], $ind - $lastregop, $rest[$ind]; } print OUT <) { + if (/#define\s+(RXf_\w+)\s+(0x[A-F\d]+)/i) { + $rxfv{$1}= eval $2; + $val|=$rxfv{$1}; + } +} +my %vrxf=reverse %rxfv; +printf OUT "\t/* Bits in extflags defined: %032b */\n",$val; +for (0..31) { + my $n=$vrxf{2**$_}||"UNUSED_BIT_$_"; + $n=~s/^RXf_(PMf_)?//; + printf OUT qq(\t%-20s/* 0x%08x */\n), + qq("$n",),2**$_; +} + +print OUT <