#!/bin/bash


mkdir -p graphs results
#byte_loop libcall loop rep_4byte rep_8byte rep_byte unrolled_loop vector_loop

#echo "byte_loop"
gcc -g -Wall  -march=native -lm -mstringop-strategy=byte_loop rdtsc-loops.c -o rdtsc-loops
./rdtsc-loops results/r1.txt
#echo "loop"
gcc -g -Wall  -march=native -lm -mstringop-strategy=loop rdtsc-loops.c -o rdtsc-loops
./rdtsc-loops results/r2.txt
#echo "unrolled_loop"
gcc -g -Wall  -march=native -lm -mstringop-strategy=unrolled_loop rdtsc-loops.c -o rdtsc-loops
./rdtsc-loops results/r3.txt
#echo "rep_byte"
gcc -g -Wall  -march=native -lm -mstringop-strategy=rep_byte rdtsc-loops.c -o rdtsc-loops
./rdtsc-loops results/r4.txt
#echo "rep_4byte"
gcc -g -Wall  -march=native -lm -mstringop-strategy=rep_4byte rdtsc-loops.c -o rdtsc-loops
./rdtsc-loops results/r5.txt
#echo "rep_8byte"
gcc -g -Wall  -march=native -lm -mstringop-strategy=rep_8byte rdtsc-loops.c -o rdtsc-loops
./rdtsc-loops results/r6.txt
#echo "vector_loop"
gcc -g -Wall  -march=native -lm -mstringop-strategy=vector_loop rdtsc-loops.c -o rdtsc-loops
./rdtsc-loops results/r7.txt
#echo "libcall"
gcc -g -Wall  -march=native -lm -mstringop-strategy=libcall rdtsc-loops.c -o rdtsc-loops
./rdtsc-loops results/r8.txt

gcc -g -Wall -lgd -lm graph.c -o graph
./graph

mv results results-memcpy64
mv graphs graphs-memcpy64

