Skip to content

Commit

Permalink
enable CFLAGS in Makefile, remove unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
yyshen committed Mar 27, 2015
1 parent 92d9d24 commit d50094f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
CFLAGS=-O2 -Wall -g -ftree-vectorize
CFLAGS=-O2 -Wall -g -static
NAME=mbw
TARFILE=${NAME}.tar.gz

mbw: mbw.c
$(CC) -c -o mbw.o mbw.c
$(CC) -o mbw mbw.o -lpthread
$(CC) $(CFLAGS) -c -o mbw.o mbw.c
$(CC) $(CFLAGS) -o mbw mbw.o -lpthread

clean:
rm -f mbw mbw.o
Expand Down
8 changes: 5 additions & 3 deletions mbw.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ void run_test(int tid);

__attribute__((noinline)) void *arch_memcpy(void *dest, const void *src, size_t n)
{
register void *ret asm ("rax") = dest;
asm volatile ("movq %rdi, %rax\n\t"
"movq %rdx, %rcx\n\t"
"shrq $3, %rcx\n\t"
Expand All @@ -88,7 +89,7 @@ __attribute__((noinline)) void *arch_memcpy(void *dest, const void *src, size_t
"movl %edx, %ecx\n\t"
"rep movsb\n\t"
);
return;
return ret;
}

#define CONFIG_MT_MAX_THREADS 4
Expand Down Expand Up @@ -342,6 +343,9 @@ void printout(double te, double mt, int type)
case TEST_MCBLOCK:
printf("Method: MCBLOCK\t");
break;
case TEST_ARCH_MEMCPY:
printf("Method: AMEMCPY\t");
break;
}
printf("Elapsed: %.5f\t", te);
printf("MiB: %.5f\t", mt);
Expand Down Expand Up @@ -380,9 +384,7 @@ void run_test(int tid)
int main(int argc, char **argv)
{
unsigned int long_size=0;
double te, te_sum; /* time elapsed */
int i;
long *a, *b; /* the two arrays to be copied from/to */
int o; /* getopt options */
unsigned long testno;

Expand Down

0 comments on commit d50094f

Please sign in to comment.