193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#!/usr/bin/env perl
293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgno strict 'refs';
493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orguse warnings;
593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orguse Getopt::Long;
641294d96d7dbf9bc215b09832a8336c5fb158f0bjohannkoenig@chromium.orgGetopt::Long::Configure("auto_help") if $Getopt::Long::VERSION > 2.32;
793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgmy %ALL_FUNCS = ();
993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgmy @ALL_ARCHS;
1093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgmy @ALL_FORWARD_DECLS;
1193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgmy @REQUIRES;
1293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
1393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgmy %opts = ();
1493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgmy %disabled = ();
1593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgmy %required = ();
1693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
1793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgmy @argv;
1893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgforeach (@ARGV) {
1993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  $disabled{$1} = 1, next if /--disable-(.*)/;
2093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  $required{$1} = 1, next if /--require-(.*)/;
2193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  push @argv, $_;
2293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
2393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
2493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org# NB: use GetOptions() instead of GetOptionsFromArray() for compatibility.
2593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org@ARGV = @argv;
2693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgGetOptions(
2793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  \%opts,
2893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  'arch=s',
2993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  'sym=s',
3093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  'config=s',
3193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org);
3293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
3393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgforeach my $opt (qw/arch config/) {
3493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  if (!defined($opts{$opt})) {
3593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    warn "--$opt is required!\n";
3693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    Getopt::Long::HelpMessage('-exit' => 1);
3793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  }
3893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
3993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
4093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgforeach my $defs_file (@ARGV) {
4193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  if (!-f $defs_file) {
4293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    warn "$defs_file: $!\n";
4393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    Getopt::Long::HelpMessage('-exit' => 1);
4493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  }
4593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
4693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
4793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgopen CONFIG_FILE, $opts{config} or
4893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  die "Error opening config file '$opts{config}': $!\n";
4993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
5093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgmy %config = ();
5193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgwhile (<CONFIG_FILE>) {
5287997d490ae52aa962a985c95b3cddf7f8832641johannkoenig@chromium.org  next if !/^(?:CONFIG_|HAVE_)/;
5393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  chomp;
5493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  my @pair = split /=/;
5593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  $config{$pair[0]} = $pair[1];
5693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
5793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgclose CONFIG_FILE;
5893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
5993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#
6093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org# Routines for the RTCD DSL to call
6193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#
6293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgsub vpx_config($) {
6393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  return (defined $config{$_[0]}) ? $config{$_[0]} : "";
6493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
6593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
6693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgsub specialize {
6793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  my $fn=$_[0];
6893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  shift;
6993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  foreach my $opt (@_) {
7093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    eval "\$${fn}_${opt}=${fn}_${opt}";
7193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  }
7293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
7393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
7493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgsub add_proto {
7593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  my $fn = splice(@_, -2, 1);
7693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  $ALL_FUNCS{$fn} = \@_;
7793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  specialize $fn, "c";
7893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
7993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
8093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgsub require {
8193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  foreach my $fn (keys %ALL_FUNCS) {
8293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    foreach my $opt (@_) {
8393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      my $ofn = eval "\$${fn}_${opt}";
8493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      next if !$ofn;
8593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
8693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      # if we already have a default, then we can disable it, as we know
8793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      # we can do better.
8893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      my $best = eval "\$${fn}_default";
8993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      if ($best) {
9093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org        my $best_ofn = eval "\$${best}";
9193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org        if ($best_ofn && "$best_ofn" ne "$ofn") {
9293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org          eval "\$${best}_link = 'false'";
9393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org        }
9493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      }
9593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      eval "\$${fn}_default=${fn}_${opt}";
9693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      eval "\$${fn}_${opt}_link='true'";
9793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    }
9893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  }
9993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
10093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
10193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgsub forward_decls {
10293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  push @ALL_FORWARD_DECLS, @_;
10393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
10493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
10593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#
10693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org# Include the user's directives
10793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#
10893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgforeach my $f (@ARGV) {
10993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  open FILE, "<", $f or die "cannot open $f: $!\n";
11093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  my $contents = join('', <FILE>);
11193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  close FILE;
11293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  eval $contents or warn "eval failed: $@\n";
11393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
11493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
11593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#
11693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org# Process the directives according to the command line
11793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#
11893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgsub process_forward_decls() {
11993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  foreach (@ALL_FORWARD_DECLS) {
12093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    $_->();
12193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  }
12293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
12393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
12493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgsub determine_indirection {
12593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  vpx_config("CONFIG_RUNTIME_CPU_DETECT") eq "yes" or &require(@ALL_ARCHS);
12693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  foreach my $fn (keys %ALL_FUNCS) {
12793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    my $n = "";
12893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    my @val = @{$ALL_FUNCS{$fn}};
12993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    my $args = pop @val;
13093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    my $rtyp = "@val";
13193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    my $dfn = eval "\$${fn}_default";
13293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    $dfn = eval "\$${dfn}";
13393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    foreach my $opt (@_) {
13493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      my $ofn = eval "\$${fn}_${opt}";
13593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      next if !$ofn;
13693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      my $link = eval "\$${fn}_${opt}_link";
13793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      next if $link && $link eq "false";
13893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      $n .= "x";
13993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    }
14093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    if ($n eq "x") {
14193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      eval "\$${fn}_indirect = 'false'";
14293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    } else {
14393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      eval "\$${fn}_indirect = 'true'";
14493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    }
14593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  }
14693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
14793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
14893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgsub declare_function_pointers {
14993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  foreach my $fn (sort keys %ALL_FUNCS) {
15093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    my @val = @{$ALL_FUNCS{$fn}};
15193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    my $args = pop @val;
15293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    my $rtyp = "@val";
15393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    my $dfn = eval "\$${fn}_default";
15493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    $dfn = eval "\$${dfn}";
15593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    foreach my $opt (@_) {
15693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      my $ofn = eval "\$${fn}_${opt}";
15793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      next if !$ofn;
15893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      print "$rtyp ${ofn}($args);\n";
15993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    }
16093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    if (eval "\$${fn}_indirect" eq "false") {
16193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      print "#define ${fn} ${dfn}\n";
16293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    } else {
16393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      print "RTCD_EXTERN $rtyp (*${fn})($args);\n";
16493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    }
16593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    print "\n";
16693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  }
16793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
16893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
16993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgsub set_function_pointers {
17093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  foreach my $fn (sort keys %ALL_FUNCS) {
17193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    my @val = @{$ALL_FUNCS{$fn}};
17293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    my $args = pop @val;
17393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    my $rtyp = "@val";
17493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    my $dfn = eval "\$${fn}_default";
17593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    $dfn = eval "\$${dfn}";
17693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    if (eval "\$${fn}_indirect" eq "true") {
17793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      print "    $fn = $dfn;\n";
17893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      foreach my $opt (@_) {
17993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org        my $ofn = eval "\$${fn}_${opt}";
18093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org        next if !$ofn;
18193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org        next if "$ofn" eq "$dfn";
18293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org        my $link = eval "\$${fn}_${opt}_link";
18393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org        next if $link && $link eq "false";
18493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org        my $cond = eval "\$have_${opt}";
18593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org        print "    if (${cond}) $fn = $ofn;\n"
18693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      }
18793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    }
18893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  }
18993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
19093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
19193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgsub filter {
19293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  my @filtered;
19393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  foreach (@_) { push @filtered, $_ unless $disabled{$_}; }
19493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  return @filtered;
19593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
19693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
19793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#
19893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org# Helper functions for generating the arch specific RTCD files
19993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#
20093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgsub common_top() {
20193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  my $include_guard = uc($opts{sym})."_H_";
20293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  print <<EOF;
20393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#ifndef ${include_guard}
20493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#define ${include_guard}
20593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
20693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#ifdef RTCD_C
20793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#define RTCD_EXTERN
20893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#else
20993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#define RTCD_EXTERN extern
21093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#endif
21193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
21287997d490ae52aa962a985c95b3cddf7f8832641johannkoenig@chromium.orgEOF
21387997d490ae52aa962a985c95b3cddf7f8832641johannkoenig@chromium.org
21487997d490ae52aa962a985c95b3cddf7f8832641johannkoenig@chromium.orgprocess_forward_decls();
21587997d490ae52aa962a985c95b3cddf7f8832641johannkoenig@chromium.orgprint <<EOF;
21687997d490ae52aa962a985c95b3cddf7f8832641johannkoenig@chromium.org
21793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#ifdef __cplusplus
21893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgextern "C" {
21993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#endif
22093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
22193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgEOF
22293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgdeclare_function_pointers("c", @ALL_ARCHS);
22393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
22493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgprint <<EOF;
22593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgvoid $opts{sym}(void);
22693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
22793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgEOF
22893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
22993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
23093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgsub common_bottom() {
23193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  print <<EOF;
23293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
23393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#ifdef __cplusplus
23493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}  // extern "C"
23593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#endif
23693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
23793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#endif
23893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgEOF
23993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
24093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
24193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgsub x86() {
24293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  determine_indirection("c", @ALL_ARCHS);
24393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
24493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  # Assign the helper variable for each enabled extension
24593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  foreach my $opt (@ALL_ARCHS) {
24693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    my $opt_uc = uc $opt;
24793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    eval "\$have_${opt}=\"flags & HAS_${opt_uc}\"";
24893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  }
24993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
25093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  common_top;
25193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  print <<EOF;
25293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#ifdef RTCD_C
25393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#include "vpx_ports/x86.h"
25493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgstatic void setup_rtcd_internal(void)
25593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org{
25693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    int flags = x86_simd_caps();
25793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
25893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    (void)flags;
25993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
26093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgEOF
26193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
26293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  set_function_pointers("c", @ALL_ARCHS);
26393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
26493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  print <<EOF;
26593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
26693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#endif
26793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgEOF
26893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  common_bottom;
26993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
27093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
27193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgsub arm() {
27293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  determine_indirection("c", @ALL_ARCHS);
27393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
27493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  # Assign the helper variable for each enabled extension
27593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  foreach my $opt (@ALL_ARCHS) {
27693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    my $opt_uc = uc $opt;
2777765c078fa920ba6c949c15f16b6cc979d8bb95bjohannkoenig@chromium.org    # Enable neon assembly based on HAVE_NEON logic instead of adding new
2787765c078fa920ba6c949c15f16b6cc979d8bb95bjohannkoenig@chromium.org    # HAVE_NEON_ASM logic
2797765c078fa920ba6c949c15f16b6cc979d8bb95bjohannkoenig@chromium.org    if ($opt eq 'neon_asm') { $opt_uc = 'NEON' }
28093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    eval "\$have_${opt}=\"flags & HAS_${opt_uc}\"";
28193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  }
28293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
28393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  common_top;
28493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  print <<EOF;
28593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#include "vpx_config.h"
28693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
28793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#ifdef RTCD_C
28893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#include "vpx_ports/arm.h"
28993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgstatic void setup_rtcd_internal(void)
29093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org{
29193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    int flags = arm_cpu_caps();
29293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
29393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    (void)flags;
29493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
29593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgEOF
29693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
29793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  set_function_pointers("c", @ALL_ARCHS);
29893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
29993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  print <<EOF;
30093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
30193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#endif
30293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgEOF
30393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  common_bottom;
30493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
30593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
30693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgsub mips() {
30793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  determine_indirection("c", @ALL_ARCHS);
30893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  common_top;
30993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
31093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  print <<EOF;
31193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#include "vpx_config.h"
31293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
31393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#ifdef RTCD_C
31493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgstatic void setup_rtcd_internal(void)
31593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org{
31693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgEOF
31793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
31893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  set_function_pointers("c", @ALL_ARCHS);
31993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
32093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  print <<EOF;
32193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#if HAVE_DSPR2
32293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#if CONFIG_VP8
32393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgvoid dsputil_static_init();
32493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgdsputil_static_init();
32593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#endif
32693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#if CONFIG_VP9
32793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgvoid vp9_dsputil_static_init();
32893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgvp9_dsputil_static_init();
32993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#endif
33093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#endif
33193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
33293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#endif
33393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgEOF
33493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  common_bottom;
33593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
33693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
33793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgsub unoptimized() {
33893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  determine_indirection "c";
33993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  common_top;
34093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  print <<EOF;
34193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#include "vpx_config.h"
34293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
34393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#ifdef RTCD_C
34493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgstatic void setup_rtcd_internal(void)
34593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org{
34693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgEOF
34793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
34893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  set_function_pointers "c";
34993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
35093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  print <<EOF;
35193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
35293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#endif
35393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgEOF
35493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  common_bottom;
35593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
35693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
35793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#
35893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org# Main Driver
35993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org#
36093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
36193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org&require("c");
36293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgif ($opts{arch} eq 'x86') {
36393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  @ALL_ARCHS = filter(qw/mmx sse sse2 sse3 ssse3 sse4_1 avx avx2/);
36493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  x86;
36593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org} elsif ($opts{arch} eq 'x86_64') {
36693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  @ALL_ARCHS = filter(qw/mmx sse sse2 sse3 ssse3 sse4_1 avx avx2/);
36793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  @REQUIRES = filter(keys %required ? keys %required : qw/mmx sse sse2/);
36893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  &require(@REQUIRES);
36993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  x86;
370ace65784417788374f0b19ce5a8abd06c9ccd007johannkoenig@chromium.org} elsif ($opts{arch} eq 'mips32' || $opts{arch} eq 'mips64') {
371ace65784417788374f0b19ce5a8abd06c9ccd007johannkoenig@chromium.org  @ALL_ARCHS = filter("$opts{arch}");
37293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  open CONFIG_FILE, $opts{config} or
37393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    die "Error opening config file '$opts{config}': $!\n";
37493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  while (<CONFIG_FILE>) {
37593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    if (/HAVE_DSPR2=yes/) {
376ace65784417788374f0b19ce5a8abd06c9ccd007johannkoenig@chromium.org      @ALL_ARCHS = filter("$opts{arch}", qw/dspr2/);
37793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org      last;
37893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org    }
37993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  }
38093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  close CONFIG_FILE;
38193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  mips;
38293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org} elsif ($opts{arch} eq 'armv5te') {
38393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  @ALL_ARCHS = filter(qw/edsp/);
38493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  arm;
38593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org} elsif ($opts{arch} eq 'armv6') {
38693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  @ALL_ARCHS = filter(qw/edsp media/);
38793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  arm;
38893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org} elsif ($opts{arch} eq 'armv7') {
3897765c078fa920ba6c949c15f16b6cc979d8bb95bjohannkoenig@chromium.org  @ALL_ARCHS = filter(qw/edsp media neon_asm neon/);
39041294d96d7dbf9bc215b09832a8336c5fb158f0bjohannkoenig@chromium.org  @REQUIRES = filter(keys %required ? keys %required : qw/media/);
39141294d96d7dbf9bc215b09832a8336c5fb158f0bjohannkoenig@chromium.org  &require(@REQUIRES);
3927765c078fa920ba6c949c15f16b6cc979d8bb95bjohannkoenig@chromium.org  arm;
39387997d490ae52aa962a985c95b3cddf7f8832641johannkoenig@chromium.org} elsif ($opts{arch} eq 'armv8' || $opts{arch} eq 'arm64' ) {
3947765c078fa920ba6c949c15f16b6cc979d8bb95bjohannkoenig@chromium.org  @ALL_ARCHS = filter(qw/neon/);
39593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  arm;
39693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org} else {
39793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  unoptimized;
39893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org}
39993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
40093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org__END__
40193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
40293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org=head1 NAME
40393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
40493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgrtcd -
40593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
40693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org=head1 SYNOPSIS
40793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
40893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgUsage: rtcd.pl [options] FILE
40993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
41093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgSee 'perldoc rtcd.pl' for more details.
41193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
41293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org=head1 DESCRIPTION
41393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
41493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgReads the Run Time CPU Detections definitions from FILE and generates a
41593a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgC header file on stdout.
41693a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
41793a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org=head1 OPTIONS
41893a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org
41993a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.orgOptions:
42093a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  --arch=ARCH       Architecture to generate defs for (required)
42193a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  --disable-EXT     Disable support for EXT extensions
42293a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  --require-EXT     Require support for EXT extensions
42393a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  --sym=SYMBOL      Unique symbol to use for RTCD initialization function
42493a74791c8e808ea76001ee07693aa2a5fdd3500johannkoenig@chromium.org  --config=FILE     File with CONFIG_FOO=yes lines to parse
425