parent
b8549331bb
commit
03f70a904b
@ -0,0 +1,38 @@
|
||||
BASE=awsm
|
||||
SFCC=silverfish
|
||||
CC=clang
|
||||
WASMCC=wasm32-unknown-unknown-wasm-clang
|
||||
|
||||
OPTFLAGS=-O3 -flto
|
||||
# same stack-size for all
|
||||
WASMLINKFLAGS=-Wl,-z,stack-size=524288,--allow-undefined,--no-threads,--stack-first,--no-entry,--export-all,--export=main,--export=dummy
|
||||
WASMCFLAGS=${WASMLINKFLAGS} -nostartfiles
|
||||
|
||||
MEMC_64=64bit_nix.c
|
||||
MEMC_NO=no_protection.c
|
||||
MEMC_GEN=generic.c
|
||||
MEMC_MPX=mpx.c
|
||||
MEMC_SEG=segmented.c
|
||||
|
||||
# for silverfish
|
||||
RT_DIR=${BASE_DIR}/runtime/
|
||||
RT_MEM=${RT_DIR}/memory/
|
||||
RT_LIBC=${RT_DIR}/libc/libc_backing.c
|
||||
RT_RT=${RT_DIR}/runtime.c
|
||||
|
||||
MEMC=${RT_MEM}/${MEMC_64}
|
||||
DUMMY=${BASE_DIR}/code_benches/dummy.c
|
||||
|
||||
# for awsm
|
||||
ABASE_DIR=${BASE_DIR}/../
|
||||
ART_DIR=${ABASE_DIR}/runtime/
|
||||
ART_INC=${ART_DIR}/include/
|
||||
|
||||
USE_MEM=USE_MEM_VM
|
||||
ifeq ($(USE_MEM),USE_MEM_VM)
|
||||
AMEMC=${ART_DIR}/compiletime/memory/${MEMC_64}
|
||||
endif
|
||||
WASMISA=${ART_DIR}/compiletime/instr.c
|
||||
|
||||
ABIN_DIR=${ART_DIR}/bin/
|
||||
TMP_DIR=tmp/
|
@ -0,0 +1,44 @@
|
||||
#ifndef GET_TIME_H
|
||||
#define GET_TIME_H
|
||||
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#ifndef WASM
|
||||
#ifndef CPU_FREQ
|
||||
#define CPU_FREQ 1000
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static unsigned long long
|
||||
get_time()
|
||||
{
|
||||
#if 0
|
||||
unsigned long long int ret = 0;
|
||||
unsigned int cycles_lo;
|
||||
unsigned int cycles_hi;
|
||||
__asm__ volatile ("RDTSC" : "=a" (cycles_lo), "=d" (cycles_hi));
|
||||
ret = (unsigned long long int)cycles_hi << 32 | cycles_lo;
|
||||
|
||||
return ret;
|
||||
#else
|
||||
struct timeval Tp;
|
||||
int stat;
|
||||
stat = gettimeofday (&Tp, NULL);
|
||||
if (stat != 0)
|
||||
printf ("Error return from gettimeofday: %d", stat);
|
||||
return (Tp.tv_sec * 1000000 + Tp.tv_usec);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void
|
||||
print_time(unsigned long long s, unsigned long long e)
|
||||
{
|
||||
#if 0
|
||||
printf("%llu cycs, %llu us\n", e - s, (e - s) / CPU_FREQ);
|
||||
#else
|
||||
printf("%llu us\n", e - s);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* GET_TIME_H */
|
Loading…
Reference in new issue