1 /* we need some special math function */
7 /* which are not defined on FreeBSD */
9 # define isunordered(u, v) \
11 ({ __typeof__(u) __u = (u); __typeof__(v) __v = (v); \
12 isnan(__u) || isnan(__v); }))
16 # define islessgreater(x, u) \
18 ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
19 !isunordered (__x, __y) && (__x < __y) || (__y < __x); }))
23 # define islessequal(x, y) \
25 ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
26 !isunordered(__x, __y) && __x <= __y; }))
30 # define isless(x, y) \
32 ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
33 !isunordered(__x, __y) && __x < __y; }))
37 # define isgreater(x, y) \
39 ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
40 !isunordered(__x, __y) && __x > __y; }))
44 * Attempt at using the goto label construct of GNU GCC:
45 * it turns out this does give some benefit: 5-15% speedup.
46 * Don't look at these macros, it hurts...
52 #define SWITCH(a) goto *goto_map [(a)];
53 #define BREAK SWITCH(*ip)
54 #define CASE(l) l ## _LABEL:
67 CEE_LDVIRTFTN_LABEL: \
77 CEE_ENDFILTER_LABEL: \
78 CEE_UNALIGNED__LABEL: \
79 CEE_VOLATILE__LABEL: \
89 CEE_REFANYTYPE_LABEL: \
95 #define GOTO_LABEL_VARS \
96 const static void * const goto_map [] = {\
97 #define OPDEF(a,b,c,d,e,f,g,h,i,j) \ \
99 #include "mono/cil/opcode.def" \
107 #define SWITCH(a) switch(a)
109 #define CASE(l) case l:
112 g_error ("Unimplemented opcode: %x at 0x%x\n", *ip, ip-header->code);
113 #define SUB_SWITCH case 0xFE:
114 #define GOTO_LABEL_VARS