7 #define INLINE __inline
9 #elif defined(__WATCOMC__)
10 #define INLINE __inline
16 /* fast conversion of double -> 32bit int
18 * - http://chrishecker.com/images/f/fb/Gdmfp.pdf
19 * - http://stereopsis.com/FPU.html#convert
21 static INLINE int32_t cround64(double val)
23 val += 6755399441055744.0;
24 return *(int32_t*)&val;
27 uint32_t perf_start_count, perf_interval_count;
30 void perf_start(void);
31 #pragma aux perf_start = \
33 "mov [perf_start_count], eax" \
37 #pragma aux perf_end = \
39 "sub eax, [perf_start_count]" \
40 "mov [perf_interval_count], eax" \
45 #define perf_start() asm volatile ( \
48 : "=m"(perf_start_count) :: "%eax", "%edx")
50 #define perf_end() asm volatile ( \
54 : "=m"(perf_interval_count) \
55 : "m"(perf_start_count) \
60 #define perf_start() \
64 mov [perf_start_count], eax \
72 sub eax, [perf_start_count] \
73 mov [perf_interval_count], eax \