small c programs to bench against

This commit is contained in:
Torsten Ruger 2015-11-20 19:12:13 +02:00
parent 22117035e0
commit 9bcead4c1a
7 changed files with 40 additions and 6 deletions

1
.gitignore vendored
View File

@ -40,3 +40,4 @@ pkg
*.o *.o
log log
tmp tmp
a.out

View File

@ -16,7 +16,7 @@
typedef unsigned int uint; typedef unsigned int uint;
uint log2( uint n ) uint log2uni( uint n )
{ {
uint bit, pow, logn; uint bit, pow, logn;
@ -92,8 +92,8 @@ void divideby2( uint type, uint n, uint lsb, uint msb )
uint logmsb; uint logmsb;
uint usinga4; uint usinga4;
loglsb = log2( lsb ); loglsb = log2uni( lsb );
logmsb = log2( msb ); logmsb = log2uni( msb );
printf( "; %s [%s]\n\n", BANNER, DATE ); printf( "; %s [%s]\n\n", BANNER, DATE );
printf( "\tAREA |div%d$code|, CODE, READONLY\n\n", n ); printf( "\tAREA |div%d$code|, CODE, READONLY\n\n", n );

View File

@ -19,7 +19,7 @@ int main(void)
{ {
int counter = 1000000; int counter = 1000000;
int counter2 = counter; int counter2 = counter;
int level = 76; int level = 40;
int fib ; int fib ;
while(counter--) { while(counter--) {
fib = fibo(level); fib = fibo(level);

9
test/bench/hello.c Normal file
View File

@ -0,0 +1,9 @@
#include<stdio.h>
int main(void)
{
int counter = 1000000;
while(counter--) {
printf("Hello there\n");
}
}

9
test/bench/hello0.c Normal file
View File

@ -0,0 +1,9 @@
#include<stdio.h>
int main(void)
{
int counter = 1000000;
while(counter--) {
printf("Hello there\n");
}
}

6
test/bench/null.c Normal file
View File

@ -0,0 +1,6 @@
#include<stdio.h>
int main(void)
{
return 1;
}

9
test/bench/puti.c Normal file
View File

@ -0,0 +1,9 @@
#include<stdio.h>
int main(void)
{
int counter = 1000000;
while(counter--) {
printf("%i\n" , counter);
}
}