1 /* we need some special math function */
7 /* which are not defined on FreeBSD */
11 # define isunordered(u, v) \
13 ({ __typeof__(u) __u = (u); __typeof__(v) __v = (v); \
14 isnan(__u) || isnan(__v); }))
18 # define islessgreater(x, u) \
20 ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
21 !isunordered (__x, __y) && (__x < __y) || (__y < __x); }))
25 # define islessequal(x, y) \
27 ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
28 !isunordered(__x, __y) && __x <= __y; }))
32 # define isless(x, y) \
34 ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
35 !isunordered(__x, __y) && __x < __y; }))
39 # define isgreater(x, y) \
41 ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
42 !isunordered(__x, __y) && __x > __y; }))
48 # define isunordered(u, v) (isnan(u) || isnan(v))
52 # define islessgreater(x, u) (!isunordered (x, y) && (x < y) || (y < x))
56 # define islessequal(x, y) (!isunordered(x, y) && x <= y)
60 # define isless(x, y) (!isunordered(x, y) && x < y)
64 # define isgreater(x, y) (!isunordered(x, y) && x > y)
70 * Attempt at using the goto label construct of GNU GCC:
71 * it turns out this does give some benefit: 5-15% speedup.
72 * Don't look at these macros, it hurts...
78 #define SWITCH(a) goto *goto_map [(a)];
79 #define BREAK SWITCH(*ip)
80 #define CASE(l) l ## _LABEL:
93 CEE_LDVIRTFTN_LABEL: \
101 CEE_LOCALLOC_LABEL: \
102 CEE_UNUSED57_LABEL: \
103 CEE_ENDFILTER_LABEL: \
104 CEE_UNALIGNED__LABEL: \
105 CEE_VOLATILE__LABEL: \
108 CEE_UNUSED68_LABEL: \
111 CEE_UNUSED69_LABEL: \
115 CEE_REFANYTYPE_LABEL: \
116 CEE_UNUSED52_LABEL: \
117 CEE_UNUSED53_LABEL: \
118 CEE_UNUSED54_LABEL: \
119 CEE_UNUSED55_LABEL: \
121 #define GOTO_LABEL_VARS \
122 const static void * const goto_map [] = {\
123 #define OPDEF(a,b,c,d,e,f,g,h,i,j) \ \
125 #include "mono/cil/opcode.def" \
133 #define SWITCH(a) switch(a)
135 #define CASE(l) case l:
138 g_error ("Unimplemented opcode: %x at 0x%x\n", *ip, ip-header->code);
139 #define SUB_SWITCH case 0xFE:
140 #define GOTO_LABEL_VARS