platforms: enable emscripten
[pcsx_rearmed.git] / include / lightning / lightning.h
1 /*
2  * Copyright (C) 2012-2023  Free Software Foundation, Inc.
3  *
4  * This file is part of GNU lightning.
5  *
6  * GNU lightning is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU Lesser General Public License as published
8  * by the Free Software Foundation; either version 3, or (at your option)
9  * any later version.
10  *
11  * GNU lightning is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14  * License for more details.
15  *
16  * Authors:
17  *      Paulo Cesar Pereira de Andrade
18  */
19
20 #ifndef _lightning_h
21 #define _lightning_h
22
23 #include <unistd.h>
24 #include <stdlib.h>
25 #include <stdint.h>
26 #include <string.h>
27 #include <pthread.h>
28
29 #if defined(__hpux) && defined(__hppa__)
30 #  include <machine/param.h>
31 #endif
32 #if defined(__alpha__) && defined(__osf__)
33 #  include <machine/endian.h>
34 #endif
35
36 #ifndef __WORDSIZE
37 #  if defined(WORDSIZE)                         /* ppc darwin */
38 #    define __WORDSIZE          WORDSIZE
39 #  elif defined(__SIZEOF_POINTER__)             /* ppc aix */
40 #    define __WORDSIZE          (__SIZEOF_POINTER__ << 3)
41 #  elif defined(_ILP32)                         /* hppa hp-ux */
42 #    define __WORDSIZE          32
43 #  elif defined(_LP64)                          /* ia64 hp-ux (with cc +DD64) */
44 #    define __WORDSIZE          64
45 #  elif defined(_MIPS_SZPTR)                    /* mips irix */
46 #    if _MIPS_SZPTR == 32
47 #      define __WORDSIZE        32
48 #    else
49 #      define __WORDSIZE        64
50 #    endif
51 #  else                                         /* From FreeBSD 9.1 stdint.h */
52 #    if defined(UINTPTR_MAX) && defined(UINT64_MAX) && \
53         (UINTPTR_MAX == UINT64_MAX)
54 #      define __WORDSIZE        64
55 #    else
56 #      define __WORDSIZE        32
57 #    endif
58 #  endif
59 #endif
60 #ifndef __LITTLE_ENDIAN
61 #  if defined(LITTLE_ENDIAN)                    /* ppc darwin */
62 #    define __LITTLE_ENDIAN     LITTLE_ENDIAN
63 #  elif defined(__ORDER_LITTLE_ENDIAN__)        /* ppc aix */
64 #    define __LITTLE_ENDIAN     __ORDER_LITTLE_ENDIAN__
65 #  else
66 #    define __LITTLE_ENDIAN     1234
67 #  endif
68 #endif
69 #ifndef __BIG_ENDIAN
70 #  if defined(BIG_ENDIAN)                       /* ppc darwin */
71 #    define __BIG_ENDIAN        BIG_ENDIAN
72 #  elif defined(__ORDER_BIG_ENDIAN__)           /* ppc aix */
73 #    define __BIG_ENDIAN        __ORDER_BIG_ENDIAN__
74 #  else
75 #    define __BIG_ENDIAN        4321
76 #  endif
77 #endif
78 #ifndef __BYTE_ORDER
79 #  if defined(BYTE_ORDER)                       /* ppc darwin */
80 #    define __BYTE_ORDER        BYTE_ORDER
81 #  elif defined(__BYTE_ORDER__)                 /* ppc aix */
82 #    define __BYTE_ORDER        __BYTE_ORDER__
83 #  elif defined(_BIG_ENDIAN)                    /* hppa hp-ux */
84 #    define __BYTE_ORDER        __BIG_ENDIAN
85 #  elif defined(__BIG_ENDIAN__)                 /* ia64 hp-ux */
86 #    define __BYTE_ORDER        __BIG_ENDIAN
87 #  elif defined(__i386__)                       /* 32 bit x86 solaris */
88 #    define __BYTE_ORDER        __LITTLE_ENDIAN
89 #  elif defined(__x86_64__)                     /* 64 bit x86 solaris */
90 #    define __BYTE_ORDER        __LITTLE_ENDIAN
91 #  elif defined(__MIPSEB)                       /* mips irix */
92 #    define __BYTE_ORDER        __BIG_ENDIAN
93 #  else
94 #    error cannot figure __BYTE_ORDER
95 #  endif
96 #endif
97
98 typedef signed char             jit_int8_t;
99 typedef unsigned char           jit_uint8_t;
100 typedef signed short            jit_int16_t;
101 typedef unsigned short          jit_uint16_t;
102 typedef signed int              jit_int32_t;
103 typedef unsigned int            jit_uint32_t;
104 #if __WORDSIZE == 32
105 typedef signed long long        jit_int64_t;
106 typedef unsigned long long      jit_uint64_t;
107 typedef jit_int32_t             jit_word_t;
108 typedef jit_uint32_t            jit_uword_t;
109 #elif (_WIN32 && !__CYGWIN__)
110 typedef signed long long        jit_int64_t;
111 typedef unsigned long long      jit_uint64_t;
112 typedef jit_int64_t             jit_word_t;
113 typedef jit_uint64_t            jit_uword_t;
114 #else
115 typedef signed long             jit_int64_t;
116 typedef unsigned long           jit_uint64_t;
117 typedef jit_int64_t             jit_word_t;
118 typedef jit_uint64_t            jit_uword_t;
119 #endif
120 typedef float                   jit_float32_t;
121 typedef double                  jit_float64_t;
122 typedef void*                   jit_pointer_t;
123 typedef jit_int32_t             jit_bool_t;
124 typedef jit_int32_t             jit_gpr_t;
125 typedef jit_int32_t             jit_fpr_t;
126
127 #if !defined(__powerpc__) && \
128         (defined(__POWERPC__) || defined(__ppc__) || defined(__PPC__))
129 #define __powerpc__ 1
130 #endif
131
132 #if defined(__i386__) || defined(__x86_64__)
133 #  include <lightning/jit_x86.h>
134 #elif defined(__mips__)
135 #  include <lightning/jit_mips.h>
136 #elif defined(__arm__)
137 #  include <lightning/jit_arm.h>
138 #elif defined(__powerpc__)
139 #  include <lightning/jit_ppc.h>
140 #elif defined(__sparc__)
141 #  include <lightning/jit_sparc.h>
142 #elif defined(__ia64__)
143 #  include <lightning/jit_ia64.h>
144 #elif defined(__hppa__)
145 #  include <lightning/jit_hppa.h>
146 #elif defined(__aarch64__)
147 #  include <lightning/jit_aarch64.h>
148 #elif defined(__s390__) || defined(__s390x__)
149 #  include <lightning/jit_s390.h>
150 #elif defined(__alpha__)
151 #  include <lightning/jit_alpha.h>
152 #elif defined(__riscv)
153 #  include <lightning/jit_riscv.h>
154 #elif defined(__loongarch__)
155 #  include <lightning/jit_loongarch.h>
156 #endif
157
158 #define jit_flag_node           0x0001  /* patch node not absolute */
159 #define jit_flag_patch          0x0002  /* jump already patched */
160 #define jit_flag_data           0x0004  /* data in the constant pool */
161 #define jit_flag_use            0x0008  /* do not remove marker label */
162 #define jit_flag_synth          0x0010  /* synthesized instruction */
163 #define jit_flag_head           0x1000  /* label reached by normal flow */
164 #define jit_flag_varargs        0x2000  /* call{r,i} to varargs function */
165
166 #define JIT_R(index)            jit_r(index)
167 #define JIT_V(index)            jit_v(index)
168 #define JIT_F(index)            jit_f(index)
169 #define JIT_R_NUM               jit_r_num()
170 #define JIT_V_NUM               jit_v_num()
171 #define JIT_F_NUM               jit_f_num()
172
173 #define JIT_DISABLE_DATA        1       /* force synthesize of constants */
174 #define JIT_DISABLE_NOTE        2       /* disable debug info generation */
175
176 #define jit_class_chk           0x02000000      /* just checking */
177 #define jit_class_arg           0x08000000      /* argument register */
178 #define jit_class_sav           0x10000000      /* callee save */
179 #define jit_class_gpr           0x20000000      /* general purpose */
180 #define jit_class_fpr           0x40000000      /* float */
181 #define jit_class(reg)          ((reg) & 0xffff0000)
182 #define jit_regno(reg)          ((reg) & 0x00007fff)
183
184 typedef struct jit_node         jit_node_t;
185 typedef struct jit_state        jit_state_t;
186
187 typedef enum {
188     jit_code_data,
189 #define jit_live(u)             jit_new_node_w(jit_code_live, u)
190 #define jit_align(u)            jit_new_node_w(jit_code_align, u)
191     jit_code_live,              jit_code_align,
192     jit_code_save,              jit_code_load,
193 #define jit_skip(u)             jit_new_node_w(jit_code_skip, u)
194     jit_code_skip,
195 #define jit_name(u)             _jit_name(_jit,u)
196     jit_code_name,
197 #define jit_note(u, v)          _jit_note(_jit, u, v)
198 #define jit_label()             _jit_label(_jit)
199 #define jit_forward()           _jit_forward(_jit)
200 #define jit_indirect()          _jit_indirect(_jit)
201 #define jit_link(u)             _jit_link(_jit,u)
202     jit_code_note,              jit_code_label,
203
204 #define jit_prolog()            _jit_prolog(_jit)
205     jit_code_prolog,
206
207 #define jit_ellipsis()          _jit_ellipsis(_jit)
208     jit_code_ellipsis,
209 #define jit_va_push(u)          _jit_va_push(_jit,u)
210     jit_code_va_push,
211 #define jit_allocai(u)          _jit_allocai(_jit,u)
212 #define jit_allocar(u, v)       _jit_allocar(_jit,u,v)
213     jit_code_allocai,           jit_code_allocar,
214
215 #define jit_arg_c()             _jit_arg(_jit, jit_code_arg_c)
216 #define jit_arg_s()             _jit_arg(_jit, jit_code_arg_s)
217 #define jit_arg_i()             _jit_arg(_jit, jit_code_arg_i)
218 # if __WORDSIZE == 32
219 #  define jit_arg()             jit_arg_i()
220 #else
221 #  define jit_arg_l()           _jit_arg(_jit, jit_code_arg_l)
222 #  define jit_arg()             jit_arg_l()
223 #endif
224     jit_code_arg_c,             jit_code_arg_s,
225     jit_code_arg_i,             jit_code_arg_l,
226 #if __WORDSIZE == 32
227 #  define jit_code_arg          jit_code_arg_i
228 #else
229 #  define jit_code_arg          jit_code_arg_l
230 #endif
231
232 #define jit_getarg_c(u,v)       _jit_getarg_c(_jit,u,v)
233 #define jit_getarg_uc(u,v)      _jit_getarg_uc(_jit,u,v)
234 #define jit_getarg_s(u,v)       _jit_getarg_s(_jit,u,v)
235 #define jit_getarg_us(u,v)      _jit_getarg_us(_jit,u,v)
236 #define jit_getarg_i(u,v)       _jit_getarg_i(_jit,u,v)
237 #if __WORDSIZE == 32
238 #  define jit_getarg(u,v)       jit_getarg_i(u,v)
239 #else
240 #  define jit_getarg_ui(u,v)    _jit_getarg_ui(_jit,u,v)
241 #  define jit_getarg_l(u,v)     _jit_getarg_l(_jit,u,v)
242 #  define jit_getarg(u,v)       jit_getarg_l(u,v)
243 #endif
244     jit_code_getarg_c,          jit_code_getarg_uc,
245     jit_code_getarg_s,          jit_code_getarg_us,
246     jit_code_getarg_i,          jit_code_getarg_ui,
247     jit_code_getarg_l,
248 #if __WORDSIZE == 32
249 #  define jit_code_getarg       jit_code_getarg_i
250 #else
251 #  define jit_code_getarg       jit_code_getarg_l
252 #endif
253
254 #define jit_putargr_c(u,v)      _jit_putargr(_jit,u,v,jit_code_putargr_c)
255 #define jit_putargi_c(u,v)      _jit_putargi(_jit,u,v,jit_code_putargi_c)
256 #define jit_putargr_uc(u,v)     _jit_putargr(_jit,u,v,jit_code_putargr_uc)
257 #define jit_putargi_uc(u,v)     _jit_putargi(_jit,u,v,jit_code_putargi_uc)
258 #define jit_putargr_s(u,v)      _jit_putargr(_jit,u,v,jit_code_putargr_s)
259 #define jit_putargi_s(u,v)      _jit_putargi(_jit,u,v,jit_code_putargi_s)
260 #define jit_putargr_us(u,v)     _jit_putargr(_jit,u,v,jit_code_putargr_us)
261 #define jit_putargi_us(u,v)     _jit_putargi(_jit,u,v,jit_code_putargi_us)
262 #define jit_putargr_i(u,v)      _jit_putargr(_jit,u,v,jit_code_putargr_i)
263 #define jit_putargi_i(u,v)      _jit_putargi(_jit,u,v,jit_code_putargi_i)
264 #if __WORDSIZE == 32
265 #  define jit_putargr(u,v)      jit_putargr_i(u,v)
266 #  define jit_putargi(u,v)      jit_putargi_i(u,v)
267 #else
268 #  define jit_putargr_ui(u,v)   _jit_putargr(_jit,u,v,jit_code_putargr_ui)
269 #  define jit_putargi_ui(u,v)   _jit_putargi(_jit,u,v,jit_code_putargi_ui)
270 #  define jit_putargr_l(u,v)    _jit_putargr(_jit,u,v,jit_code_putargr_l)
271 #  define jit_putargi_l(u,v)    _jit_putargi(_jit,u,v,jit_code_putargi_l)
272 #  define jit_putargr(u,v)      jit_putargr_l(u,v)
273 #  define jit_putargi(u,v)      jit_putargi_l(u,v)
274 #endif
275     jit_code_putargr_c,         jit_code_putargi_c,
276     jit_code_putargr_uc,        jit_code_putargi_uc,
277     jit_code_putargr_s,         jit_code_putargi_s,
278     jit_code_putargr_us,        jit_code_putargi_us,
279     jit_code_putargr_i,         jit_code_putargi_i,
280     jit_code_putargr_ui,        jit_code_putargi_ui,
281     jit_code_putargr_l,         jit_code_putargi_l,
282 #if __WORDSIZE == 32
283 #  define jit_code_putargr      jit_code_putargr_i
284 #  define jit_code_putargi      jit_code_putargi_i
285 #else
286 #  define jit_code_putargr      jit_code_putargr_l
287 #  define jit_code_putargi      jit_code_putargi_l
288 #endif
289
290 #define jit_va_start(u)         jit_new_node_w(jit_code_va_start, u)
291     jit_code_va_start,
292 #define jit_va_arg(u, v)        jit_new_node_ww(jit_code_va_arg, u, v)
293 #define jit_va_arg_d(u, v)      jit_new_node_ww(jit_code_va_arg_d, u, v)
294     jit_code_va_arg,            jit_code_va_arg_d,
295 #define jit_va_end(u)           jit_new_node_w(jit_code_va_end, u)
296     jit_code_va_end,
297
298 #define jit_addr(u,v,w)         jit_new_node_www(jit_code_addr,u,v,w)
299 #define jit_addi(u,v,w)         jit_new_node_www(jit_code_addi,u,v,w)
300     jit_code_addr,              jit_code_addi,
301 #define jit_addcr(u,v,w)        jit_new_node_www(jit_code_addcr,u,v,w)
302 #define jit_addci(u,v,w)        jit_new_node_www(jit_code_addci,u,v,w)
303     jit_code_addcr,             jit_code_addci,
304 #define jit_addxr(u,v,w)        jit_new_node_www(jit_code_addxr,u,v,w)
305 #define jit_addxi(u,v,w)        jit_new_node_www(jit_code_addxi,u,v,w)
306     jit_code_addxr,             jit_code_addxi,
307 #define jit_subr(u,v,w)         jit_new_node_www(jit_code_subr,u,v,w)
308 #define jit_subi(u,v,w)         jit_new_node_www(jit_code_subi,u,v,w)
309     jit_code_subr,              jit_code_subi,
310 #define jit_subcr(u,v,w)        jit_new_node_www(jit_code_subcr,u,v,w)
311 #define jit_subci(u,v,w)        jit_new_node_www(jit_code_subci,u,v,w)
312     jit_code_subcr,             jit_code_subci,
313 #define jit_subxr(u,v,w)        jit_new_node_www(jit_code_subxr,u,v,w)
314 #define jit_subxi(u,v,w)        jit_new_node_www(jit_code_subxi,u,v,w)
315     jit_code_subxr,             jit_code_subxi,
316 #define jit_rsbr(u,v,w)         jit_subr(u,w,v)
317 #define jit_rsbi(u,v,w)         jit_new_node_www(jit_code_rsbi,u,v,w)
318     jit_code_rsbi,
319 #define jit_mulr(u,v,w)         jit_new_node_www(jit_code_mulr,u,v,w)
320 #define jit_muli(u,v,w)         jit_new_node_www(jit_code_muli,u,v,w)
321     jit_code_mulr,              jit_code_muli,
322 #define jit_qmulr(l,h,v,w)      jit_new_node_qww(jit_code_qmulr,l,h,v,w)
323 #define jit_qmuli(l,h,v,w)      jit_new_node_qww(jit_code_qmuli,l,h,v,w)
324     jit_code_qmulr,             jit_code_qmuli,
325 #define jit_qmulr_u(l,h,v,w)    jit_new_node_qww(jit_code_qmulr_u,l,h,v,w)
326 #define jit_qmuli_u(l,h,v,w)    jit_new_node_qww(jit_code_qmuli_u,l,h,v,w)
327     jit_code_qmulr_u,           jit_code_qmuli_u,
328 #define jit_divr(u,v,w)         jit_new_node_www(jit_code_divr,u,v,w)
329 #define jit_divi(u,v,w)         jit_new_node_www(jit_code_divi,u,v,w)
330     jit_code_divr,              jit_code_divi,
331 #define jit_divr_u(u,v,w)       jit_new_node_www(jit_code_divr_u,u,v,w)
332 #define jit_divi_u(u,v,w)       jit_new_node_www(jit_code_divi_u,u,v,w)
333     jit_code_divr_u,            jit_code_divi_u,
334 #define jit_qdivr(l,h,v,w)      jit_new_node_qww(jit_code_qdivr,l,h,v,w)
335 #define jit_qdivi(l,h,v,w)      jit_new_node_qww(jit_code_qdivi,l,h,v,w)
336     jit_code_qdivr,             jit_code_qdivi,
337 #define jit_qdivr_u(l,h,v,w)    jit_new_node_qww(jit_code_qdivr_u,l,h,v,w)
338 #define jit_qdivi_u(l,h,v,w)    jit_new_node_qww(jit_code_qdivi_u,l,h,v,w)
339     jit_code_qdivr_u,           jit_code_qdivi_u,
340 #define jit_remr(u,v,w)         jit_new_node_www(jit_code_remr,u,v,w)
341 #define jit_remi(u,v,w)         jit_new_node_www(jit_code_remi,u,v,w)
342     jit_code_remr,              jit_code_remi,
343 #define jit_remr_u(u,v,w)       jit_new_node_www(jit_code_remr_u,u,v,w)
344 #define jit_remi_u(u,v,w)       jit_new_node_www(jit_code_remi_u,u,v,w)
345     jit_code_remr_u,            jit_code_remi_u,
346
347 #define jit_andr(u,v,w)         jit_new_node_www(jit_code_andr,u,v,w)
348 #define jit_andi(u,v,w)         jit_new_node_www(jit_code_andi,u,v,w)
349     jit_code_andr,              jit_code_andi,
350 #define jit_orr(u,v,w)          jit_new_node_www(jit_code_orr,u,v,w)
351 #define jit_ori(u,v,w)          jit_new_node_www(jit_code_ori,u,v,w)
352     jit_code_orr,               jit_code_ori,
353 #define jit_xorr(u,v,w)         jit_new_node_www(jit_code_xorr,u,v,w)
354 #define jit_xori(u,v,w)         jit_new_node_www(jit_code_xori,u,v,w)
355     jit_code_xorr,              jit_code_xori,
356
357 #define jit_lshr(u,v,w)         jit_new_node_www(jit_code_lshr,u,v,w)
358 #define jit_lshi(u,v,w)         jit_new_node_www(jit_code_lshi,u,v,w)
359     jit_code_lshr,              jit_code_lshi,
360 #define jit_rshr(u,v,w)         jit_new_node_www(jit_code_rshr,u,v,w)
361 #define jit_rshi(u,v,w)         jit_new_node_www(jit_code_rshi,u,v,w)
362     jit_code_rshr,              jit_code_rshi,
363 #define jit_rshr_u(u,v,w)       jit_new_node_www(jit_code_rshr_u,u,v,w)
364 #define jit_rshi_u(u,v,w)       jit_new_node_www(jit_code_rshi_u,u,v,w)
365     jit_code_rshr_u,            jit_code_rshi_u,
366
367 #define jit_negr(u,v)           jit_new_node_ww(jit_code_negr,u,v)
368 #define jit_negi(u,v)           jit_new_node_ww(jit_code_negi,u,v)
369     jit_code_negr,              jit_code_negi,
370 #define jit_comr(u,v)           jit_new_node_ww(jit_code_comr,u,v)
371 #define jit_comi(u,v)           jit_new_node_ww(jit_code_comi,u,v)
372     jit_code_comr,              jit_code_comi,
373
374 #define jit_ltr(u,v,w)          jit_new_node_www(jit_code_ltr,u,v,w)
375 #define jit_lti(u,v,w)          jit_new_node_www(jit_code_lti,u,v,w)
376     jit_code_ltr,               jit_code_lti,
377 #define jit_ltr_u(u,v,w)        jit_new_node_www(jit_code_ltr_u,u,v,w)
378 #define jit_lti_u(u,v,w)        jit_new_node_www(jit_code_lti_u,u,v,w)
379     jit_code_ltr_u,             jit_code_lti_u,
380 #define jit_ler(u,v,w)          jit_new_node_www(jit_code_ler,u,v,w)
381 #define jit_lei(u,v,w)          jit_new_node_www(jit_code_lei,u,v,w)
382     jit_code_ler,               jit_code_lei,
383 #define jit_ler_u(u,v,w)        jit_new_node_www(jit_code_ler_u,u,v,w)
384 #define jit_lei_u(u,v,w)        jit_new_node_www(jit_code_lei_u,u,v,w)
385     jit_code_ler_u,             jit_code_lei_u,
386 #define jit_eqr(u,v,w)          jit_new_node_www(jit_code_eqr,u,v,w)
387 #define jit_eqi(u,v,w)          jit_new_node_www(jit_code_eqi,u,v,w)
388     jit_code_eqr,               jit_code_eqi,
389 #define jit_ger(u,v,w)          jit_new_node_www(jit_code_ger,u,v,w)
390 #define jit_gei(u,v,w)          jit_new_node_www(jit_code_gei,u,v,w)
391     jit_code_ger,               jit_code_gei,
392 #define jit_ger_u(u,v,w)        jit_new_node_www(jit_code_ger_u,u,v,w)
393 #define jit_gei_u(u,v,w)        jit_new_node_www(jit_code_gei_u,u,v,w)
394     jit_code_ger_u,             jit_code_gei_u,
395 #define jit_gtr(u,v,w)          jit_new_node_www(jit_code_gtr,u,v,w)
396 #define jit_gti(u,v,w)          jit_new_node_www(jit_code_gti,u,v,w)
397     jit_code_gtr,               jit_code_gti,
398 #define jit_gtr_u(u,v,w)        jit_new_node_www(jit_code_gtr_u,u,v,w)
399 #define jit_gti_u(u,v,w)        jit_new_node_www(jit_code_gti_u,u,v,w)
400     jit_code_gtr_u,             jit_code_gti_u,
401 #define jit_ner(u,v,w)          jit_new_node_www(jit_code_ner,u,v,w)
402 #define jit_nei(u,v,w)          jit_new_node_www(jit_code_nei,u,v,w)
403     jit_code_ner,               jit_code_nei,
404
405 #define jit_movr(u,v)           jit_new_node_ww(jit_code_movr,u,v)
406 #define jit_movi(u,v)           jit_new_node_ww(jit_code_movi,u,v)
407     jit_code_movr,              jit_code_movi,
408
409 #define jit_movnr(u,v,w)        jit_new_node_www(jit_code_movnr,u,v,w)
410 #define jit_movzr(u,v,w)        jit_new_node_www(jit_code_movzr,u,v,w)
411     jit_code_movnr,             jit_code_movzr,
412
413     jit_code_casr,              jit_code_casi,
414 #define jit_casr(u, v, w, x)    jit_new_node_wwq(jit_code_casr, u, v, w, x)
415 #define jit_casi(u, v, w, x)    jit_new_node_wwq(jit_code_casi, u, v, w, x)
416
417 #define jit_extr_c(u,v)         jit_new_node_ww(jit_code_extr_c,u,v)
418 #define jit_exti_c(u,v)         jit_new_node_ww(jit_code_exti_c,u,v)
419     jit_code_extr_c,            jit_code_exti_c,
420
421 #define jit_extr_uc(u,v)        jit_new_node_ww(jit_code_extr_uc,u,v)
422 #define jit_exti_uc(u,v)        jit_new_node_ww(jit_code_exti_uc,u,v)
423     jit_code_extr_uc,           jit_code_exti_uc,
424
425 #define jit_extr_s(u,v)         jit_new_node_ww(jit_code_extr_s,u,v)
426 #define jit_exti_s(u,v)         jit_new_node_ww(jit_code_exti_s,u,v)
427     jit_code_extr_s,            jit_code_exti_s,
428
429 #define jit_extr_us(u,v)        jit_new_node_ww(jit_code_extr_us,u,v)
430 #define jit_exti_us(u,v)        jit_new_node_ww(jit_code_exti_us,u,v)
431     jit_code_extr_us,           jit_code_exti_us,
432
433 #if __WORDSIZE == 64
434 #  define jit_extr_i(u,v)       jit_new_node_ww(jit_code_extr_i,u,v)
435 #  define jit_exti_i(u,v)       jit_new_node_ww(jit_code_exti_i,u,v)
436 #  define jit_extr_ui(u,v)      jit_new_node_ww(jit_code_extr_ui,u,v)
437 #  define jit_exti_ui(u,v)      jit_new_node_ww(jit_code_exti_ui,u,v)
438 #endif
439     jit_code_extr_i,            jit_code_exti_i,
440     jit_code_extr_ui,           jit_code_exti_ui,
441
442 #define jit_bswapr_us(u,v)      jit_new_node_ww(jit_code_bswapr_us,u,v)
443 #define jit_bswapi_us(u,v)      jit_new_node_ww(jit_code_bswapi_us,u,v)
444     jit_code_bswapr_us,         jit_code_bswapi_us,
445
446 #define jit_bswapr_ui(u,v)      jit_new_node_ww(jit_code_bswapr_ui,u,v)
447 #define jit_bswapi_ui(u,v)      jit_new_node_ww(jit_code_bswapi_ui,u,v)
448     jit_code_bswapr_ui,         jit_code_bswapi_ui,
449
450 #if __WORDSIZE == 64
451 #  define jit_bswapr_ul(u,v)    jit_new_node_ww(jit_code_bswapr_ul,u,v)
452 #  define jit_bswapi_ul(u,v)    jit_new_node_ww(jit_code_bswapi_ul,u,v)
453 #endif
454     jit_code_bswapr_ul,         jit_code_bswapi_ul,
455
456 #if __WORDSIZE == 32
457 #  define jit_bswapr(u,v)       jit_bswapr_ui(u,v)
458 #  define jit_bswapi(u,v)       jit_bswapi_ui(u,v)
459 #else
460 #  define jit_bswapr(u,v)       jit_bswapr_ul(u,v)
461 #  define jit_bswapi(u,v)       jit_bswapi_ul(u,v)
462 #endif
463
464 #define jit_htonr_us(u,v)       jit_new_node_ww(jit_code_htonr_us,u,v)
465 #define jit_ntohr_us(u,v)       jit_htonr_us(u,v)
466 #define jit_htoni_us(u,v)       jit_new_node_ww(jit_code_htoni_us,u,v)
467 #define jit_ntohi_us(u,v)       jit_htoni_us(u, v)
468     jit_code_htonr_us,          jit_code_htoni_us,
469
470 #define jit_htonr_ui(u,v)       jit_new_node_ww(jit_code_htonr_ui,u,v)
471 #define jit_ntohr_ui(u,v)       jit_htonr_ui(u,v)
472 #define jit_htoni_ui(u,v)       jit_new_node_ww(jit_code_htoni_ui,u,v)
473 #define jit_ntohi_ui(u,v)       jit_htoni_ui(u, v)
474     jit_code_htonr_ui,          jit_code_htoni_ui,
475
476 #if __WORDSIZE == 64
477 #  define jit_htonr_ul(u,v)     jit_new_node_ww(jit_code_htonr_ul,u,v)
478 #  define jit_ntohr_ul(u,v)     jit_htonr_ul(u,v)
479 #  define jit_htoni_ul(u,v)     jit_new_node_ww(jit_code_htoni_ul,u,v)
480 #  define jit_ntohi_ul(u,v)     jit_htoni_ul(u, v)
481 #endif
482     jit_code_htonr_ul,          jit_code_htoni_ul,
483
484 #if __WORDSIZE == 32
485 #  define jit_htonr(u,v)        jit_htonr_ui(u,v)
486 #  define jit_htoni(u,v)        jit_htoni_ui(u,v)
487 #else
488 #  define jit_htonr(u,v)        jit_htonr_ul(u,v)
489 #  define jit_htoni(u,v)        jit_htoni_ul(u,v)
490 #endif
491 #define jit_ntohr(u,v)          jit_htonr(u,v)
492 #define jit_ntohi(u,v)          jit_htoni(u,v)
493
494 #define jit_ldr_c(u,v)          jit_new_node_ww(jit_code_ldr_c,u,v)
495 #define jit_ldi_c(u,v)          jit_new_node_wp(jit_code_ldi_c,u,v)
496     jit_code_ldr_c,             jit_code_ldi_c,
497 #define jit_ldr_uc(u,v)         jit_new_node_ww(jit_code_ldr_uc,u,v)
498 #define jit_ldi_uc(u,v)         jit_new_node_wp(jit_code_ldi_uc,u,v)
499     jit_code_ldr_uc,            jit_code_ldi_uc,
500 #define jit_ldr_s(u,v)          jit_new_node_ww(jit_code_ldr_s,u,v)
501 #define jit_ldi_s(u,v)          jit_new_node_wp(jit_code_ldi_s,u,v)
502     jit_code_ldr_s,             jit_code_ldi_s,
503 #define jit_ldr_us(u,v)         jit_new_node_ww(jit_code_ldr_us,u,v)
504 #define jit_ldi_us(u,v)         jit_new_node_wp(jit_code_ldi_us,u,v)
505     jit_code_ldr_us,            jit_code_ldi_us,
506 #define jit_ldr_i(u,v)          jit_new_node_ww(jit_code_ldr_i,u,v)
507 #define jit_ldi_i(u,v)          jit_new_node_wp(jit_code_ldi_i,u,v)
508     jit_code_ldr_i,             jit_code_ldi_i,
509 #if __WORDSIZE == 32
510 #  define jit_ldr(u,v)          jit_ldr_i(u,v)
511 #  define jit_ldi(u,v)          jit_ldi_i(u,v)
512 #else
513 #  define jit_ldr(u,v)          jit_ldr_l(u,v)
514 #  define jit_ldi(u,v)          jit_ldi_l(u,v)
515 #  define jit_ldr_ui(u,v)       jit_new_node_ww(jit_code_ldr_ui,u,v)
516 #  define jit_ldi_ui(u,v)       jit_new_node_wp(jit_code_ldi_ui,u,v)
517 #define jit_ldr_l(u,v)          jit_new_node_ww(jit_code_ldr_l,u,v)
518 #define jit_ldi_l(u,v)          jit_new_node_wp(jit_code_ldi_l,u,v)
519 #endif
520     jit_code_ldr_ui,            jit_code_ldi_ui,
521     jit_code_ldr_l,             jit_code_ldi_l,
522
523 #define jit_ldxr_c(u,v,w)       jit_new_node_www(jit_code_ldxr_c,u,v,w)
524 #define jit_ldxi_c(u,v,w)       jit_new_node_www(jit_code_ldxi_c,u,v,w)
525     jit_code_ldxr_c,            jit_code_ldxi_c,
526 #define jit_ldxr_uc(u,v,w)      jit_new_node_www(jit_code_ldxr_uc,u,v,w)
527 #define jit_ldxi_uc(u,v,w)      jit_new_node_www(jit_code_ldxi_uc,u,v,w)
528     jit_code_ldxr_uc,           jit_code_ldxi_uc,
529 #define jit_ldxr_s(u,v,w)       jit_new_node_www(jit_code_ldxr_s,u,v,w)
530 #define jit_ldxi_s(u,v,w)       jit_new_node_www(jit_code_ldxi_s,u,v,w)
531     jit_code_ldxr_s,            jit_code_ldxi_s,
532 #define jit_ldxr_us(u,v,w)      jit_new_node_www(jit_code_ldxr_us,u,v,w)
533 #define jit_ldxi_us(u,v,w)      jit_new_node_www(jit_code_ldxi_us,u,v,w)
534     jit_code_ldxr_us,           jit_code_ldxi_us,
535 #define jit_ldxr_i(u,v,w)       jit_new_node_www(jit_code_ldxr_i,u,v,w)
536 #define jit_ldxi_i(u,v,w)       jit_new_node_www(jit_code_ldxi_i,u,v,w)
537     jit_code_ldxr_i,            jit_code_ldxi_i,
538 #if __WORDSIZE == 32
539 #  define jit_ldxr(u,v,w)       jit_ldxr_i(u,v,w)
540 #  define jit_ldxi(u,v,w)       jit_ldxi_i(u,v,w)
541 #else
542 #  define jit_ldxr_ui(u,v,w)    jit_new_node_www(jit_code_ldxr_ui,u,v,w)
543 #  define jit_ldxi_ui(u,v,w)    jit_new_node_www(jit_code_ldxi_ui,u,v,w)
544 #  define jit_ldxr_l(u,v,w)     jit_new_node_www(jit_code_ldxr_l,u,v,w)
545 #  define jit_ldxi_l(u,v,w)     jit_new_node_www(jit_code_ldxi_l,u,v,w)
546 #  define jit_ldxr(u,v,w)       jit_ldxr_l(u,v,w)
547 #  define jit_ldxi(u,v,w)       jit_ldxi_l(u,v,w)
548 #endif
549     jit_code_ldxr_ui,           jit_code_ldxi_ui,
550     jit_code_ldxr_l,            jit_code_ldxi_l,
551
552 #define jit_str_c(u,v)          jit_new_node_ww(jit_code_str_c,u,v)
553 #define jit_sti_c(u,v)          jit_new_node_pw(jit_code_sti_c,u,v)
554     jit_code_str_c,             jit_code_sti_c,
555 #define jit_str_s(u,v)          jit_new_node_ww(jit_code_str_s,u,v)
556 #define jit_sti_s(u,v)          jit_new_node_pw(jit_code_sti_s,u,v)
557     jit_code_str_s,             jit_code_sti_s,
558 #define jit_str_i(u,v)          jit_new_node_ww(jit_code_str_i,u,v)
559 #define jit_sti_i(u,v)          jit_new_node_pw(jit_code_sti_i,u,v)
560     jit_code_str_i,             jit_code_sti_i,
561 #if __WORDSIZE == 32
562 #  define jit_str(u,v)          jit_str_i(u,v)
563 #  define jit_sti(u,v)          jit_sti_i(u,v)
564 #else
565 #  define jit_str(u,v)          jit_str_l(u,v)
566 #  define jit_sti(u,v)          jit_sti_l(u,v)
567 #  define jit_str_l(u,v)        jit_new_node_ww(jit_code_str_l,u,v)
568 #  define jit_sti_l(u,v)        jit_new_node_pw(jit_code_sti_l,u,v)
569 #endif
570     jit_code_str_l,             jit_code_sti_l,
571
572 #define jit_stxr_c(u,v,w)       jit_new_node_www(jit_code_stxr_c,u,v,w)
573 #define jit_stxi_c(u,v,w)       jit_new_node_www(jit_code_stxi_c,u,v,w)
574     jit_code_stxr_c,            jit_code_stxi_c,
575 #define jit_stxr_s(u,v,w)       jit_new_node_www(jit_code_stxr_s,u,v,w)
576 #define jit_stxi_s(u,v,w)       jit_new_node_www(jit_code_stxi_s,u,v,w)
577     jit_code_stxr_s,            jit_code_stxi_s,
578 #define jit_stxr_i(u,v,w)       jit_new_node_www(jit_code_stxr_i,u,v,w)
579 #define jit_stxi_i(u,v,w)       jit_new_node_www(jit_code_stxi_i,u,v,w)
580     jit_code_stxr_i,            jit_code_stxi_i,
581 #if __WORDSIZE == 32
582 #  define jit_stxr(u,v,w)       jit_stxr_i(u,v,w)
583 #  define jit_stxi(u,v,w)       jit_stxi_i(u,v,w)
584 #else
585 #  define jit_stxr(u,v,w)       jit_stxr_l(u,v,w)
586 #  define jit_stxi(u,v,w)       jit_stxi_l(u,v,w)
587 #  define jit_stxr_l(u,v,w)     jit_new_node_www(jit_code_stxr_l,u,v,w)
588 #  define jit_stxi_l(u,v,w)     jit_new_node_www(jit_code_stxi_l,u,v,w)
589 #endif
590     jit_code_stxr_l,            jit_code_stxi_l,
591
592 #define jit_bltr(v,w)           jit_new_node_pww(jit_code_bltr,NULL,v,w)
593 #define jit_blti(v,w)           jit_new_node_pww(jit_code_blti,NULL,v,w)
594     jit_code_bltr,              jit_code_blti,
595 #define jit_bltr_u(v,w)         jit_new_node_pww(jit_code_bltr_u,NULL,v,w)
596 #define jit_blti_u(v,w)         jit_new_node_pww(jit_code_blti_u,NULL,v,w)
597     jit_code_bltr_u,            jit_code_blti_u,
598 #define jit_bler(v,w)           jit_new_node_pww(jit_code_bler,NULL,v,w)
599 #define jit_blei(v,w)           jit_new_node_pww(jit_code_blei,NULL,v,w)
600     jit_code_bler,              jit_code_blei,
601 #define jit_bler_u(v,w)         jit_new_node_pww(jit_code_bler_u,NULL,v,w)
602 #define jit_blei_u(v,w)         jit_new_node_pww(jit_code_blei_u,NULL,v,w)
603     jit_code_bler_u,            jit_code_blei_u,
604 #define jit_beqr(v,w)           jit_new_node_pww(jit_code_beqr,NULL,v,w)
605 #define jit_beqi(v,w)           jit_new_node_pww(jit_code_beqi,NULL,v,w)
606     jit_code_beqr,              jit_code_beqi,
607 #define jit_bger(v,w)           jit_new_node_pww(jit_code_bger,NULL,v,w)
608 #define jit_bgei(v,w)           jit_new_node_pww(jit_code_bgei,NULL,v,w)
609     jit_code_bger,              jit_code_bgei,
610 #define jit_bger_u(v,w)         jit_new_node_pww(jit_code_bger_u,NULL,v,w)
611 #define jit_bgei_u(v,w)         jit_new_node_pww(jit_code_bgei_u,NULL,v,w)
612     jit_code_bger_u,            jit_code_bgei_u,
613 #define jit_bgtr(v,w)           jit_new_node_pww(jit_code_bgtr,NULL,v,w)
614 #define jit_bgti(v,w)           jit_new_node_pww(jit_code_bgti,NULL,v,w)
615     jit_code_bgtr,              jit_code_bgti,
616 #define jit_bgtr_u(v,w)         jit_new_node_pww(jit_code_bgtr_u,NULL,v,w)
617 #define jit_bgti_u(v,w)         jit_new_node_pww(jit_code_bgti_u,NULL,v,w)
618     jit_code_bgtr_u,            jit_code_bgti_u,
619 #define jit_bner(v,w)           jit_new_node_pww(jit_code_bner,NULL,v,w)
620 #define jit_bnei(v,w)           jit_new_node_pww(jit_code_bnei,NULL,v,w)
621     jit_code_bner,              jit_code_bnei,
622
623 #define jit_bmsr(v,w)           jit_new_node_pww(jit_code_bmsr,NULL,v,w)
624 #define jit_bmsi(v,w)           jit_new_node_pww(jit_code_bmsi,NULL,v,w)
625     jit_code_bmsr,              jit_code_bmsi,
626 #define jit_bmcr(v,w)           jit_new_node_pww(jit_code_bmcr,NULL,v,w)
627 #define jit_bmci(v,w)           jit_new_node_pww(jit_code_bmci,NULL,v,w)
628     jit_code_bmcr,              jit_code_bmci,
629
630 #define jit_boaddr(v,w)         jit_new_node_pww(jit_code_boaddr,NULL,v,w)
631 #define jit_boaddi(v,w)         jit_new_node_pww(jit_code_boaddi,NULL,v,w)
632     jit_code_boaddr,            jit_code_boaddi,
633 #define jit_boaddr_u(v,w)       jit_new_node_pww(jit_code_boaddr_u,NULL,v,w)
634 #define jit_boaddi_u(v,w)       jit_new_node_pww(jit_code_boaddi_u,NULL,v,w)
635     jit_code_boaddr_u,          jit_code_boaddi_u,
636 #define jit_bxaddr(v,w)         jit_new_node_pww(jit_code_bxaddr,NULL,v,w)
637 #define jit_bxaddi(v,w)         jit_new_node_pww(jit_code_bxaddi,NULL,v,w)
638     jit_code_bxaddr,            jit_code_bxaddi,
639 #define jit_bxaddr_u(v,w)       jit_new_node_pww(jit_code_bxaddr_u,NULL,v,w)
640 #define jit_bxaddi_u(v,w)       jit_new_node_pww(jit_code_bxaddi_u,NULL,v,w)
641     jit_code_bxaddr_u,          jit_code_bxaddi_u,
642 #define jit_bosubr(v,w)         jit_new_node_pww(jit_code_bosubr,NULL,v,w)
643 #define jit_bosubi(v,w)         jit_new_node_pww(jit_code_bosubi,NULL,v,w)
644     jit_code_bosubr,            jit_code_bosubi,
645 #define jit_bosubr_u(v,w)       jit_new_node_pww(jit_code_bosubr_u,NULL,v,w)
646 #define jit_bosubi_u(v,w)       jit_new_node_pww(jit_code_bosubi_u,NULL,v,w)
647     jit_code_bosubr_u,          jit_code_bosubi_u,
648 #define jit_bxsubr(v,w)         jit_new_node_pww(jit_code_bxsubr,NULL,v,w)
649 #define jit_bxsubi(v,w)         jit_new_node_pww(jit_code_bxsubi,NULL,v,w)
650     jit_code_bxsubr,            jit_code_bxsubi,
651 #define jit_bxsubr_u(v,w)       jit_new_node_pww(jit_code_bxsubr_u,NULL,v,w)
652 #define jit_bxsubi_u(v,w)       jit_new_node_pww(jit_code_bxsubi_u,NULL,v,w)
653     jit_code_bxsubr_u,          jit_code_bxsubi_u,
654
655 #define jit_jmpr(u)             jit_new_node_w(jit_code_jmpr,u)
656 #define jit_jmpi()              jit_new_node_p(jit_code_jmpi,NULL)
657     jit_code_jmpr,              jit_code_jmpi,
658 #define jit_callr(u)            jit_new_node_w(jit_code_callr,u)
659 #define jit_calli(u)            jit_new_node_p(jit_code_calli,u)
660     jit_code_callr,             jit_code_calli,
661
662 #define jit_prepare()           _jit_prepare(_jit)
663     jit_code_prepare,
664
665 #define jit_pushargr_c(u)       _jit_pushargr(_jit,u,jit_code_pushargr_c)
666 #define jit_pushargi_c(u)       _jit_pushargi(_jit,u,jit_code_pushargi_c)
667 #define jit_pushargr_uc(u)      _jit_pushargr(_jit,u,jit_code_pushargr_uc)
668 #define jit_pushargi_uc(u)      _jit_pushargi(_jit,u,jit_code_pushargi_uc)
669 #define jit_pushargr_s(u)       _jit_pushargr(_jit,u,jit_code_pushargr_s)
670 #define jit_pushargi_s(u)       _jit_pushargi(_jit,u,jit_code_pushargi_s)
671 #define jit_pushargr_us(u)      _jit_pushargr(_jit,u,jit_code_pushargr_us)
672 #define jit_pushargi_us(u)      _jit_pushargi(_jit,u,jit_code_pushargi_us)
673 #define jit_pushargr_i(u)       _jit_pushargr(_jit,u,jit_code_pushargr_i)
674 #define jit_pushargi_i(u)       _jit_pushargi(_jit,u,jit_code_pushargi_i)
675 #if __WORDSIZE == 32
676 #  define jit_pushargr(u)       jit_pushargr_i(u)
677 #  define jit_pushargi(u)       jit_pushargi_i(u)
678 #else
679 #  define jit_pushargr_ui(u)    _jit_pushargr(_jit,u,jit_code_pushargr_ui)
680 #  define jit_pushargi_ui(u)    _jit_pushargi(_jit,u,jit_code_pushargi_ui)
681 #  define jit_pushargr_l(u)     _jit_pushargr(_jit,u,jit_code_pushargr_l)
682 #  define jit_pushargi_l(u)     _jit_pushargi(_jit,u,jit_code_pushargi_l)
683 #  define jit_pushargr(u)       jit_pushargr_l(u)
684 #  define jit_pushargi(u)       jit_pushargi_l(u)
685 #endif
686     jit_code_pushargr_c,        jit_code_pushargi_c,
687     jit_code_pushargr_uc,       jit_code_pushargi_uc,
688     jit_code_pushargr_s,        jit_code_pushargi_s,
689     jit_code_pushargr_us,       jit_code_pushargi_us,
690     jit_code_pushargr_i,        jit_code_pushargi_i,
691     jit_code_pushargr_ui,       jit_code_pushargi_ui,
692     jit_code_pushargr_l,        jit_code_pushargi_l,
693 #if __WORDSIZE == 32
694 #  define jit_code_pushargr     jit_code_pushargr_i
695 #  define jit_code_pushargi     jit_code_pushargi_i
696 #else
697 #  define jit_code_pushargr     jit_code_pushargr_l
698 #  define jit_code_pushargi     jit_code_pushargi_l
699 #endif
700
701 #define jit_finishr(u)          _jit_finishr(_jit,u)
702 #define jit_finishi(u)          _jit_finishi(_jit,u)
703     jit_code_finishr,           jit_code_finishi,
704 #define jit_ret()               _jit_ret(_jit)
705     jit_code_ret,
706
707 #define jit_retr_c(u)           _jit_retr(_jit,u,jit_code_retr_c)
708 #define jit_reti_c(u)           _jit_reti(_jit,u,jit_code_reti_c)
709 #define jit_retr_uc(u)          _jit_retr(_jit,u,jit_code_retr_uc)
710 #define jit_reti_uc(u)          _jit_reti(_jit,u,jit_code_reti_uc)
711 #define jit_retr_s(u)           _jit_retr(_jit,u,jit_code_retr_s)
712 #define jit_reti_s(u)           _jit_reti(_jit,u,jit_code_reti_s)
713 #define jit_retr_us(u)          _jit_retr(_jit,u,jit_code_retr_us)
714 #define jit_reti_us(u)          _jit_reti(_jit,u,jit_code_reti_us)
715 #define jit_retr_i(u)           _jit_retr(_jit,u,jit_code_retr_i)
716 #define jit_reti_i(u)           _jit_reti(_jit,u,jit_code_reti_i)
717 #if __WORDSIZE == 32
718 #  define jit_retr(u)           jit_retr_i(u)
719 #  define jit_reti(u)           jit_reti_i(u)
720 #else
721 #  define jit_retr_ui(u)        _jit_retr(_jit,u,jit_code_retr_ui)
722 #  define jit_reti_ui(u)        _jit_reti(_jit,u,jit_code_reti_ui)
723 #  define jit_retr_l(u)         _jit_retr(_jit,u,jit_code_retr_l)
724 #  define jit_reti_l(u)         _jit_reti(_jit,u,jit_code_reti_l)
725 #  define jit_retr(u)           jit_retr_l(u)
726 #  define jit_reti(u)           jit_reti_l(u)
727 #endif
728     jit_code_retr_c,            jit_code_reti_c,
729     jit_code_retr_uc,           jit_code_reti_uc,
730     jit_code_retr_s,            jit_code_reti_s,
731     jit_code_retr_us,           jit_code_reti_us,
732     jit_code_retr_i,            jit_code_reti_i,
733     jit_code_retr_ui,           jit_code_reti_ui,
734     jit_code_retr_l,            jit_code_reti_l,
735 #if __WORDSIZE == 32
736 #  define jit_code_retr         jit_code_retr_i
737 #  define jit_code_reti         jit_code_reti_i
738 #else
739 #  define jit_code_retr         jit_code_retr_l
740 #  define jit_code_reti         jit_code_reti_l
741 #endif
742
743 #define jit_retval_c(u)         _jit_retval_c(_jit,u)
744 #define jit_retval_uc(u)        _jit_retval_uc(_jit,u)
745 #define jit_retval_s(u)         _jit_retval_s(_jit,u)
746 #define jit_retval_us(u)        _jit_retval_us(_jit,u)
747 #define jit_retval_i(u)         _jit_retval_i(_jit,u)
748 #if __WORDSIZE == 32
749 #  define jit_retval(u)         jit_retval_i(u)
750 #else
751 #  define jit_retval_ui(u)      _jit_retval_ui(_jit,u)
752 #  define jit_retval_l(u)       _jit_retval_l(_jit,u)
753 #  define jit_retval(u)         jit_retval_l(u)
754 #endif
755     jit_code_retval_c,          jit_code_retval_uc,
756     jit_code_retval_s,          jit_code_retval_us,
757     jit_code_retval_i,          jit_code_retval_ui,
758     jit_code_retval_l,
759 #if __WORDSIZE == 32
760 #  define jit_code_retval       jit_code_retval_i
761 #else
762 #  define jit_code_retval       jit_code_retval_l
763 #endif
764
765 #define jit_epilog()            _jit_epilog(_jit)
766     jit_code_epilog,
767
768 #define jit_arg_f()             _jit_arg_f(_jit)
769     jit_code_arg_f,
770 #define jit_getarg_f(u,v)       _jit_getarg_f(_jit,u,v)
771     jit_code_getarg_f,
772 #define jit_putargr_f(u,v)      _jit_putargr_f(_jit,u,v)
773 #define jit_putargi_f(u,v)      _jit_putargi_f(_jit,u,v)
774     jit_code_putargr_f,         jit_code_putargi_f,
775
776 #define jit_addr_f(u,v,w)       jit_new_node_www(jit_code_addr_f,u,v,w)
777 #define jit_addi_f(u,v,w)       jit_new_node_wwf(jit_code_addi_f,u,v,w)
778     jit_code_addr_f,            jit_code_addi_f,
779 #define jit_subr_f(u,v,w)       jit_new_node_www(jit_code_subr_f,u,v,w)
780 #define jit_subi_f(u,v,w)       jit_new_node_wwf(jit_code_subi_f,u,v,w)
781     jit_code_subr_f,            jit_code_subi_f,
782 #define jit_rsbr_f(u,v,w)       jit_subr_f(u,w,v)
783 #define jit_rsbi_f(u,v,w)       jit_new_node_wwf(jit_code_rsbi_f,u,v,w)
784     jit_code_rsbi_f,
785 #define jit_mulr_f(u,v,w)       jit_new_node_www(jit_code_mulr_f,u,v,w)
786 #define jit_muli_f(u,v,w)       jit_new_node_wwf(jit_code_muli_f,u,v,w)
787     jit_code_mulr_f,            jit_code_muli_f,
788 #define jit_divr_f(u,v,w)       jit_new_node_www(jit_code_divr_f,u,v,w)
789 #define jit_divi_f(u,v,w)       jit_new_node_wwf(jit_code_divi_f,u,v,w)
790     jit_code_divr_f,            jit_code_divi_f,
791
792 #define jit_negr_f(u,v)         jit_new_node_ww(jit_code_negr_f,u,v)
793 #define jit_negi_f(u,v)         _jit_negi_f(_jit,u,v)
794     jit_code_negr_f,            jit_code_negi_f,
795 #define jit_absr_f(u,v)         jit_new_node_ww(jit_code_absr_f,u,v)
796 #define jit_absi_f(u,v)         _jit_absi_f(_jit,u,v)
797     jit_code_absr_f,            jit_code_absi_f,
798 #define jit_sqrtr_f(u,v)        jit_new_node_ww(jit_code_sqrtr_f,u,v)
799 #define jit_sqrti_f(u,v)        _jit_sqrti_f(_jit,u,v)
800     jit_code_sqrtr_f,           jit_code_sqrti_f,
801
802 #define jit_ltr_f(u,v,w)        jit_new_node_www(jit_code_ltr_f,u,v,w)
803 #define jit_lti_f(u,v,w)        jit_new_node_wwf(jit_code_lti_f,u,v,w)
804     jit_code_ltr_f,             jit_code_lti_f,
805 #define jit_ler_f(u,v,w)        jit_new_node_www(jit_code_ler_f,u,v,w)
806 #define jit_lei_f(u,v,w)        jit_new_node_wwf(jit_code_lei_f,u,v,w)
807     jit_code_ler_f,             jit_code_lei_f,
808 #define jit_eqr_f(u,v,w)        jit_new_node_www(jit_code_eqr_f,u,v,w)
809 #define jit_eqi_f(u,v,w)        jit_new_node_wwf(jit_code_eqi_f,u,v,w)
810     jit_code_eqr_f,             jit_code_eqi_f,
811 #define jit_ger_f(u,v,w)        jit_new_node_www(jit_code_ger_f,u,v,w)
812 #define jit_gei_f(u,v,w)        jit_new_node_wwf(jit_code_gei_f,u,v,w)
813     jit_code_ger_f,             jit_code_gei_f,
814 #define jit_gtr_f(u,v,w)        jit_new_node_www(jit_code_gtr_f,u,v,w)
815 #define jit_gti_f(u,v,w)        jit_new_node_wwf(jit_code_gti_f,u,v,w)
816     jit_code_gtr_f,             jit_code_gti_f,
817 #define jit_ner_f(u,v,w)        jit_new_node_www(jit_code_ner_f,u,v,w)
818 #define jit_nei_f(u,v,w)        jit_new_node_wwf(jit_code_nei_f,u,v,w)
819     jit_code_ner_f,             jit_code_nei_f,
820 #define jit_unltr_f(u,v,w)      jit_new_node_www(jit_code_unltr_f,u,v,w)
821 #define jit_unlti_f(u,v,w)      jit_new_node_wwf(jit_code_unlti_f,u,v,w)
822     jit_code_unltr_f,           jit_code_unlti_f,
823 #define jit_unler_f(u,v,w)      jit_new_node_www(jit_code_unler_f,u,v,w)
824 #define jit_unlei_f(u,v,w)      jit_new_node_wwf(jit_code_unlei_f,u,v,w)
825     jit_code_unler_f,           jit_code_unlei_f,
826 #define jit_uneqr_f(u,v,w)      jit_new_node_www(jit_code_uneqr_f,u,v,w)
827 #define jit_uneqi_f(u,v,w)      jit_new_node_wwf(jit_code_uneqi_f,u,v,w)
828     jit_code_uneqr_f,           jit_code_uneqi_f,
829 #define jit_unger_f(u,v,w)      jit_new_node_www(jit_code_unger_f,u,v,w)
830 #define jit_ungei_f(u,v,w)      jit_new_node_wwf(jit_code_ungei_f,u,v,w)
831     jit_code_unger_f,           jit_code_ungei_f,
832 #define jit_ungtr_f(u,v,w)      jit_new_node_www(jit_code_ungtr_f,u,v,w)
833 #define jit_ungti_f(u,v,w)      jit_new_node_wwf(jit_code_ungti_f,u,v,w)
834     jit_code_ungtr_f,           jit_code_ungti_f,
835 #define jit_ltgtr_f(u,v,w)      jit_new_node_www(jit_code_ltgtr_f,u,v,w)
836 #define jit_ltgti_f(u,v,w)      jit_new_node_wwf(jit_code_ltgti_f,u,v,w)
837     jit_code_ltgtr_f,           jit_code_ltgti_f,
838 #define jit_ordr_f(u,v,w)       jit_new_node_www(jit_code_ordr_f,u,v,w)
839 #define jit_ordi_f(u,v,w)       jit_new_node_wwf(jit_code_ordi_f,u,v,w)
840     jit_code_ordr_f,            jit_code_ordi_f,
841 #define jit_unordr_f(u,v,w)     jit_new_node_www(jit_code_unordr_f,u,v,w)
842 #define jit_unordi_f(u,v,w)     jit_new_node_wwf(jit_code_unordi_f,u,v,w)
843     jit_code_unordr_f,          jit_code_unordi_f,
844
845 #define jit_truncr_f_i(u,v)     jit_new_node_ww(jit_code_truncr_f_i,u,v)
846     jit_code_truncr_f_i,
847 #if __WORDSIZE == 32
848 #  define jit_truncr_f(u,v)     jit_truncr_f_i(u,v)
849 #else
850 #  define jit_truncr_f(u,v)     jit_truncr_f_l(u,v)
851 #  define jit_truncr_f_l(u,v)   jit_new_node_ww(jit_code_truncr_f_l,u,v)
852 #endif
853     jit_code_truncr_f_l,
854 #define jit_extr_f(u,v)         jit_new_node_ww(jit_code_extr_f,u,v)
855 #define jit_extr_d_f(u,v)       jit_new_node_ww(jit_code_extr_d_f,u,v)
856     jit_code_extr_f,            jit_code_extr_d_f,
857 #define jit_movr_f(u,v)         jit_new_node_ww(jit_code_movr_f,u,v)
858 #define jit_movi_f(u,v)         jit_new_node_wf(jit_code_movi_f,u,v)
859     jit_code_movr_f,            jit_code_movi_f,
860
861 #define jit_ldr_f(u,v)          jit_new_node_ww(jit_code_ldr_f,u,v)
862 #define jit_ldi_f(u,v)          jit_new_node_wp(jit_code_ldi_f,u,v)
863     jit_code_ldr_f,             jit_code_ldi_f,
864 #define jit_ldxr_f(u,v,w)       jit_new_node_www(jit_code_ldxr_f,u,v,w)
865 #define jit_ldxi_f(u,v,w)       jit_new_node_www(jit_code_ldxi_f,u,v,w)
866     jit_code_ldxr_f,            jit_code_ldxi_f,
867 #define jit_str_f(u,v)          jit_new_node_ww(jit_code_str_f,u,v)
868 #define jit_sti_f(u,v)          jit_new_node_pw(jit_code_sti_f,u,v)
869     jit_code_str_f,             jit_code_sti_f,
870 #define jit_stxr_f(u,v,w)       jit_new_node_www(jit_code_stxr_f,u,v,w)
871 #define jit_stxi_f(u,v,w)       jit_new_node_www(jit_code_stxi_f,u,v,w)
872     jit_code_stxr_f,            jit_code_stxi_f,
873
874 #define jit_bltr_f(v,w)         jit_new_node_pww(jit_code_bltr_f,NULL,v,w)
875 #define jit_blti_f(v,w)         jit_new_node_pwf(jit_code_blti_f,NULL,v,w)
876     jit_code_bltr_f,            jit_code_blti_f,
877 #define jit_bler_f(v,w)         jit_new_node_pww(jit_code_bler_f,NULL,v,w)
878 #define jit_blei_f(v,w)         jit_new_node_pwf(jit_code_blei_f,NULL,v,w)
879     jit_code_bler_f,            jit_code_blei_f,
880 #define jit_beqr_f(v,w)         jit_new_node_pww(jit_code_beqr_f,NULL,v,w)
881 #define jit_beqi_f(v,w)         jit_new_node_pwf(jit_code_beqi_f,NULL,v,w)
882     jit_code_beqr_f,            jit_code_beqi_f,
883 #define jit_bger_f(v,w)         jit_new_node_pww(jit_code_bger_f,NULL,v,w)
884 #define jit_bgei_f(v,w)         jit_new_node_pwf(jit_code_bgei_f,NULL,v,w)
885     jit_code_bger_f,            jit_code_bgei_f,
886 #define jit_bgtr_f(v,w)         jit_new_node_pww(jit_code_bgtr_f,NULL,v,w)
887 #define jit_bgti_f(v,w)         jit_new_node_pwf(jit_code_bgti_f,NULL,v,w)
888     jit_code_bgtr_f,            jit_code_bgti_f,
889 #define jit_bner_f(v,w)         jit_new_node_pww(jit_code_bner_f,NULL,v,w)
890 #define jit_bnei_f(v,w)         jit_new_node_pwf(jit_code_bnei_f,NULL,v,w)
891     jit_code_bner_f,            jit_code_bnei_f,
892 #define jit_bunltr_f(v,w)       jit_new_node_pww(jit_code_bunltr_f,NULL,v,w)
893 #define jit_bunlti_f(v,w)       jit_new_node_pwf(jit_code_bunlti_f,NULL,v,w)
894     jit_code_bunltr_f,          jit_code_bunlti_f,
895 #define jit_bunler_f(v,w)       jit_new_node_pww(jit_code_bunler_f,NULL,v,w)
896 #define jit_bunlei_f(v,w)       jit_new_node_pwf(jit_code_bunlei_f,NULL,v,w)
897     jit_code_bunler_f,          jit_code_bunlei_f,
898 #define jit_buneqr_f(v,w)       jit_new_node_pww(jit_code_buneqr_f,NULL,v,w)
899 #define jit_buneqi_f(v,w)       jit_new_node_pwf(jit_code_buneqi_f,NULL,v,w)
900     jit_code_buneqr_f,          jit_code_buneqi_f,
901 #define jit_bunger_f(v,w)       jit_new_node_pww(jit_code_bunger_f,NULL,v,w)
902 #define jit_bungei_f(v,w)       jit_new_node_pwf(jit_code_bungei_f,NULL,v,w)
903     jit_code_bunger_f,          jit_code_bungei_f,
904 #define jit_bungtr_f(v,w)       jit_new_node_pww(jit_code_bungtr_f,NULL,v,w)
905 #define jit_bungti_f(v,w)       jit_new_node_pwf(jit_code_bungti_f,NULL,v,w)
906     jit_code_bungtr_f,          jit_code_bungti_f,
907 #define jit_bltgtr_f(v,w)       jit_new_node_pww(jit_code_bltgtr_f,NULL,v,w)
908 #define jit_bltgti_f(v,w)       jit_new_node_pwf(jit_code_bltgti_f,NULL,v,w)
909     jit_code_bltgtr_f,          jit_code_bltgti_f,
910 #define jit_bordr_f(v,w)        jit_new_node_pww(jit_code_bordr_f,NULL,v,w)
911 #define jit_bordi_f(v,w)        jit_new_node_pwf(jit_code_bordi_f,NULL,v,w)
912     jit_code_bordr_f,           jit_code_bordi_f,
913 #define jit_bunordr_f(v,w)      jit_new_node_pww(jit_code_bunordr_f,NULL,v,w)
914 #define jit_bunordi_f(v,w)      jit_new_node_pwf(jit_code_bunordi_f,NULL,v,w)
915     jit_code_bunordr_f,         jit_code_bunordi_f,
916
917 #define jit_pushargr_f(u)       _jit_pushargr_f(_jit,u)
918 #define jit_pushargi_f(u)       _jit_pushargi_f(_jit,u)
919     jit_code_pushargr_f,        jit_code_pushargi_f,
920 #define jit_retr_f(u)           _jit_retr_f(_jit,u)
921 #define jit_reti_f(u)           _jit_reti_f(_jit,u)
922     jit_code_retr_f,            jit_code_reti_f,
923 #define jit_retval_f(u)         _jit_retval_f(_jit,u)
924     jit_code_retval_f,
925
926 #define jit_arg_d()             _jit_arg_d(_jit)
927     jit_code_arg_d,
928 #define jit_getarg_d(u,v)       _jit_getarg_d(_jit,u,v)
929     jit_code_getarg_d,
930 #define jit_putargr_d(u,v)      _jit_putargr_d(_jit,u,v)
931 #define jit_putargi_d(u,v)      _jit_putargi_d(_jit,u,v)
932     jit_code_putargr_d,         jit_code_putargi_d,
933
934 #define jit_addr_d(u,v,w)       jit_new_node_www(jit_code_addr_d,u,v,w)
935 #define jit_addi_d(u,v,w)       jit_new_node_wwd(jit_code_addi_d,u,v,w)
936     jit_code_addr_d,            jit_code_addi_d,
937 #define jit_subr_d(u,v,w)       jit_new_node_www(jit_code_subr_d,u,v,w)
938 #define jit_subi_d(u,v,w)       jit_new_node_wwd(jit_code_subi_d,u,v,w)
939     jit_code_subr_d,            jit_code_subi_d,
940 #define jit_rsbr_d(u,v,w)       jit_subr_d(u,w,v)
941 #define jit_rsbi_d(u,v,w)       jit_new_node_wwd(jit_code_rsbi_d,u,v,w)
942     jit_code_rsbi_d,
943 #define jit_mulr_d(u,v,w)       jit_new_node_www(jit_code_mulr_d,u,v,w)
944 #define jit_muli_d(u,v,w)       jit_new_node_wwd(jit_code_muli_d,u,v,w)
945     jit_code_mulr_d,            jit_code_muli_d,
946 #define jit_divr_d(u,v,w)       jit_new_node_www(jit_code_divr_d,u,v,w)
947 #define jit_divi_d(u,v,w)       jit_new_node_wwd(jit_code_divi_d,u,v,w)
948     jit_code_divr_d,            jit_code_divi_d,
949
950 #define jit_negr_d(u,v)         jit_new_node_ww(jit_code_negr_d,u,v)
951 #define jit_negi_d(u,v)         _jit_negi_d(_jit,u,v)
952     jit_code_negr_d,            jit_code_negi_d,
953 #define jit_absr_d(u,v)         jit_new_node_ww(jit_code_absr_d,u,v)
954 #define jit_absi_d(u,v)         _jit_absi_d(_jit,u,v)
955     jit_code_absr_d,            jit_code_absi_d,
956 #define jit_sqrtr_d(u,v)        jit_new_node_ww(jit_code_sqrtr_d,u,v)
957 #define jit_sqrti_d(u,v)        _jit_sqrti_d(_jit,u,v)
958     jit_code_sqrtr_d,           jit_code_sqrti_d,
959
960 #define jit_ltr_d(u,v,w)        jit_new_node_www(jit_code_ltr_d,u,v,w)
961 #define jit_lti_d(u,v,w)        jit_new_node_wwd(jit_code_lti_d,u,v,w)
962     jit_code_ltr_d,             jit_code_lti_d,
963 #define jit_ler_d(u,v,w)        jit_new_node_www(jit_code_ler_d,u,v,w)
964 #define jit_lei_d(u,v,w)        jit_new_node_wwd(jit_code_lei_d,u,v,w)
965     jit_code_ler_d,             jit_code_lei_d,
966 #define jit_eqr_d(u,v,w)        jit_new_node_www(jit_code_eqr_d,u,v,w)
967 #define jit_eqi_d(u,v,w)        jit_new_node_wwd(jit_code_eqi_d,u,v,w)
968     jit_code_eqr_d,             jit_code_eqi_d,
969 #define jit_ger_d(u,v,w)        jit_new_node_www(jit_code_ger_d,u,v,w)
970 #define jit_gei_d(u,v,w)        jit_new_node_wwd(jit_code_gei_d,u,v,w)
971     jit_code_ger_d,             jit_code_gei_d,
972 #define jit_gtr_d(u,v,w)        jit_new_node_www(jit_code_gtr_d,u,v,w)
973 #define jit_gti_d(u,v,w)        jit_new_node_wwd(jit_code_gti_d,u,v,w)
974     jit_code_gtr_d,             jit_code_gti_d,
975 #define jit_ner_d(u,v,w)        jit_new_node_www(jit_code_ner_d,u,v,w)
976 #define jit_nei_d(u,v,w)        jit_new_node_wwd(jit_code_nei_d,u,v,w)
977     jit_code_ner_d,             jit_code_nei_d,
978 #define jit_unltr_d(u,v,w)      jit_new_node_www(jit_code_unltr_d,u,v,w)
979 #define jit_unlti_d(u,v,w)      jit_new_node_wwd(jit_code_unlti_d,u,v,w)
980     jit_code_unltr_d,           jit_code_unlti_d,
981 #define jit_unler_d(u,v,w)      jit_new_node_www(jit_code_unler_d,u,v,w)
982 #define jit_unlei_d(u,v,w)      jit_new_node_wwd(jit_code_unlei_d,u,v,w)
983     jit_code_unler_d,           jit_code_unlei_d,
984 #define jit_uneqr_d(u,v,w)      jit_new_node_www(jit_code_uneqr_d,u,v,w)
985 #define jit_uneqi_d(u,v,w)      jit_new_node_wwd(jit_code_uneqi_d,u,v,w)
986     jit_code_uneqr_d,           jit_code_uneqi_d,
987 #define jit_unger_d(u,v,w)      jit_new_node_www(jit_code_unger_d,u,v,w)
988 #define jit_ungei_d(u,v,w)      jit_new_node_wwd(jit_code_ungei_d,u,v,w)
989     jit_code_unger_d,           jit_code_ungei_d,
990 #define jit_ungtr_d(u,v,w)      jit_new_node_www(jit_code_ungtr_d,u,v,w)
991 #define jit_ungti_d(u,v,w)      jit_new_node_wwd(jit_code_ungti_d,u,v,w)
992     jit_code_ungtr_d,           jit_code_ungti_d,
993 #define jit_ltgtr_d(u,v,w)      jit_new_node_www(jit_code_ltgtr_d,u,v,w)
994 #define jit_ltgti_d(u,v,w)      jit_new_node_wwd(jit_code_ltgti_d,u,v,w)
995     jit_code_ltgtr_d,           jit_code_ltgti_d,
996 #define jit_ordr_d(u,v,w)       jit_new_node_www(jit_code_ordr_d,u,v,w)
997 #define jit_ordi_d(u,v,w)       jit_new_node_wwd(jit_code_ordi_d,u,v,w)
998     jit_code_ordr_d,            jit_code_ordi_d,
999 #define jit_unordr_d(u,v,w)     jit_new_node_www(jit_code_unordr_d,u,v,w)
1000 #define jit_unordi_d(u,v,w)     jit_new_node_wwd(jit_code_unordi_d,u,v,w)
1001     jit_code_unordr_d,          jit_code_unordi_d,
1002
1003 #define jit_truncr_d_i(u,v)     jit_new_node_ww(jit_code_truncr_d_i,u,v)
1004     jit_code_truncr_d_i,
1005 #if __WORDSIZE == 32
1006 #  define jit_truncr_d(u,v)     jit_truncr_d_i(u,v)
1007 #else
1008 #  define jit_truncr_d(u,v)     jit_truncr_d_l(u,v)
1009 #  define jit_truncr_d_l(u,v)   jit_new_node_ww(jit_code_truncr_d_l,u,v)
1010 #endif
1011     jit_code_truncr_d_l,
1012 #define jit_extr_d(u,v)         jit_new_node_ww(jit_code_extr_d,u,v)
1013 #define jit_extr_f_d(u,v)       jit_new_node_ww(jit_code_extr_f_d,u,v)
1014     jit_code_extr_d,            jit_code_extr_f_d,
1015 #define jit_movr_d(u,v)         jit_new_node_ww(jit_code_movr_d,u,v)
1016 #define jit_movi_d(u,v)         jit_new_node_wd(jit_code_movi_d,u,v)
1017     jit_code_movr_d,            jit_code_movi_d,
1018
1019 #define jit_ldr_d(u,v)          jit_new_node_ww(jit_code_ldr_d,u,v)
1020 #define jit_ldi_d(u,v)          jit_new_node_wp(jit_code_ldi_d,u,v)
1021     jit_code_ldr_d,             jit_code_ldi_d,
1022 #define jit_ldxr_d(u,v,w)       jit_new_node_www(jit_code_ldxr_d,u,v,w)
1023 #define jit_ldxi_d(u,v,w)       jit_new_node_www(jit_code_ldxi_d,u,v,w)
1024     jit_code_ldxr_d,            jit_code_ldxi_d,
1025 #define jit_str_d(u,v)          jit_new_node_ww(jit_code_str_d,u,v)
1026 #define jit_sti_d(u,v)          jit_new_node_pw(jit_code_sti_d,u,v)
1027     jit_code_str_d,             jit_code_sti_d,
1028 #define jit_stxr_d(u,v,w)       jit_new_node_www(jit_code_stxr_d,u,v,w)
1029 #define jit_stxi_d(u,v,w)       jit_new_node_www(jit_code_stxi_d,u,v,w)
1030     jit_code_stxr_d,            jit_code_stxi_d,
1031
1032 #define jit_bltr_d(v,w)         jit_new_node_pww(jit_code_bltr_d,NULL,v,w)
1033 #define jit_blti_d(v,w)         jit_new_node_pwd(jit_code_blti_d,NULL,v,w)
1034     jit_code_bltr_d,            jit_code_blti_d,
1035 #define jit_bler_d(v,w)         jit_new_node_pww(jit_code_bler_d,NULL,v,w)
1036 #define jit_blei_d(v,w)         jit_new_node_pwd(jit_code_blei_d,NULL,v,w)
1037     jit_code_bler_d,            jit_code_blei_d,
1038 #define jit_beqr_d(v,w)         jit_new_node_pww(jit_code_beqr_d,NULL,v,w)
1039 #define jit_beqi_d(v,w)         jit_new_node_pwd(jit_code_beqi_d,NULL,v,w)
1040     jit_code_beqr_d,            jit_code_beqi_d,
1041 #define jit_bger_d(v,w)         jit_new_node_pww(jit_code_bger_d,NULL,v,w)
1042 #define jit_bgei_d(v,w)         jit_new_node_pwd(jit_code_bgei_d,NULL,v,w)
1043     jit_code_bger_d,            jit_code_bgei_d,
1044 #define jit_bgtr_d(v,w)         jit_new_node_pww(jit_code_bgtr_d,NULL,v,w)
1045 #define jit_bgti_d(v,w)         jit_new_node_pwd(jit_code_bgti_d,NULL,v,w)
1046     jit_code_bgtr_d,            jit_code_bgti_d,
1047 #define jit_bner_d(v,w)         jit_new_node_pww(jit_code_bner_d,NULL,v,w)
1048 #define jit_bnei_d(v,w)         jit_new_node_pwd(jit_code_bnei_d,NULL,v,w)
1049     jit_code_bner_d,            jit_code_bnei_d,
1050 #define jit_bunltr_d(v,w)       jit_new_node_pww(jit_code_bunltr_d,NULL,v,w)
1051 #define jit_bunlti_d(v,w)       jit_new_node_pwd(jit_code_bunlti_d,NULL,v,w)
1052     jit_code_bunltr_d,          jit_code_bunlti_d,
1053 #define jit_bunler_d(v,w)       jit_new_node_pww(jit_code_bunler_d,NULL,v,w)
1054 #define jit_bunlei_d(v,w)       jit_new_node_pwd(jit_code_bunlei_d,NULL,v,w)
1055     jit_code_bunler_d,          jit_code_bunlei_d,
1056 #define jit_buneqr_d(v,w)       jit_new_node_pww(jit_code_buneqr_d,NULL,v,w)
1057 #define jit_buneqi_d(v,w)       jit_new_node_pwd(jit_code_buneqi_d,NULL,v,w)
1058     jit_code_buneqr_d,          jit_code_buneqi_d,
1059 #define jit_bunger_d(v,w)       jit_new_node_pww(jit_code_bunger_d,NULL,v,w)
1060 #define jit_bungei_d(v,w)       jit_new_node_pwd(jit_code_bungei_d,NULL,v,w)
1061     jit_code_bunger_d,          jit_code_bungei_d,
1062 #define jit_bungtr_d(v,w)       jit_new_node_pww(jit_code_bungtr_d,NULL,v,w)
1063 #define jit_bungti_d(v,w)       jit_new_node_pwd(jit_code_bungti_d,NULL,v,w)
1064     jit_code_bungtr_d,          jit_code_bungti_d,
1065 #define jit_bltgtr_d(v,w)       jit_new_node_pww(jit_code_bltgtr_d,NULL,v,w)
1066 #define jit_bltgti_d(v,w)       jit_new_node_pwd(jit_code_bltgti_d,NULL,v,w)
1067     jit_code_bltgtr_d,          jit_code_bltgti_d,
1068 #define jit_bordr_d(v,w)        jit_new_node_pww(jit_code_bordr_d,NULL,v,w)
1069 #define jit_bordi_d(v,w)        jit_new_node_pwd(jit_code_bordi_d,NULL,v,w)
1070     jit_code_bordr_d,           jit_code_bordi_d,
1071 #define jit_bunordr_d(v,w)      jit_new_node_pww(jit_code_bunordr_d,NULL,v,w)
1072 #define jit_bunordi_d(v,w)      jit_new_node_pwd(jit_code_bunordi_d,NULL,v,w)
1073     jit_code_bunordr_d,         jit_code_bunordi_d,
1074
1075 #define jit_pushargr_d(u)       _jit_pushargr_d(_jit,u)
1076 #define jit_pushargi_d(u)       _jit_pushargi_d(_jit,u)
1077     jit_code_pushargr_d,        jit_code_pushargi_d,
1078 #define jit_retr_d(u)           _jit_retr_d(_jit,u)
1079 #define jit_reti_d(u)           _jit_reti_d(_jit,u)
1080     jit_code_retr_d,            jit_code_reti_d,
1081 #define jit_retval_d(u)         _jit_retval_d(_jit,u)
1082     jit_code_retval_d,
1083
1084     /* w* -> f|d */
1085 #define jit_movr_w_f(u, v)      jit_new_node_ww(jit_code_movr_w_f, u, v)
1086 #define jit_movi_w_f(u,v)       jit_new_node_ww(jit_code_movi_w_f, u, v)
1087     jit_code_movr_w_f,          jit_code_movi_w_f,
1088 #define jit_movr_ww_d(u, v, w)  jit_new_node_www(jit_code_movr_ww_d, u, v, w)
1089 #define jit_movi_ww_d(u,v, w)   jit_new_node_www(jit_code_movi_ww_d, u, v, w)
1090     jit_code_movr_ww_d,         jit_code_movi_ww_d,
1091
1092     /* w -> d */
1093 #define jit_movr_w_d(u, v)      jit_new_node_ww(jit_code_movr_w_d, u, v)
1094 #define jit_movi_w_d(u,v)       jit_new_node_ww(jit_code_movi_w_d, u, v)
1095     jit_code_movr_w_d,          jit_code_movi_w_d,
1096
1097     /* f|d -> w* */
1098 #define jit_movr_f_w(u, v)      jit_new_node_ww(jit_code_movr_f_w, u, v)
1099 #define jit_movi_f_w(u, v)      jit_new_node_wf(jit_code_movi_f_w, u, v)
1100     jit_code_movr_f_w,          jit_code_movi_f_w,
1101 #define jit_movr_d_ww(u, v, w)  jit_new_node_www(jit_code_movr_d_ww, u, v, w)
1102 #define jit_movi_d_ww(u, v, w)  jit_new_node_wwd(jit_code_movi_d_ww, u, v, w)
1103     jit_code_movr_d_ww,         jit_code_movi_d_ww,
1104
1105     /* d -> w */
1106 #define jit_movr_d_w(u, v)      jit_new_node_ww(jit_code_movr_d_w, u, v)
1107 #define jit_movi_d_w(u, v)      jit_new_node_wd(jit_code_movi_d_w, u, v)
1108     jit_code_movr_d_w,          jit_code_movi_d_w,
1109
1110 #define jit_clor(u,v)           jit_new_node_ww(jit_code_clor,u,v)
1111 #define jit_cloi(u,v)           jit_new_node_ww(jit_code_cloi,u,v)
1112     jit_code_clor,              jit_code_cloi,
1113
1114 #define jit_clzr(u,v)           jit_new_node_ww(jit_code_clzr,u,v)
1115 #define jit_clzi(u,v)           jit_new_node_ww(jit_code_clzi,u,v)
1116     jit_code_clzr,              jit_code_clzi,
1117
1118 #define jit_ctor(u,v)           jit_new_node_ww(jit_code_ctor,u,v)
1119 #define jit_ctoi(u,v)           jit_new_node_ww(jit_code_ctoi,u,v)
1120     jit_code_ctor,              jit_code_ctoi,
1121 #define jit_ctzr(u,v)           jit_new_node_ww(jit_code_ctzr,u,v)
1122 #define jit_ctzi(u,v)           jit_new_node_ww(jit_code_ctzi,u,v)
1123     jit_code_ctzr,              jit_code_ctzi,
1124
1125 #define jit_rbitr(u,v)          jit_new_node_ww(jit_code_rbitr,u,v)
1126 #define jit_rbiti(u,v)          jit_new_node_ww(jit_code_rbiti,u,v)
1127     jit_code_rbitr,             jit_code_rbiti,
1128
1129 #define jit_popcntr(u,v)        jit_new_node_ww(jit_code_popcntr,u,v)
1130 #define jit_popcnti(u,v)        jit_new_node_ww(jit_code_popcnti,u,v)
1131     jit_code_popcntr,           jit_code_popcnti,
1132
1133 #define jit_lrotr(u,v,w)        jit_new_node_www(jit_code_lrotr,u,v,w)
1134 #define jit_lroti(u,v,w)        jit_new_node_www(jit_code_lroti,u,v,w)
1135     jit_code_lrotr,             jit_code_lroti,
1136 #define jit_rrotr(u,v,w)        jit_new_node_www(jit_code_rrotr,u,v,w)
1137 #define jit_rroti(u,v,w)        jit_new_node_www(jit_code_rroti,u,v,w)
1138     jit_code_rrotr,             jit_code_rroti,
1139
1140 #define jit_extr(u,v,w,x)       jit_new_node_wwq(jit_code_extr, u, v, w, x)
1141 #define jit_exti(u,v,w,x)       jit_new_node_wwq(jit_code_exti, u, v, w, x)
1142     jit_code_extr,              jit_code_exti,
1143 #define jit_extr_u(u,v,w,x)     jit_new_node_wwq(jit_code_extr_u, u, v, w, x)
1144 #define jit_exti_u(u,v,w,x)     jit_new_node_wwq(jit_code_exti_u, u, v, w, x)
1145     jit_code_extr_u,            jit_code_exti_u,
1146 #define jit_depr(u,v,w,x)       jit_new_node_wwq(jit_code_depr, u, v, w, x)
1147 #define jit_depi(u,v,w,x)       jit_new_node_wwq(jit_code_depi, u, v, w, x)
1148     jit_code_depr,              jit_code_depi,
1149
1150 #define jit_qlshr(l,h,v,w)      jit_new_node_qww(jit_code_qlshr,l,h,v,w)
1151 #define jit_qlshi(l,h,v,w)      jit_new_node_qww(jit_code_qlshi,l,h,v,w)
1152     jit_code_qlshr,             jit_code_qlshi,
1153 #define jit_qlshr_u(l,h,v,w)    jit_new_node_qww(jit_code_qlshr_u,l,h,v,w)
1154 #define jit_qlshi_u(l,h,v,w)    jit_new_node_qww(jit_code_qlshi_u,l,h,v,w)
1155     jit_code_qlshr_u,           jit_code_qlshi_u,
1156 #define jit_qrshr(l,h,v,w)      jit_new_node_qww(jit_code_qrshr,l,h,v,w)
1157 #define jit_qrshi(l,h,v,w)      jit_new_node_qww(jit_code_qrshi,l,h,v,w)
1158     jit_code_qrshr,             jit_code_qrshi,
1159 #define jit_qrshr_u(l,h,v,w)    jit_new_node_qww(jit_code_qrshr_u,l,h,v,w)
1160 #define jit_qrshi_u(l,h,v,w)    jit_new_node_qww(jit_code_qrshi_u,l,h,v,w)
1161     jit_code_qrshr_u,           jit_code_qrshi_u,
1162
1163 #define jit_unldr(u,v,w)        jit_new_node_www(jit_code_unldr, u, v, w)
1164 #define jit_unldi(u,v,w)        jit_new_node_www(jit_code_unldi, u, v, w)
1165     jit_code_unldr,             jit_code_unldi,
1166 #define jit_unldr_u(u,v,w)      jit_new_node_www(jit_code_unldr_u, u, v, w)
1167 #define jit_unldi_u(u,v,w)      jit_new_node_www(jit_code_unldi_u, u, v, w)
1168     jit_code_unldr_u,           jit_code_unldi_u,
1169 #define jit_unstr(u,v,w)        jit_new_node_www(jit_code_unstr, u, v, w)
1170 #define jit_unsti(u,v,w)        jit_new_node_www(jit_code_unsti, u, v, w)
1171     jit_code_unstr,             jit_code_unsti,
1172
1173 #define jit_unldr_x(u,v,w)      jit_new_node_www(jit_code_unldr_x, u, v, w)
1174 #define jit_unldi_x(u,v,w)      jit_new_node_www(jit_code_unldi_x, u, v, w)
1175     jit_code_unldr_x,           jit_code_unldi_x,
1176 #define jit_unstr_x(u,v,w)      jit_new_node_www(jit_code_unstr_x, u, v, w)
1177 #define jit_unsti_x(u,v,w)      jit_new_node_www(jit_code_unsti_x, u, v, w)
1178     jit_code_unstr_x,           jit_code_unsti_x,
1179
1180 #define jit_fmar_f(u,v,w,x)     jit_new_node_wqw(jit_code_fmar_f, u, v, w, x)
1181 #define jit_fmai_f(u,v,w,x)     _jit_fmai_f(_jit, u, v, w, x)
1182     jit_code_fmar_f,            jit_code_fmai_f,
1183 #define jit_fmsr_f(u,v,w,x)     jit_new_node_wqw(jit_code_fmsr_f, u, v, w, x)
1184 #define jit_fmsi_f(u,v,w,x)     _jit_fmsi_f(_jit, u, v, w, x)
1185     jit_code_fmsr_f,            jit_code_fmsi_f,
1186 #define jit_fmar_d(u,v,w,x)     jit_new_node_wqw(jit_code_fmar_d, u, v, w, x)
1187 #define jit_fmai_d(u,v,w,x)     _jit_fmai_d(_jit, u, v, w, x)
1188     jit_code_fmar_d,            jit_code_fmai_d,
1189 #define jit_fmsr_d(u,v,w,x)     jit_new_node_wqw(jit_code_fmsr_d, u, v, w, x)
1190 #define jit_fmsi_d(u,v,w,x)     _jit_fmsi_d(_jit, u, v, w, x)
1191     jit_code_fmsr_d,            jit_code_fmsi_d,
1192
1193 #define jit_fnmar_f(u,v,w,x)    jit_new_node_wqw(jit_code_fnmar_f, u, v, w, x)
1194 #define jit_fnmai_f(u,v,w,x)    _jit_fnmai_f(_jit, u, v, w, x)
1195     jit_code_fnmar_f,           jit_code_fnmai_f,
1196 #define jit_fnmsr_f(u,v,w,x)    jit_new_node_wqw(jit_code_fnmsr_f, u, v, w, x)
1197 #define jit_fnmsi_f(u,v,w,x)    _jit_fnmsi_f(_jit, u, v, w, x)
1198     jit_code_fnmsr_f,           jit_code_fnmsi_f,
1199 #define jit_fnmar_d(u,v,w,x)    jit_new_node_wqw(jit_code_fnmar_d, u, v, w, x)
1200 #define jit_fnmai_d(u,v,w,x)    _jit_fnmai_d(_jit, u, v, w, x)
1201     jit_code_fnmar_d,           jit_code_fnmai_d,
1202 #define jit_fnmsr_d(u,v,w,x)    jit_new_node_wqw(jit_code_fnmsr_d, u, v, w, x)
1203 #define jit_fnmsi_d(u,v,w,x)    _jit_fnmsi_d(_jit, u, v, w, x)
1204     jit_code_fnmsr_d,           jit_code_fnmsi_d,
1205
1206 #define jit_hmulr(u,v,w)        jit_new_node_www(jit_code_hmulr,u,v,w)
1207 #define jit_hmuli(u,v,w)        jit_new_node_www(jit_code_hmuli,u,v,w)
1208     jit_code_hmulr,             jit_code_hmuli,
1209 #define jit_hmulr_u(u,v,w)      jit_new_node_www(jit_code_hmulr_u,u,v,w)
1210 #define jit_hmuli_u(u,v,w)      jit_new_node_www(jit_code_hmuli_u,u,v,w)
1211     jit_code_hmulr_u,           jit_code_hmuli_u,
1212
1213     jit_code_last_code
1214 } jit_code_t;
1215
1216 typedef void* (*jit_alloc_func_ptr)     (size_t);
1217 typedef void* (*jit_realloc_func_ptr)   (void*, size_t);
1218 typedef void  (*jit_free_func_ptr)      (void*);
1219
1220 /*
1221  * Prototypes
1222  */
1223 extern void init_jit(const char*);
1224 extern void finish_jit(void);
1225
1226 extern jit_state_t *jit_new_state(void);
1227 #define jit_clear_state()       _jit_clear_state(_jit)
1228 extern void _jit_clear_state(jit_state_t*);
1229 #define jit_destroy_state()     _jit_destroy_state(_jit)
1230 extern void _jit_destroy_state(jit_state_t*);
1231
1232 #define jit_address(node)       _jit_address(_jit, node)
1233 extern jit_pointer_t _jit_address(jit_state_t*, jit_node_t*);
1234 extern jit_node_t *_jit_name(jit_state_t*, const char*);
1235 extern jit_node_t *_jit_note(jit_state_t*, const char*, int);
1236 extern jit_node_t *_jit_label(jit_state_t*);
1237 extern jit_node_t *_jit_forward(jit_state_t*);
1238 extern jit_node_t *_jit_indirect(jit_state_t*);
1239 extern void _jit_link(jit_state_t*, jit_node_t*);
1240 #define jit_forward_p(u)        _jit_forward_p(_jit,u)
1241 extern jit_bool_t _jit_forward_p(jit_state_t*,jit_node_t*);
1242 #define jit_indirect_p(u)       _jit_indirect_p(_jit,u)
1243 extern jit_bool_t _jit_indirect_p(jit_state_t*,jit_node_t*);
1244 #define jit_target_p(u)         _jit_target_p(_jit,u)
1245 extern jit_bool_t _jit_target_p(jit_state_t*,jit_node_t*);
1246
1247 extern void _jit_prolog(jit_state_t*);
1248
1249 extern jit_int32_t _jit_allocai(jit_state_t*, jit_int32_t);
1250 extern void _jit_allocar(jit_state_t*, jit_int32_t, jit_int32_t);
1251 extern void _jit_ellipsis(jit_state_t*);
1252
1253 extern jit_node_t *_jit_arg(jit_state_t*, jit_code_t);
1254
1255 extern void _jit_getarg_c(jit_state_t*, jit_gpr_t, jit_node_t*);
1256 extern void _jit_getarg_uc(jit_state_t*, jit_gpr_t, jit_node_t*);
1257 extern void _jit_getarg_s(jit_state_t*, jit_gpr_t, jit_node_t*);
1258 extern void _jit_getarg_us(jit_state_t*, jit_gpr_t, jit_node_t*);
1259 extern void _jit_getarg_i(jit_state_t*, jit_gpr_t, jit_node_t*);
1260 #if __WORDSIZE == 64
1261 extern void _jit_getarg_ui(jit_state_t*, jit_gpr_t, jit_node_t*);
1262 extern void _jit_getarg_l(jit_state_t*, jit_gpr_t, jit_node_t*);
1263 #endif
1264
1265 extern void _jit_putargr(jit_state_t*, jit_gpr_t, jit_node_t*, jit_code_t);
1266 extern void _jit_putargi(jit_state_t*, jit_word_t, jit_node_t*, jit_code_t);
1267
1268 extern void _jit_prepare(jit_state_t*);
1269 extern void _jit_ellipsis(jit_state_t*);
1270 extern void _jit_va_push(jit_state_t*, jit_gpr_t);
1271
1272 extern void _jit_pushargr(jit_state_t*, jit_gpr_t, jit_code_t);
1273 extern void _jit_pushargi(jit_state_t*, jit_word_t, jit_code_t);
1274
1275 extern void _jit_finishr(jit_state_t*, jit_gpr_t);
1276 extern jit_node_t *_jit_finishi(jit_state_t*, jit_pointer_t);
1277 extern void _jit_ret(jit_state_t*);
1278
1279 extern void _jit_retr(jit_state_t*, jit_gpr_t, jit_code_t);
1280 extern void _jit_reti(jit_state_t*, jit_word_t, jit_code_t);
1281
1282 extern void _jit_retval_c(jit_state_t*, jit_gpr_t);
1283 extern void _jit_retval_uc(jit_state_t*, jit_gpr_t);
1284 extern void _jit_retval_s(jit_state_t*, jit_gpr_t);
1285 extern void _jit_retval_us(jit_state_t*, jit_gpr_t);
1286 extern void _jit_retval_i(jit_state_t*, jit_gpr_t);
1287 #if __WORDSIZE == 64
1288 extern void _jit_retval_ui(jit_state_t*, jit_gpr_t);
1289 extern void _jit_retval_l(jit_state_t*, jit_gpr_t);
1290 #endif
1291
1292 extern void _jit_epilog(jit_state_t*);
1293
1294 #define jit_patch(u)            _jit_patch(_jit,u)
1295 extern void _jit_patch(jit_state_t*, jit_node_t*);
1296 #define jit_patch_at(u,v)       _jit_patch_at(_jit,u,v)
1297 extern void _jit_patch_at(jit_state_t*, jit_node_t*, jit_node_t*);
1298 #define jit_patch_abs(u,v)      _jit_patch_abs(_jit,u,v)
1299 extern void _jit_patch_abs(jit_state_t*, jit_node_t*, jit_pointer_t);
1300 #define jit_realize()           _jit_realize(_jit)
1301 extern void _jit_realize(jit_state_t*);
1302 #define jit_get_code(u)         _jit_get_code(_jit,u)
1303 extern jit_pointer_t _jit_get_code(jit_state_t*, jit_word_t*);
1304 #define jit_set_code(u,v)       _jit_set_code(_jit,u,v)
1305 extern void _jit_set_code(jit_state_t*, jit_pointer_t, jit_word_t);
1306 #define jit_get_data(u,v)       _jit_get_data(_jit,u,v)
1307 extern jit_pointer_t _jit_get_data(jit_state_t*, jit_word_t*, jit_word_t*);
1308 #define jit_set_data(u,v,w)     _jit_set_data(_jit,u,v,w)
1309 extern void _jit_set_data(jit_state_t*, jit_pointer_t, jit_word_t, jit_word_t);
1310 #define jit_frame(u)            _jit_frame(_jit,u)
1311 extern void _jit_frame(jit_state_t*, jit_int32_t);
1312 #define jit_tramp(u)            _jit_tramp(_jit,u)
1313 extern void _jit_tramp(jit_state_t*, jit_int32_t);
1314 #define jit_emit()              _jit_emit(_jit)
1315 extern jit_pointer_t _jit_emit(jit_state_t*);
1316 #define jit_unprotect()         _jit_unprotect(_jit)
1317 extern void _jit_unprotect(jit_state_t*);
1318 #define jit_protect()           _jit_protect(_jit)
1319 extern void _jit_protect(jit_state_t*);
1320
1321 #define jit_print()             _jit_print(_jit)
1322 extern void _jit_print(jit_state_t*);
1323
1324 extern jit_node_t *_jit_arg_f(jit_state_t*);
1325 extern void _jit_getarg_f(jit_state_t*, jit_fpr_t, jit_node_t*);
1326 extern void _jit_putargr_f(jit_state_t*, jit_fpr_t, jit_node_t*);
1327 extern void _jit_putargi_f(jit_state_t*, jit_float32_t, jit_node_t*);
1328 extern void _jit_pushargr_f(jit_state_t*, jit_fpr_t);
1329 extern void _jit_pushargi_f(jit_state_t*, jit_float32_t);
1330 extern void _jit_retr_f(jit_state_t*, jit_fpr_t);
1331 extern void _jit_reti_f(jit_state_t*, jit_float32_t);
1332 extern void _jit_retval_f(jit_state_t*, jit_fpr_t);
1333 extern void _jit_negi_f(jit_state_t*, jit_fpr_t, jit_float32_t);
1334 extern void _jit_absi_f(jit_state_t*, jit_fpr_t, jit_float32_t);
1335 extern void _jit_sqrti_f(jit_state_t*, jit_fpr_t, jit_float32_t);
1336 extern void _jit_fmai_f(jit_state_t*,
1337                         jit_fpr_t, jit_fpr_t, jit_fpr_t, jit_float32_t);
1338 extern void _jit_fmsi_f(jit_state_t*,
1339                         jit_fpr_t, jit_fpr_t, jit_fpr_t, jit_float32_t);
1340 extern void _jit_fnmai_f(jit_state_t*,
1341                          jit_fpr_t, jit_fpr_t, jit_fpr_t, jit_float32_t);
1342 extern void _jit_fnmsi_f(jit_state_t*,
1343                          jit_fpr_t, jit_fpr_t, jit_fpr_t, jit_float32_t);
1344
1345 extern jit_node_t *_jit_arg_d(jit_state_t*);
1346 extern void _jit_getarg_d(jit_state_t*, jit_fpr_t, jit_node_t*);
1347 extern void _jit_putargr_d(jit_state_t*, jit_fpr_t, jit_node_t*);
1348 extern void _jit_putargi_d(jit_state_t*, jit_float64_t, jit_node_t*);
1349 extern void _jit_pushargr_d(jit_state_t*, jit_fpr_t);
1350 extern void _jit_pushargi_d(jit_state_t*, jit_float64_t);
1351 extern void _jit_retr_d(jit_state_t*, jit_fpr_t);
1352 extern void _jit_reti_d(jit_state_t*, jit_float64_t);
1353 extern void _jit_retval_d(jit_state_t*, jit_fpr_t);
1354 extern void _jit_negi_d(jit_state_t*, jit_fpr_t, jit_float64_t);
1355 extern void _jit_absi_d(jit_state_t*, jit_fpr_t, jit_float64_t);
1356 extern void _jit_sqrti_d(jit_state_t*, jit_fpr_t, jit_float64_t);
1357 extern void _jit_fmai_d(jit_state_t*,
1358                         jit_fpr_t, jit_fpr_t, jit_fpr_t, jit_float64_t);
1359 extern void _jit_fmsi_d(jit_state_t*,
1360                         jit_fpr_t, jit_fpr_t, jit_fpr_t, jit_float64_t);
1361 extern void _jit_fnmai_d(jit_state_t*,
1362                          jit_fpr_t, jit_fpr_t, jit_fpr_t, jit_float64_t);
1363 extern void _jit_fnmsi_d(jit_state_t*,
1364                          jit_fpr_t, jit_fpr_t, jit_fpr_t, jit_float64_t);
1365
1366 #define jit_get_reg(s)          _jit_get_reg(_jit,s)
1367 extern jit_int32_t _jit_get_reg(jit_state_t*, jit_int32_t);
1368
1369 #define jit_unget_reg(r)        _jit_unget_reg(_jit,r)
1370 extern void _jit_unget_reg(jit_state_t*, jit_int32_t);
1371
1372 #define jit_new_node(c)         _jit_new_node(_jit,c)
1373 extern jit_node_t *_jit_new_node(jit_state_t*, jit_code_t);
1374 #define jit_new_node_w(c,u)     _jit_new_node_w(_jit,c,u)
1375 extern jit_node_t *_jit_new_node_w(jit_state_t*, jit_code_t,
1376                                    jit_word_t);
1377 #define jit_new_node_f(c,u)     _jit_new_node_f(_jit,c,u)
1378 extern jit_node_t *_jit_new_node_f(jit_state_t*, jit_code_t,
1379                                    jit_float32_t);
1380 #define jit_new_node_d(c,u)     _jit_new_node_d(_jit,c,u)
1381 extern jit_node_t *_jit_new_node_d(jit_state_t*, jit_code_t,
1382                                    jit_float64_t);
1383 #define jit_new_node_p(c,u)     _jit_new_node_p(_jit,c,u)
1384 extern jit_node_t *_jit_new_node_p(jit_state_t*, jit_code_t,
1385                                    jit_pointer_t);
1386 #define jit_new_node_ww(c,u,v)  _jit_new_node_ww(_jit,c,u,v)
1387 extern jit_node_t *_jit_new_node_ww(jit_state_t*,jit_code_t,
1388                                     jit_word_t, jit_word_t);
1389 #define jit_new_node_wp(c,u,v)  _jit_new_node_wp(_jit,c,u,v)
1390 extern jit_node_t *_jit_new_node_wp(jit_state_t*,jit_code_t,
1391                                     jit_word_t, jit_pointer_t);
1392 #define jit_new_node_fp(c,u,v)  _jit_new_node_fp(_jit,c,u,v)
1393 extern jit_node_t *_jit_new_node_fp(jit_state_t*,jit_code_t,
1394                                     jit_float32_t, jit_pointer_t);
1395 #define jit_new_node_dp(c,u,v)  _jit_new_node_dp(_jit,c,u,v)
1396 extern jit_node_t *_jit_new_node_dp(jit_state_t*,jit_code_t,
1397                                     jit_float64_t, jit_pointer_t);
1398 #define jit_new_node_pw(c,u,v)  _jit_new_node_pw(_jit,c,u,v)
1399 extern jit_node_t *_jit_new_node_pw(jit_state_t*,jit_code_t,
1400                                     jit_pointer_t, jit_word_t);
1401 #define jit_new_node_wf(c,u,v)  _jit_new_node_wf(_jit,c,u,v)
1402 extern jit_node_t *_jit_new_node_wf(jit_state_t*, jit_code_t,
1403                                     jit_word_t, jit_float32_t);
1404 #define jit_new_node_wd(c,u,v)  _jit_new_node_wd(_jit,c,u,v)
1405 extern jit_node_t *_jit_new_node_wd(jit_state_t*, jit_code_t,
1406                                     jit_word_t, jit_float64_t);
1407 #define jit_new_node_www(c,u,v,w) _jit_new_node_www(_jit,c,u,v,w)
1408 extern jit_node_t *_jit_new_node_www(jit_state_t*, jit_code_t,
1409                                      jit_word_t, jit_word_t, jit_word_t);
1410 #define jit_new_node_qww(c,l,h,v,w) _jit_new_node_qww(_jit,c,l,h,v,w)
1411 extern jit_node_t *_jit_new_node_qww(jit_state_t*, jit_code_t,
1412                                      jit_int32_t, jit_int32_t,
1413                                      jit_word_t, jit_word_t);
1414 #define jit_new_node_wqw(c,u,l,h,w) _jit_new_node_wqw(_jit,c,u,l,h,w)
1415 extern jit_node_t *_jit_new_node_wqw(jit_state_t*, jit_code_t,
1416                                      jit_word_t, jit_int32_t,
1417                                      jit_int32_t, jit_word_t);
1418 #define jit_new_node_wwq(c,u,v,l,h) _jit_new_node_wwq(_jit,c,u,v,l,h)
1419 extern jit_node_t *_jit_new_node_wwq(jit_state_t*, jit_code_t,
1420                                      jit_word_t, jit_word_t,
1421                                      jit_int32_t, jit_int32_t);
1422 #define jit_new_node_wwf(c,u,v,w) _jit_new_node_wwf(_jit,c,u,v,w)
1423 extern jit_node_t *_jit_new_node_wwf(jit_state_t*, jit_code_t,
1424                                      jit_word_t, jit_word_t, jit_float32_t);
1425 #define jit_new_node_wqf(c,u,l,h,w) _jit_new_node_wqf(_jit,c,u,l,h,w)
1426 extern jit_node_t *_jit_new_node_wqf(jit_state_t*, jit_code_t,
1427                                      jit_word_t, jit_int32_t,
1428                                      jit_int32_t, jit_float32_t);
1429 #define jit_new_node_wwd(c,u,v,w) _jit_new_node_wwd(_jit,c,u,v,w)
1430 extern jit_node_t *_jit_new_node_wwd(jit_state_t*, jit_code_t,
1431                                      jit_word_t, jit_word_t, jit_float64_t);
1432 #define jit_new_node_wqd(c,u,l,h,w) _jit_new_node_wqd(_jit,c,u,l,h,w)
1433 extern jit_node_t *_jit_new_node_wqd(jit_state_t*, jit_code_t,
1434                                      jit_word_t, jit_int32_t,
1435                                      jit_int32_t, jit_float64_t);
1436 #define jit_new_node_pww(c,u,v,w) _jit_new_node_pww(_jit,c,u,v,w)
1437 extern jit_node_t *_jit_new_node_pww(jit_state_t*, jit_code_t,
1438                                      jit_pointer_t, jit_word_t, jit_word_t);
1439 #define jit_new_node_pwf(c,u,v,w) _jit_new_node_pwf(_jit,c,u,v,w)
1440 extern jit_node_t *_jit_new_node_pwf(jit_state_t*, jit_code_t,
1441                                      jit_pointer_t, jit_word_t, jit_float32_t);
1442 #define jit_new_node_pwd(c,u,v,w) _jit_new_node_pwd(_jit,c,u,v,w)
1443 extern jit_node_t *_jit_new_node_pwd(jit_state_t*, jit_code_t,
1444                                      jit_pointer_t, jit_word_t, jit_float64_t);
1445
1446 #define jit_arg_register_p(u)           _jit_arg_register_p(_jit,u)
1447 extern jit_bool_t _jit_arg_register_p(jit_state_t*, jit_node_t*);
1448 #define jit_callee_save_p(u)            _jit_callee_save_p(_jit,u)
1449 extern jit_bool_t _jit_callee_save_p(jit_state_t*, jit_int32_t);
1450 #define jit_pointer_p(u)                _jit_pointer_p(_jit,u)
1451 extern jit_bool_t _jit_pointer_p(jit_state_t*,jit_pointer_t);
1452
1453 #define jit_get_note(n,u,v,w)   _jit_get_note(_jit,n,u,v,w)
1454 extern jit_bool_t _jit_get_note(jit_state_t*,jit_pointer_t,char**,char**,int*);
1455
1456 #define jit_disassemble()               _jit_disassemble(_jit)
1457 extern void _jit_disassemble(jit_state_t*);
1458
1459 extern void jit_set_memory_functions(jit_alloc_func_ptr,
1460                                      jit_realloc_func_ptr,
1461                                      jit_free_func_ptr);
1462 extern void jit_get_memory_functions(jit_alloc_func_ptr*,
1463                                      jit_realloc_func_ptr*,
1464                                      jit_free_func_ptr*);
1465 #endif /* _lightning_h */