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; }))
47 /* isunordered seems to crash on HPUX when built 64 bits
48 so use generic implementation.
50 #if defined(__hpux) && SIZEOF_VOID_P == 8
59 # define isunordered(u, v) (isnan(u) || isnan(v))
63 # define islessgreater(x, u) (!isunordered (x, y) && (x < y) || (y < x))
67 # define islessequal(x, y) (!isunordered(x, y) && x <= y)
71 # define isless(x, y) (!isunordered(x, y) && x < y)
75 # define isgreater(x, y) (!isunordered(x, y) && x > y)
81 * Attempt at using the goto label construct of GNU GCC:
82 * it turns out this does give some benefit: 5-15% speedup.
83 * Don't look at these macros, it hurts...
89 #define SWITCH(a) goto *goto_map [(a)];
90 #define BREAK SWITCH(*ip)
91 #define CASE(l) l ## _LABEL:
104 CEE_LDVIRTFTN_LABEL: \
105 CEE_UNUSED56_LABEL: \
112 CEE_LOCALLOC_LABEL: \
113 CEE_UNUSED57_LABEL: \
114 CEE_ENDFILTER_LABEL: \
115 CEE_UNALIGNED__LABEL: \
116 CEE_VOLATILE__LABEL: \
119 CEE_UNUSED68_LABEL: \
122 CEE_UNUSED69_LABEL: \
126 CEE_REFANYTYPE_LABEL: \
127 CEE_UNUSED52_LABEL: \
128 CEE_UNUSED53_LABEL: \
129 CEE_UNUSED54_LABEL: \
130 CEE_UNUSED55_LABEL: \
132 #define GOTO_LABEL_VARS \
133 const static void * const goto_map [] = {\
134 #define OPDEF(a,b,c,d,e,f,g,h,i,j) \ \
136 #include "mono/cil/opcode.def" \
144 #define SWITCH(a) switch(a)
146 #define CASE(l) case l:
149 g_error ("Unimplemented opcode: %x at 0x%x\n", *ip, ip-header->code);
150 #define SUB_SWITCH case 0xFE:
151 #define GOTO_LABEL_VARS