Add LTO in configure, add more benchmarks

This commit is contained in:
2025-10-12 23:16:00 +03:00
parent 54563daf13
commit 577c3091e6
14 changed files with 1222 additions and 141 deletions

View File

@@ -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 */