2016-12-21 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / vperm.pl
blob80fae9daa4fc0e51b55b3e8f583d49f4017939d5
1 #!/usr/bin/perl
3 $nelt = int($ARGV[0]);
4 $leng = int($ARGV[1]);
6 print "/* This file auto-generated with ./vperm.pl $nelt $leng. */\n\n";
8 for ($i = 0; $i < $nelt; ++$i) { $perm[$i] = 0; }
9 $ncheck = 0;
11 for ($i = 0; $i < ($leng * $nelt) ** $nelt; ++$i)
13 if ($i % 128 == 0)
15 print "}\n\n" if $ncheck > 0;
16 print "void check$ncheck(void)\n{\n";
17 ++$ncheck;
20 print " TEST (";
21 for ($j = 0; $j < $nelt; ++$j)
23 print $perm[$j];
24 print ", " if $j < $nelt - 1;
26 print ")\n";
28 INCR: for ($j = 0; $j < $nelt; ++$j)
30 last INCR if ++$perm[$j] < $leng * $nelt;
31 $perm[$j] = 0;
34 print "}\n\n";
36 print "void check(void)\n{\n";
37 for ($i = 0; $i < $ncheck; ++$i)
39 print " check$i ();\n";
41 print "}\n\n";