1 /* we need some special math function */
5 /* which are not defined on FreeBSD */
7 # define isunordered(u, v) \
9 ({ __typeof__(u) __u = (u); __typeof__(v) __v = (v); \
10 isnan(__u) || isnan(__v); }))
14 # define islessgreater(x, u) \
16 ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
17 !isunordered (__x, __y) && (__x < __y) || (__y < __x); }))
21 # define islessequal(x, y) \
23 ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
24 !isunordered(__x, __y) && __x <= __y; }))
28 # define isless(x, y) \
30 ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
31 !isunordered(__x, __y) && __x < __y; }))
35 # define isgreater(x, y) \
37 ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
38 !isunordered(__x, __y) && __x > __y; }))
42 * Attempt at using the goto label construct of GNU GCC:
43 * it turns out this does give some benefit: 5-15% speedup.
44 * Don't look at these macros, it hurts...
50 #define SWITCH(a) goto *goto_map [(a)];
51 #define BREAK SWITCH(*ip)
52 #define CASE(l) l ## _LABEL:
65 CEE_LDVIRTFTN_LABEL: \
75 CEE_ENDFILTER_LABEL: \
76 CEE_UNALIGNED__LABEL: \
77 CEE_VOLATILE__LABEL: \
87 CEE_REFANYTYPE_LABEL: \
93 #define GOTO_LABEL_VARS \
94 const static void * const goto_map [] = {\
95 #define OPDEF(a,b,c,d,e,f,g,h,i,j) \ \
97 #include "mono/cil/opcode.def" \
105 #define SWITCH(a) switch(a)
107 #define CASE(l) case l:
110 g_error ("Unimplemented opcode: %x at 0x%x\n", *ip, ip-header->code);
111 #define SUB_SWITCH case 0xFE:
112 #define GOTO_LABEL_VARS