5 /* we need some special math function */
11 /* which are not defined on FreeBSD */
15 # define isunordered(u, v) \
17 ({ __typeof__(u) __u = (u); __typeof__(v) __v = (v); \
18 isnan(__u) || isnan(__v); }))
22 # define islessgreater(x, u) \
24 ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
25 !isunordered (__x, __y) && (__x < __y) || (__y < __x); }))
29 # define islessequal(x, y) \
31 ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
32 !isunordered(__x, __y) && __x <= __y; }))
36 # define isless(x, y) \
38 ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
39 !isunordered(__x, __y) && __x < __y; }))
43 # define isgreater(x, y) \
45 ({ __typeof__(x) __x = (x); __typeof__(y) __y = (y); \
46 !isunordered(__x, __y) && __x > __y; }))
51 /* isunordered seems to crash on HPUX when built 64 bits
52 so use generic implementation.
54 #if defined(__hpux) && SIZEOF_VOID_P == 8
63 # define isunordered(u, v) (isnan(u) || isnan(v))
67 # define islessgreater(x, u) (!isunordered (x, y) && (x < y) || (y < x))
71 # define islessequal(x, y) (!isunordered(x, y) && x <= y)
75 # define isless(x, y) (!isunordered(x, y) && x < y)
79 # define isgreater(x, y) (!isunordered(x, y) && x > y)
85 * Attempt at using the goto label construct of GNU GCC:
86 * it turns out this does give some benefit: 5-15% speedup.
87 * Don't look at these macros, it hurts...
93 #define SWITCH(a) goto *goto_map [(a)];
94 #define BREAK SWITCH(*ip)
95 #define CASE(l) l ## _LABEL:
108 CEE_LDVIRTFTN_LABEL: \
109 CEE_UNUSED56_LABEL: \
116 CEE_LOCALLOC_LABEL: \
117 CEE_UNUSED57_LABEL: \
118 CEE_ENDFILTER_LABEL: \
119 CEE_UNALIGNED__LABEL: \
120 CEE_VOLATILE__LABEL: \
123 CEE_UNUSED68_LABEL: \
126 CEE_UNUSED69_LABEL: \
130 CEE_REFANYTYPE_LABEL: \
131 CEE_UNUSED52_LABEL: \
132 CEE_UNUSED53_LABEL: \
133 CEE_UNUSED54_LABEL: \
134 CEE_UNUSED55_LABEL: \
136 #define GOTO_LABEL_VARS \
137 const static void * const goto_map [] = {\
138 #define OPDEF(a,b,c,d,e,f,g,h,i,j) \ \
140 #include "mono/cil/opcode.def" \
148 #define SWITCH(a) switch(a)
150 #define CASE(l) case l:
153 g_error ("Unimplemented opcode: %x at 0x%x\n", *ip, ip-header->code);
154 #define SUB_SWITCH case 0xFE:
155 #define GOTO_LABEL_VARS