Add LTO in configure, add more benchmarks
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef BH_BENCH_H
|
||||
#define BH_BENCH_H
|
||||
|
||||
|
||||
typedef struct BH_Bench BH_Bench;
|
||||
typedef void (*BH_BenchCallback)(BH_Bench *);
|
||||
|
||||
@@ -22,4 +23,19 @@ int BH_BenchIter(BH_Bench *state);
|
||||
|
||||
int BH_BenchRun(void);
|
||||
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#define BH_BenchDoNotOptimize(arg) \
|
||||
do { \
|
||||
__asm__ __volatile__("" : : "r"(*((char volatile*) &arg)) : "memory"); \
|
||||
} while (0)
|
||||
#else
|
||||
#define BH_BenchDoNotOptimize(arg) \
|
||||
do { \
|
||||
volatile void* _ptr = (void*)&(arg); \
|
||||
(void)_ptr; \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* BH_BENCH_H */
|
||||
|
||||
Reference in New Issue
Block a user