moved firmext code into the backend dir
[libfirm] / ir / be / grgen / auxilary_t.h
1 #ifndef _EXT_GRS_AUXILARY_T_H_
2 #define _EXT_GRS_AUXILARY_T_H_
3
4
5 #include <math.h>
6 #include "common_t.h"
7
8
9
10 #ifndef ARR_SIZE
11 #define ARR_SIZE(a)     (sizeof(a)/sizeof(a[0]))
12 #endif
13
14
15 #define _ext_grs_MAX_LOG 10000
16 extern double _ext_grs_log_table[_ext_grs_MAX_LOG];
17 extern double _ext_grs_ln2;
18
19
20 void _ext_grs_log_table_init(void);
21
22 static double INLINE _log2(int x) {
23
24         if (x >= ARR_SIZE(_ext_grs_log_table))
25                 return log(x) / _ext_grs_ln2;
26
27         return _ext_grs_log_table[x];
28
29 }
30
31
32 #endif /* _EXT_GRS_AUXILARY_T_H_ */