| 1 | /* |
| 2 | * Copyright (C) 2012-2019 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 | #endif |
| 155 | |
| 156 | #define jit_flag_node 0x0001 /* patch node not absolute */ |
| 157 | #define jit_flag_patch 0x0002 /* jump already patched */ |
| 158 | #define jit_flag_data 0x0004 /* data in the constant pool */ |
| 159 | #define jit_flag_use 0x0008 /* do not remove marker label */ |
| 160 | #define jit_flag_synth 0x0010 /* synthesized instruction */ |
| 161 | #define jit_flag_head 0x1000 /* label reached by normal flow */ |
| 162 | #define jit_flag_varargs 0x2000 /* call{r,i} to varargs function */ |
| 163 | |
| 164 | #define JIT_R(index) jit_r(index) |
| 165 | #define JIT_V(index) jit_v(index) |
| 166 | #define JIT_F(index) jit_f(index) |
| 167 | #define JIT_R_NUM jit_r_num() |
| 168 | #define JIT_V_NUM jit_v_num() |
| 169 | #define JIT_F_NUM jit_f_num() |
| 170 | |
| 171 | #define JIT_DISABLE_DATA 1 /* force synthesize of constants */ |
| 172 | #define JIT_DISABLE_NOTE 2 /* disable debug info generation */ |
| 173 | |
| 174 | #define jit_class_chk 0x02000000 /* just checking */ |
| 175 | #define jit_class_arg 0x08000000 /* argument register */ |
| 176 | #define jit_class_sav 0x10000000 /* callee save */ |
| 177 | #define jit_class_gpr 0x20000000 /* general purpose */ |
| 178 | #define jit_class_fpr 0x40000000 /* float */ |
| 179 | #define jit_class(reg) ((reg) & 0xffff0000) |
| 180 | #define jit_regno(reg) ((reg) & 0x00007fff) |
| 181 | |
| 182 | typedef struct jit_node jit_node_t; |
| 183 | typedef struct jit_state jit_state_t; |
| 184 | |
| 185 | typedef enum { |
| 186 | jit_code_data, |
| 187 | #define jit_live(u) jit_new_node_w(jit_code_live, u) |
| 188 | #define jit_align(u) jit_new_node_w(jit_code_align, u) |
| 189 | jit_code_live, jit_code_align, |
| 190 | jit_code_save, jit_code_load, |
| 191 | #define jit_name(u) _jit_name(_jit,u) |
| 192 | jit_code_name, |
| 193 | #define jit_note(u, v) _jit_note(_jit, u, v) |
| 194 | #define jit_label() _jit_label(_jit) |
| 195 | #define jit_forward() _jit_forward(_jit) |
| 196 | #define jit_indirect() _jit_indirect(_jit) |
| 197 | #define jit_link(u) _jit_link(_jit,u) |
| 198 | jit_code_note, jit_code_label, |
| 199 | |
| 200 | #define jit_prolog() _jit_prolog(_jit) |
| 201 | jit_code_prolog, |
| 202 | |
| 203 | #define jit_ellipsis() _jit_ellipsis(_jit) |
| 204 | jit_code_ellipsis, |
| 205 | #define jit_va_push(u) _jit_va_push(_jit,u) |
| 206 | jit_code_va_push, |
| 207 | #define jit_allocai(u) _jit_allocai(_jit,u) |
| 208 | #define jit_allocar(u, v) _jit_allocar(_jit,u,v) |
| 209 | jit_code_allocai, jit_code_allocar, |
| 210 | |
| 211 | #define jit_arg() _jit_arg(_jit) |
| 212 | jit_code_arg, |
| 213 | #define jit_getarg_c(u,v) _jit_getarg_c(_jit,u,v) |
| 214 | #define jit_getarg_uc(u,v) _jit_getarg_uc(_jit,u,v) |
| 215 | jit_code_getarg_c, jit_code_getarg_uc, |
| 216 | #define jit_getarg_s(u,v) _jit_getarg_s(_jit,u,v) |
| 217 | #define jit_getarg_us(u,v) _jit_getarg_us(_jit,u,v) |
| 218 | jit_code_getarg_s, jit_code_getarg_us, |
| 219 | #define jit_getarg_i(u,v) _jit_getarg_i(_jit,u,v) |
| 220 | #if __WORDSIZE == 32 |
| 221 | # define jit_getarg(u,v) jit_getarg_i(u,v) |
| 222 | #else |
| 223 | # define jit_getarg(u,v) jit_getarg_l(u,v) |
| 224 | # define jit_getarg_ui(u,v) _jit_getarg_ui(_jit,u,v) |
| 225 | # define jit_getarg_l(u,v) _jit_getarg_l(_jit,u,v) |
| 226 | #endif |
| 227 | jit_code_getarg_i, jit_code_getarg_ui, |
| 228 | jit_code_getarg_l, |
| 229 | # define jit_putargr(u,v) _jit_putargr(_jit,u,v) |
| 230 | # define jit_putargi(u,v) _jit_putargi(_jit,u,v) |
| 231 | jit_code_putargr, jit_code_putargi, |
| 232 | |
| 233 | #define jit_va_start(u) jit_new_node_w(jit_code_va_start, u) |
| 234 | jit_code_va_start, |
| 235 | #define jit_va_arg(u, v) jit_new_node_ww(jit_code_va_arg, u, v) |
| 236 | #define jit_va_arg_d(u, v) jit_new_node_ww(jit_code_va_arg_d, u, v) |
| 237 | jit_code_va_arg, jit_code_va_arg_d, |
| 238 | #define jit_va_end(u) jit_new_node_w(jit_code_va_end, u) |
| 239 | jit_code_va_end, |
| 240 | |
| 241 | #define jit_addr(u,v,w) jit_new_node_www(jit_code_addr,u,v,w) |
| 242 | #define jit_addi(u,v,w) jit_new_node_www(jit_code_addi,u,v,w) |
| 243 | jit_code_addr, jit_code_addi, |
| 244 | #define jit_addcr(u,v,w) jit_new_node_www(jit_code_addcr,u,v,w) |
| 245 | #define jit_addci(u,v,w) jit_new_node_www(jit_code_addci,u,v,w) |
| 246 | jit_code_addcr, jit_code_addci, |
| 247 | #define jit_addxr(u,v,w) jit_new_node_www(jit_code_addxr,u,v,w) |
| 248 | #define jit_addxi(u,v,w) jit_new_node_www(jit_code_addxi,u,v,w) |
| 249 | jit_code_addxr, jit_code_addxi, |
| 250 | #define jit_subr(u,v,w) jit_new_node_www(jit_code_subr,u,v,w) |
| 251 | #define jit_subi(u,v,w) jit_new_node_www(jit_code_subi,u,v,w) |
| 252 | jit_code_subr, jit_code_subi, |
| 253 | #define jit_subcr(u,v,w) jit_new_node_www(jit_code_subcr,u,v,w) |
| 254 | #define jit_subci(u,v,w) jit_new_node_www(jit_code_subci,u,v,w) |
| 255 | jit_code_subcr, jit_code_subci, |
| 256 | #define jit_subxr(u,v,w) jit_new_node_www(jit_code_subxr,u,v,w) |
| 257 | #define jit_subxi(u,v,w) jit_new_node_www(jit_code_subxi,u,v,w) |
| 258 | jit_code_subxr, jit_code_subxi, |
| 259 | #define jit_rsbr(u,v,w) jit_subr(u,w,v) |
| 260 | #define jit_rsbi(u,v,w) jit_new_node_www(jit_code_rsbi,u,v,w) |
| 261 | jit_code_rsbi, |
| 262 | #define jit_mulr(u,v,w) jit_new_node_www(jit_code_mulr,u,v,w) |
| 263 | #define jit_muli(u,v,w) jit_new_node_www(jit_code_muli,u,v,w) |
| 264 | jit_code_mulr, jit_code_muli, |
| 265 | #define jit_qmulr(l,h,v,w) jit_new_node_qww(jit_code_qmulr,l,h,v,w) |
| 266 | #define jit_qmuli(l,h,v,w) jit_new_node_qww(jit_code_qmuli,l,h,v,w) |
| 267 | jit_code_qmulr, jit_code_qmuli, |
| 268 | #define jit_qmulr_u(l,h,v,w) jit_new_node_qww(jit_code_qmulr_u,l,h,v,w) |
| 269 | #define jit_qmuli_u(l,h,v,w) jit_new_node_qww(jit_code_qmuli_u,l,h,v,w) |
| 270 | jit_code_qmulr_u, jit_code_qmuli_u, |
| 271 | #define jit_divr(u,v,w) jit_new_node_www(jit_code_divr,u,v,w) |
| 272 | #define jit_divi(u,v,w) jit_new_node_www(jit_code_divi,u,v,w) |
| 273 | jit_code_divr, jit_code_divi, |
| 274 | #define jit_divr_u(u,v,w) jit_new_node_www(jit_code_divr_u,u,v,w) |
| 275 | #define jit_divi_u(u,v,w) jit_new_node_www(jit_code_divi_u,u,v,w) |
| 276 | jit_code_divr_u, jit_code_divi_u, |
| 277 | #define jit_qdivr(l,h,v,w) jit_new_node_qww(jit_code_qdivr,l,h,v,w) |
| 278 | #define jit_qdivi(l,h,v,w) jit_new_node_qww(jit_code_qdivi,l,h,v,w) |
| 279 | jit_code_qdivr, jit_code_qdivi, |
| 280 | #define jit_qdivr_u(l,h,v,w) jit_new_node_qww(jit_code_qdivr_u,l,h,v,w) |
| 281 | #define jit_qdivi_u(l,h,v,w) jit_new_node_qww(jit_code_qdivi_u,l,h,v,w) |
| 282 | jit_code_qdivr_u, jit_code_qdivi_u, |
| 283 | #define jit_remr(u,v,w) jit_new_node_www(jit_code_remr,u,v,w) |
| 284 | #define jit_remi(u,v,w) jit_new_node_www(jit_code_remi,u,v,w) |
| 285 | jit_code_remr, jit_code_remi, |
| 286 | #define jit_remr_u(u,v,w) jit_new_node_www(jit_code_remr_u,u,v,w) |
| 287 | #define jit_remi_u(u,v,w) jit_new_node_www(jit_code_remi_u,u,v,w) |
| 288 | jit_code_remr_u, jit_code_remi_u, |
| 289 | |
| 290 | #define jit_andr(u,v,w) jit_new_node_www(jit_code_andr,u,v,w) |
| 291 | #define jit_andi(u,v,w) jit_new_node_www(jit_code_andi,u,v,w) |
| 292 | jit_code_andr, jit_code_andi, |
| 293 | #define jit_orr(u,v,w) jit_new_node_www(jit_code_orr,u,v,w) |
| 294 | #define jit_ori(u,v,w) jit_new_node_www(jit_code_ori,u,v,w) |
| 295 | jit_code_orr, jit_code_ori, |
| 296 | #define jit_xorr(u,v,w) jit_new_node_www(jit_code_xorr,u,v,w) |
| 297 | #define jit_xori(u,v,w) jit_new_node_www(jit_code_xori,u,v,w) |
| 298 | jit_code_xorr, jit_code_xori, |
| 299 | |
| 300 | #define jit_lshr(u,v,w) jit_new_node_www(jit_code_lshr,u,v,w) |
| 301 | #define jit_lshi(u,v,w) jit_new_node_www(jit_code_lshi,u,v,w) |
| 302 | jit_code_lshr, jit_code_lshi, |
| 303 | #define jit_rshr(u,v,w) jit_new_node_www(jit_code_rshr,u,v,w) |
| 304 | #define jit_rshi(u,v,w) jit_new_node_www(jit_code_rshi,u,v,w) |
| 305 | jit_code_rshr, jit_code_rshi, |
| 306 | #define jit_rshr_u(u,v,w) jit_new_node_www(jit_code_rshr_u,u,v,w) |
| 307 | #define jit_rshi_u(u,v,w) jit_new_node_www(jit_code_rshi_u,u,v,w) |
| 308 | jit_code_rshr_u, jit_code_rshi_u, |
| 309 | |
| 310 | #define jit_negr(u,v) jit_new_node_ww(jit_code_negr,u,v) |
| 311 | #define jit_comr(u,v) jit_new_node_ww(jit_code_comr,u,v) |
| 312 | jit_code_negr, jit_code_comr, |
| 313 | |
| 314 | #define jit_ltr(u,v,w) jit_new_node_www(jit_code_ltr,u,v,w) |
| 315 | #define jit_lti(u,v,w) jit_new_node_www(jit_code_lti,u,v,w) |
| 316 | jit_code_ltr, jit_code_lti, |
| 317 | #define jit_ltr_u(u,v,w) jit_new_node_www(jit_code_ltr_u,u,v,w) |
| 318 | #define jit_lti_u(u,v,w) jit_new_node_www(jit_code_lti_u,u,v,w) |
| 319 | jit_code_ltr_u, jit_code_lti_u, |
| 320 | #define jit_ler(u,v,w) jit_new_node_www(jit_code_ler,u,v,w) |
| 321 | #define jit_lei(u,v,w) jit_new_node_www(jit_code_lei,u,v,w) |
| 322 | jit_code_ler, jit_code_lei, |
| 323 | #define jit_ler_u(u,v,w) jit_new_node_www(jit_code_ler_u,u,v,w) |
| 324 | #define jit_lei_u(u,v,w) jit_new_node_www(jit_code_lei_u,u,v,w) |
| 325 | jit_code_ler_u, jit_code_lei_u, |
| 326 | #define jit_eqr(u,v,w) jit_new_node_www(jit_code_eqr,u,v,w) |
| 327 | #define jit_eqi(u,v,w) jit_new_node_www(jit_code_eqi,u,v,w) |
| 328 | jit_code_eqr, jit_code_eqi, |
| 329 | #define jit_ger(u,v,w) jit_new_node_www(jit_code_ger,u,v,w) |
| 330 | #define jit_gei(u,v,w) jit_new_node_www(jit_code_gei,u,v,w) |
| 331 | jit_code_ger, jit_code_gei, |
| 332 | #define jit_ger_u(u,v,w) jit_new_node_www(jit_code_ger_u,u,v,w) |
| 333 | #define jit_gei_u(u,v,w) jit_new_node_www(jit_code_gei_u,u,v,w) |
| 334 | jit_code_ger_u, jit_code_gei_u, |
| 335 | #define jit_gtr(u,v,w) jit_new_node_www(jit_code_gtr,u,v,w) |
| 336 | #define jit_gti(u,v,w) jit_new_node_www(jit_code_gti,u,v,w) |
| 337 | jit_code_gtr, jit_code_gti, |
| 338 | #define jit_gtr_u(u,v,w) jit_new_node_www(jit_code_gtr_u,u,v,w) |
| 339 | #define jit_gti_u(u,v,w) jit_new_node_www(jit_code_gti_u,u,v,w) |
| 340 | jit_code_gtr_u, jit_code_gti_u, |
| 341 | #define jit_ner(u,v,w) jit_new_node_www(jit_code_ner,u,v,w) |
| 342 | #define jit_nei(u,v,w) jit_new_node_www(jit_code_nei,u,v,w) |
| 343 | jit_code_ner, jit_code_nei, |
| 344 | |
| 345 | #define jit_movr(u,v) jit_new_node_ww(jit_code_movr,u,v) |
| 346 | #define jit_movi(u,v) jit_new_node_ww(jit_code_movi,u,v) |
| 347 | jit_code_movr, jit_code_movi, |
| 348 | |
| 349 | #define jit_movnr(u,v,w) jit_new_node_www(jit_code_movnr,u,v,w) |
| 350 | #define jit_movzr(u,v,w) jit_new_node_www(jit_code_movzr,u,v,w) |
| 351 | jit_code_movnr, jit_code_movzr, |
| 352 | |
| 353 | #define jit_extr_c(u,v) jit_new_node_ww(jit_code_extr_c,u,v) |
| 354 | #define jit_extr_uc(u,v) jit_new_node_ww(jit_code_extr_uc,u,v) |
| 355 | jit_code_extr_c, jit_code_extr_uc, |
| 356 | #define jit_extr_s(u,v) jit_new_node_ww(jit_code_extr_s,u,v) |
| 357 | #define jit_extr_us(u,v) jit_new_node_ww(jit_code_extr_us,u,v) |
| 358 | jit_code_extr_s, jit_code_extr_us, |
| 359 | #if __WORDSIZE == 64 |
| 360 | # define jit_extr_i(u,v) jit_new_node_ww(jit_code_extr_i,u,v) |
| 361 | # define jit_extr_ui(u,v) jit_new_node_ww(jit_code_extr_ui,u,v) |
| 362 | #endif |
| 363 | jit_code_extr_i, jit_code_extr_ui, |
| 364 | |
| 365 | #define jit_htonr_us(u,v) jit_new_node_ww(jit_code_htonr_us,u,v) |
| 366 | #define jit_ntohr_us(u,v) jit_new_node_ww(jit_code_htonr_us,u,v) |
| 367 | jit_code_htonr_us, |
| 368 | #define jit_htonr_ui(u,v) jit_new_node_ww(jit_code_htonr_ui,u,v) |
| 369 | #define jit_ntohr_ui(u,v) jit_new_node_ww(jit_code_htonr_ui,u,v) |
| 370 | #if __WORDSIZE == 32 |
| 371 | # define jit_htonr(u,v) jit_new_node_ww(jit_code_htonr_ui,u,v) |
| 372 | # define jit_ntohr(u,v) jit_new_node_ww(jit_code_htonr_ui,u,v) |
| 373 | #else |
| 374 | #define jit_htonr_ul(u,v) jit_new_node_ww(jit_code_htonr_ul,u,v) |
| 375 | #define jit_ntohr_ul(u,v) jit_new_node_ww(jit_code_htonr_ul,u,v) |
| 376 | # define jit_htonr(u,v) jit_new_node_ww(jit_code_htonr_ul,u,v) |
| 377 | # define jit_ntohr(u,v) jit_new_node_ww(jit_code_htonr_ul,u,v) |
| 378 | #endif |
| 379 | jit_code_htonr_ui, jit_code_htonr_ul, |
| 380 | |
| 381 | #define jit_ldr_c(u,v) jit_new_node_ww(jit_code_ldr_c,u,v) |
| 382 | #define jit_ldi_c(u,v) jit_new_node_wp(jit_code_ldi_c,u,v) |
| 383 | jit_code_ldr_c, jit_code_ldi_c, |
| 384 | #define jit_ldr_uc(u,v) jit_new_node_ww(jit_code_ldr_uc,u,v) |
| 385 | #define jit_ldi_uc(u,v) jit_new_node_wp(jit_code_ldi_uc,u,v) |
| 386 | jit_code_ldr_uc, jit_code_ldi_uc, |
| 387 | #define jit_ldr_s(u,v) jit_new_node_ww(jit_code_ldr_s,u,v) |
| 388 | #define jit_ldi_s(u,v) jit_new_node_wp(jit_code_ldi_s,u,v) |
| 389 | jit_code_ldr_s, jit_code_ldi_s, |
| 390 | #define jit_ldr_us(u,v) jit_new_node_ww(jit_code_ldr_us,u,v) |
| 391 | #define jit_ldi_us(u,v) jit_new_node_wp(jit_code_ldi_us,u,v) |
| 392 | jit_code_ldr_us, jit_code_ldi_us, |
| 393 | #define jit_ldr_i(u,v) jit_new_node_ww(jit_code_ldr_i,u,v) |
| 394 | #define jit_ldi_i(u,v) jit_new_node_wp(jit_code_ldi_i,u,v) |
| 395 | jit_code_ldr_i, jit_code_ldi_i, |
| 396 | #if __WORDSIZE == 32 |
| 397 | # define jit_ldr(u,v) jit_ldr_i(u,v) |
| 398 | # define jit_ldi(u,v) jit_ldi_i(u,v) |
| 399 | #else |
| 400 | # define jit_ldr(u,v) jit_ldr_l(u,v) |
| 401 | # define jit_ldi(u,v) jit_ldi_l(u,v) |
| 402 | # define jit_ldr_ui(u,v) jit_new_node_ww(jit_code_ldr_ui,u,v) |
| 403 | # define jit_ldi_ui(u,v) jit_new_node_wp(jit_code_ldi_ui,u,v) |
| 404 | #define jit_ldr_l(u,v) jit_new_node_ww(jit_code_ldr_l,u,v) |
| 405 | #define jit_ldi_l(u,v) jit_new_node_wp(jit_code_ldi_l,u,v) |
| 406 | #endif |
| 407 | jit_code_ldr_ui, jit_code_ldi_ui, |
| 408 | jit_code_ldr_l, jit_code_ldi_l, |
| 409 | |
| 410 | #define jit_ldxr_c(u,v,w) jit_new_node_www(jit_code_ldxr_c,u,v,w) |
| 411 | #define jit_ldxi_c(u,v,w) jit_new_node_www(jit_code_ldxi_c,u,v,w) |
| 412 | jit_code_ldxr_c, jit_code_ldxi_c, |
| 413 | #define jit_ldxr_uc(u,v,w) jit_new_node_www(jit_code_ldxr_uc,u,v,w) |
| 414 | #define jit_ldxi_uc(u,v,w) jit_new_node_www(jit_code_ldxi_uc,u,v,w) |
| 415 | jit_code_ldxr_uc, jit_code_ldxi_uc, |
| 416 | #define jit_ldxr_s(u,v,w) jit_new_node_www(jit_code_ldxr_s,u,v,w) |
| 417 | #define jit_ldxi_s(u,v,w) jit_new_node_www(jit_code_ldxi_s,u,v,w) |
| 418 | jit_code_ldxr_s, jit_code_ldxi_s, |
| 419 | #define jit_ldxr_us(u,v,w) jit_new_node_www(jit_code_ldxr_us,u,v,w) |
| 420 | #define jit_ldxi_us(u,v,w) jit_new_node_www(jit_code_ldxi_us,u,v,w) |
| 421 | jit_code_ldxr_us, jit_code_ldxi_us, |
| 422 | #define jit_ldxr_i(u,v,w) jit_new_node_www(jit_code_ldxr_i,u,v,w) |
| 423 | #define jit_ldxi_i(u,v,w) jit_new_node_www(jit_code_ldxi_i,u,v,w) |
| 424 | jit_code_ldxr_i, jit_code_ldxi_i, |
| 425 | #if __WORDSIZE == 32 |
| 426 | # define jit_ldxr(u,v,w) jit_ldxr_i(u,v,w) |
| 427 | # define jit_ldxi(u,v,w) jit_ldxi_i(u,v,w) |
| 428 | #else |
| 429 | # define jit_ldxr_ui(u,v,w) jit_new_node_www(jit_code_ldxr_ui,u,v,w) |
| 430 | # define jit_ldxi_ui(u,v,w) jit_new_node_www(jit_code_ldxi_ui,u,v,w) |
| 431 | # define jit_ldxr_l(u,v,w) jit_new_node_www(jit_code_ldxr_l,u,v,w) |
| 432 | # define jit_ldxi_l(u,v,w) jit_new_node_www(jit_code_ldxi_l,u,v,w) |
| 433 | # define jit_ldxr(u,v,w) jit_ldxr_l(u,v,w) |
| 434 | # define jit_ldxi(u,v,w) jit_ldxi_l(u,v,w) |
| 435 | #endif |
| 436 | jit_code_ldxr_ui, jit_code_ldxi_ui, |
| 437 | jit_code_ldxr_l, jit_code_ldxi_l, |
| 438 | |
| 439 | #define jit_str_c(u,v) jit_new_node_ww(jit_code_str_c,u,v) |
| 440 | #define jit_sti_c(u,v) jit_new_node_pw(jit_code_sti_c,u,v) |
| 441 | jit_code_str_c, jit_code_sti_c, |
| 442 | #define jit_str_s(u,v) jit_new_node_ww(jit_code_str_s,u,v) |
| 443 | #define jit_sti_s(u,v) jit_new_node_pw(jit_code_sti_s,u,v) |
| 444 | jit_code_str_s, jit_code_sti_s, |
| 445 | #define jit_str_i(u,v) jit_new_node_ww(jit_code_str_i,u,v) |
| 446 | #define jit_sti_i(u,v) jit_new_node_pw(jit_code_sti_i,u,v) |
| 447 | jit_code_str_i, jit_code_sti_i, |
| 448 | #if __WORDSIZE == 32 |
| 449 | # define jit_str(u,v) jit_str_i(u,v) |
| 450 | # define jit_sti(u,v) jit_sti_i(u,v) |
| 451 | #else |
| 452 | # define jit_str(u,v) jit_str_l(u,v) |
| 453 | # define jit_sti(u,v) jit_sti_l(u,v) |
| 454 | # define jit_str_l(u,v) jit_new_node_ww(jit_code_str_l,u,v) |
| 455 | # define jit_sti_l(u,v) jit_new_node_pw(jit_code_sti_l,u,v) |
| 456 | #endif |
| 457 | jit_code_str_l, jit_code_sti_l, |
| 458 | |
| 459 | #define jit_stxr_c(u,v,w) jit_new_node_www(jit_code_stxr_c,u,v,w) |
| 460 | #define jit_stxi_c(u,v,w) jit_new_node_www(jit_code_stxi_c,u,v,w) |
| 461 | jit_code_stxr_c, jit_code_stxi_c, |
| 462 | #define jit_stxr_s(u,v,w) jit_new_node_www(jit_code_stxr_s,u,v,w) |
| 463 | #define jit_stxi_s(u,v,w) jit_new_node_www(jit_code_stxi_s,u,v,w) |
| 464 | jit_code_stxr_s, jit_code_stxi_s, |
| 465 | #define jit_stxr_i(u,v,w) jit_new_node_www(jit_code_stxr_i,u,v,w) |
| 466 | #define jit_stxi_i(u,v,w) jit_new_node_www(jit_code_stxi_i,u,v,w) |
| 467 | jit_code_stxr_i, jit_code_stxi_i, |
| 468 | #if __WORDSIZE == 32 |
| 469 | # define jit_stxr(u,v,w) jit_stxr_i(u,v,w) |
| 470 | # define jit_stxi(u,v,w) jit_stxi_i(u,v,w) |
| 471 | #else |
| 472 | # define jit_stxr(u,v,w) jit_stxr_l(u,v,w) |
| 473 | # define jit_stxi(u,v,w) jit_stxi_l(u,v,w) |
| 474 | # define jit_stxr_l(u,v,w) jit_new_node_www(jit_code_stxr_l,u,v,w) |
| 475 | # define jit_stxi_l(u,v,w) jit_new_node_www(jit_code_stxi_l,u,v,w) |
| 476 | #endif |
| 477 | jit_code_stxr_l, jit_code_stxi_l, |
| 478 | |
| 479 | #define jit_bltr(v,w) jit_new_node_pww(jit_code_bltr,NULL,v,w) |
| 480 | #define jit_blti(v,w) jit_new_node_pww(jit_code_blti,NULL,v,w) |
| 481 | jit_code_bltr, jit_code_blti, |
| 482 | #define jit_bltr_u(v,w) jit_new_node_pww(jit_code_bltr_u,NULL,v,w) |
| 483 | #define jit_blti_u(v,w) jit_new_node_pww(jit_code_blti_u,NULL,v,w) |
| 484 | jit_code_bltr_u, jit_code_blti_u, |
| 485 | #define jit_bler(v,w) jit_new_node_pww(jit_code_bler,NULL,v,w) |
| 486 | #define jit_blei(v,w) jit_new_node_pww(jit_code_blei,NULL,v,w) |
| 487 | jit_code_bler, jit_code_blei, |
| 488 | #define jit_bler_u(v,w) jit_new_node_pww(jit_code_bler_u,NULL,v,w) |
| 489 | #define jit_blei_u(v,w) jit_new_node_pww(jit_code_blei_u,NULL,v,w) |
| 490 | jit_code_bler_u, jit_code_blei_u, |
| 491 | #define jit_beqr(v,w) jit_new_node_pww(jit_code_beqr,NULL,v,w) |
| 492 | #define jit_beqi(v,w) jit_new_node_pww(jit_code_beqi,NULL,v,w) |
| 493 | jit_code_beqr, jit_code_beqi, |
| 494 | #define jit_bger(v,w) jit_new_node_pww(jit_code_bger,NULL,v,w) |
| 495 | #define jit_bgei(v,w) jit_new_node_pww(jit_code_bgei,NULL,v,w) |
| 496 | jit_code_bger, jit_code_bgei, |
| 497 | #define jit_bger_u(v,w) jit_new_node_pww(jit_code_bger_u,NULL,v,w) |
| 498 | #define jit_bgei_u(v,w) jit_new_node_pww(jit_code_bgei_u,NULL,v,w) |
| 499 | jit_code_bger_u, jit_code_bgei_u, |
| 500 | #define jit_bgtr(v,w) jit_new_node_pww(jit_code_bgtr,NULL,v,w) |
| 501 | #define jit_bgti(v,w) jit_new_node_pww(jit_code_bgti,NULL,v,w) |
| 502 | jit_code_bgtr, jit_code_bgti, |
| 503 | #define jit_bgtr_u(v,w) jit_new_node_pww(jit_code_bgtr_u,NULL,v,w) |
| 504 | #define jit_bgti_u(v,w) jit_new_node_pww(jit_code_bgti_u,NULL,v,w) |
| 505 | jit_code_bgtr_u, jit_code_bgti_u, |
| 506 | #define jit_bner(v,w) jit_new_node_pww(jit_code_bner,NULL,v,w) |
| 507 | #define jit_bnei(v,w) jit_new_node_pww(jit_code_bnei,NULL,v,w) |
| 508 | jit_code_bner, jit_code_bnei, |
| 509 | |
| 510 | #define jit_bmsr(v,w) jit_new_node_pww(jit_code_bmsr,NULL,v,w) |
| 511 | #define jit_bmsi(v,w) jit_new_node_pww(jit_code_bmsi,NULL,v,w) |
| 512 | jit_code_bmsr, jit_code_bmsi, |
| 513 | #define jit_bmcr(v,w) jit_new_node_pww(jit_code_bmcr,NULL,v,w) |
| 514 | #define jit_bmci(v,w) jit_new_node_pww(jit_code_bmci,NULL,v,w) |
| 515 | jit_code_bmcr, jit_code_bmci, |
| 516 | |
| 517 | #define jit_boaddr(v,w) jit_new_node_pww(jit_code_boaddr,NULL,v,w) |
| 518 | #define jit_boaddi(v,w) jit_new_node_pww(jit_code_boaddi,NULL,v,w) |
| 519 | jit_code_boaddr, jit_code_boaddi, |
| 520 | #define jit_boaddr_u(v,w) jit_new_node_pww(jit_code_boaddr_u,NULL,v,w) |
| 521 | #define jit_boaddi_u(v,w) jit_new_node_pww(jit_code_boaddi_u,NULL,v,w) |
| 522 | jit_code_boaddr_u, jit_code_boaddi_u, |
| 523 | #define jit_bxaddr(v,w) jit_new_node_pww(jit_code_bxaddr,NULL,v,w) |
| 524 | #define jit_bxaddi(v,w) jit_new_node_pww(jit_code_bxaddi,NULL,v,w) |
| 525 | jit_code_bxaddr, jit_code_bxaddi, |
| 526 | #define jit_bxaddr_u(v,w) jit_new_node_pww(jit_code_bxaddr_u,NULL,v,w) |
| 527 | #define jit_bxaddi_u(v,w) jit_new_node_pww(jit_code_bxaddi_u,NULL,v,w) |
| 528 | jit_code_bxaddr_u, jit_code_bxaddi_u, |
| 529 | #define jit_bosubr(v,w) jit_new_node_pww(jit_code_bosubr,NULL,v,w) |
| 530 | #define jit_bosubi(v,w) jit_new_node_pww(jit_code_bosubi,NULL,v,w) |
| 531 | jit_code_bosubr, jit_code_bosubi, |
| 532 | #define jit_bosubr_u(v,w) jit_new_node_pww(jit_code_bosubr_u,NULL,v,w) |
| 533 | #define jit_bosubi_u(v,w) jit_new_node_pww(jit_code_bosubi_u,NULL,v,w) |
| 534 | jit_code_bosubr_u, jit_code_bosubi_u, |
| 535 | #define jit_bxsubr(v,w) jit_new_node_pww(jit_code_bxsubr,NULL,v,w) |
| 536 | #define jit_bxsubi(v,w) jit_new_node_pww(jit_code_bxsubi,NULL,v,w) |
| 537 | jit_code_bxsubr, jit_code_bxsubi, |
| 538 | #define jit_bxsubr_u(v,w) jit_new_node_pww(jit_code_bxsubr_u,NULL,v,w) |
| 539 | #define jit_bxsubi_u(v,w) jit_new_node_pww(jit_code_bxsubi_u,NULL,v,w) |
| 540 | jit_code_bxsubr_u, jit_code_bxsubi_u, |
| 541 | |
| 542 | #define jit_jmpr(u) jit_new_node_w(jit_code_jmpr,u) |
| 543 | #define jit_jmpi() jit_new_node_p(jit_code_jmpi,NULL) |
| 544 | jit_code_jmpr, jit_code_jmpi, |
| 545 | #define jit_callr(u) jit_new_node_w(jit_code_callr,u) |
| 546 | #define jit_calli(u) jit_new_node_p(jit_code_calli,u) |
| 547 | jit_code_callr, jit_code_calli, |
| 548 | |
| 549 | #define jit_prepare() _jit_prepare(_jit) |
| 550 | jit_code_prepare, |
| 551 | #define jit_pushargr(u) _jit_pushargr(_jit,u) |
| 552 | #define jit_pushargi(u) _jit_pushargi(_jit,u) |
| 553 | jit_code_pushargr, jit_code_pushargi, |
| 554 | #define jit_finishr(u) _jit_finishr(_jit,u) |
| 555 | #define jit_finishi(u) _jit_finishi(_jit,u) |
| 556 | jit_code_finishr, jit_code_finishi, |
| 557 | #define jit_ret() _jit_ret(_jit) |
| 558 | jit_code_ret, |
| 559 | #define jit_retr(u) _jit_retr(_jit,u) |
| 560 | #define jit_reti(u) _jit_reti(_jit,u) |
| 561 | jit_code_retr, jit_code_reti, |
| 562 | #define jit_retval_c(u) _jit_retval_c(_jit,u) |
| 563 | #define jit_retval_uc(u) _jit_retval_uc(_jit,u) |
| 564 | jit_code_retval_c, jit_code_retval_uc, |
| 565 | #define jit_retval_s(u) _jit_retval_s(_jit,u) |
| 566 | #define jit_retval_us(u) _jit_retval_us(_jit,u) |
| 567 | jit_code_retval_s, jit_code_retval_us, |
| 568 | #define jit_retval_i(u) _jit_retval_i(_jit,u) |
| 569 | #if __WORDSIZE == 32 |
| 570 | # define jit_retval(u) jit_retval_i(u) |
| 571 | #else |
| 572 | # define jit_retval(u) jit_retval_l(u) |
| 573 | # define jit_retval_ui(u) _jit_retval_ui(_jit,u) |
| 574 | # define jit_retval_l(u) _jit_retval_l(_jit,u) |
| 575 | #endif |
| 576 | jit_code_retval_i, jit_code_retval_ui, |
| 577 | jit_code_retval_l, |
| 578 | |
| 579 | #define jit_epilog() _jit_epilog(_jit) |
| 580 | jit_code_epilog, |
| 581 | |
| 582 | #define jit_arg_f() _jit_arg_f(_jit) |
| 583 | jit_code_arg_f, |
| 584 | #define jit_getarg_f(u,v) _jit_getarg_f(_jit,u,v) |
| 585 | jit_code_getarg_f, |
| 586 | #define jit_putargr_f(u,v) _jit_putargr_f(_jit,u,v) |
| 587 | #define jit_putargi_f(u,v) _jit_putargi_f(_jit,u,v) |
| 588 | jit_code_putargr_f, jit_code_putargi_f, |
| 589 | |
| 590 | #define jit_addr_f(u,v,w) jit_new_node_www(jit_code_addr_f,u,v,w) |
| 591 | #define jit_addi_f(u,v,w) jit_new_node_wwf(jit_code_addi_f,u,v,w) |
| 592 | jit_code_addr_f, jit_code_addi_f, |
| 593 | #define jit_subr_f(u,v,w) jit_new_node_www(jit_code_subr_f,u,v,w) |
| 594 | #define jit_subi_f(u,v,w) jit_new_node_wwf(jit_code_subi_f,u,v,w) |
| 595 | jit_code_subr_f, jit_code_subi_f, |
| 596 | #define jit_rsbr_f(u,v,w) jit_subr_f(u,w,v) |
| 597 | #define jit_rsbi_f(u,v,w) jit_new_node_wwf(jit_code_rsbi_f,u,v,w) |
| 598 | jit_code_rsbi_f, |
| 599 | #define jit_mulr_f(u,v,w) jit_new_node_www(jit_code_mulr_f,u,v,w) |
| 600 | #define jit_muli_f(u,v,w) jit_new_node_wwf(jit_code_muli_f,u,v,w) |
| 601 | jit_code_mulr_f, jit_code_muli_f, |
| 602 | #define jit_divr_f(u,v,w) jit_new_node_www(jit_code_divr_f,u,v,w) |
| 603 | #define jit_divi_f(u,v,w) jit_new_node_wwf(jit_code_divi_f,u,v,w) |
| 604 | jit_code_divr_f, jit_code_divi_f, |
| 605 | #define jit_negr_f(u,v) jit_new_node_ww(jit_code_negr_f,u,v) |
| 606 | #define jit_absr_f(u,v) jit_new_node_ww(jit_code_absr_f,u,v) |
| 607 | #define jit_sqrtr_f(u,v) jit_new_node_ww(jit_code_sqrtr_f,u,v) |
| 608 | jit_code_negr_f, jit_code_absr_f, jit_code_sqrtr_f, |
| 609 | |
| 610 | #define jit_ltr_f(u,v,w) jit_new_node_www(jit_code_ltr_f,u,v,w) |
| 611 | #define jit_lti_f(u,v,w) jit_new_node_wwf(jit_code_lti_f,u,v,w) |
| 612 | jit_code_ltr_f, jit_code_lti_f, |
| 613 | #define jit_ler_f(u,v,w) jit_new_node_www(jit_code_ler_f,u,v,w) |
| 614 | #define jit_lei_f(u,v,w) jit_new_node_wwf(jit_code_lei_f,u,v,w) |
| 615 | jit_code_ler_f, jit_code_lei_f, |
| 616 | #define jit_eqr_f(u,v,w) jit_new_node_www(jit_code_eqr_f,u,v,w) |
| 617 | #define jit_eqi_f(u,v,w) jit_new_node_wwf(jit_code_eqi_f,u,v,w) |
| 618 | jit_code_eqr_f, jit_code_eqi_f, |
| 619 | #define jit_ger_f(u,v,w) jit_new_node_www(jit_code_ger_f,u,v,w) |
| 620 | #define jit_gei_f(u,v,w) jit_new_node_wwf(jit_code_gei_f,u,v,w) |
| 621 | jit_code_ger_f, jit_code_gei_f, |
| 622 | #define jit_gtr_f(u,v,w) jit_new_node_www(jit_code_gtr_f,u,v,w) |
| 623 | #define jit_gti_f(u,v,w) jit_new_node_wwf(jit_code_gti_f,u,v,w) |
| 624 | jit_code_gtr_f, jit_code_gti_f, |
| 625 | #define jit_ner_f(u,v,w) jit_new_node_www(jit_code_ner_f,u,v,w) |
| 626 | #define jit_nei_f(u,v,w) jit_new_node_wwf(jit_code_nei_f,u,v,w) |
| 627 | jit_code_ner_f, jit_code_nei_f, |
| 628 | #define jit_unltr_f(u,v,w) jit_new_node_www(jit_code_unltr_f,u,v,w) |
| 629 | #define jit_unlti_f(u,v,w) jit_new_node_wwf(jit_code_unlti_f,u,v,w) |
| 630 | jit_code_unltr_f, jit_code_unlti_f, |
| 631 | #define jit_unler_f(u,v,w) jit_new_node_www(jit_code_unler_f,u,v,w) |
| 632 | #define jit_unlei_f(u,v,w) jit_new_node_wwf(jit_code_unlei_f,u,v,w) |
| 633 | jit_code_unler_f, jit_code_unlei_f, |
| 634 | #define jit_uneqr_f(u,v,w) jit_new_node_www(jit_code_uneqr_f,u,v,w) |
| 635 | #define jit_uneqi_f(u,v,w) jit_new_node_wwf(jit_code_uneqi_f,u,v,w) |
| 636 | jit_code_uneqr_f, jit_code_uneqi_f, |
| 637 | #define jit_unger_f(u,v,w) jit_new_node_www(jit_code_unger_f,u,v,w) |
| 638 | #define jit_ungei_f(u,v,w) jit_new_node_wwf(jit_code_ungei_f,u,v,w) |
| 639 | jit_code_unger_f, jit_code_ungei_f, |
| 640 | #define jit_ungtr_f(u,v,w) jit_new_node_www(jit_code_ungtr_f,u,v,w) |
| 641 | #define jit_ungti_f(u,v,w) jit_new_node_wwf(jit_code_ungti_f,u,v,w) |
| 642 | jit_code_ungtr_f, jit_code_ungti_f, |
| 643 | #define jit_ltgtr_f(u,v,w) jit_new_node_www(jit_code_ltgtr_f,u,v,w) |
| 644 | #define jit_ltgti_f(u,v,w) jit_new_node_wwf(jit_code_ltgti_f,u,v,w) |
| 645 | jit_code_ltgtr_f, jit_code_ltgti_f, |
| 646 | #define jit_ordr_f(u,v,w) jit_new_node_www(jit_code_ordr_f,u,v,w) |
| 647 | #define jit_ordi_f(u,v,w) jit_new_node_wwf(jit_code_ordi_f,u,v,w) |
| 648 | jit_code_ordr_f, jit_code_ordi_f, |
| 649 | #define jit_unordr_f(u,v,w) jit_new_node_www(jit_code_unordr_f,u,v,w) |
| 650 | #define jit_unordi_f(u,v,w) jit_new_node_wwf(jit_code_unordi_f,u,v,w) |
| 651 | jit_code_unordr_f, jit_code_unordi_f, |
| 652 | |
| 653 | #define jit_truncr_f_i(u,v) jit_new_node_ww(jit_code_truncr_f_i,u,v) |
| 654 | jit_code_truncr_f_i, |
| 655 | #if __WORDSIZE == 32 |
| 656 | # define jit_truncr_f(u,v) jit_truncr_f_i(u,v) |
| 657 | #else |
| 658 | # define jit_truncr_f(u,v) jit_truncr_f_l(u,v) |
| 659 | # define jit_truncr_f_l(u,v) jit_new_node_ww(jit_code_truncr_f_l,u,v) |
| 660 | #endif |
| 661 | jit_code_truncr_f_l, |
| 662 | #define jit_extr_f(u,v) jit_new_node_ww(jit_code_extr_f,u,v) |
| 663 | #define jit_extr_d_f(u,v) jit_new_node_ww(jit_code_extr_d_f,u,v) |
| 664 | jit_code_extr_f, jit_code_extr_d_f, |
| 665 | #define jit_movr_f(u,v) jit_new_node_ww(jit_code_movr_f,u,v) |
| 666 | #define jit_movi_f(u,v) jit_new_node_wf(jit_code_movi_f,u,v) |
| 667 | jit_code_movr_f, jit_code_movi_f, |
| 668 | |
| 669 | #define jit_ldr_f(u,v) jit_new_node_ww(jit_code_ldr_f,u,v) |
| 670 | #define jit_ldi_f(u,v) jit_new_node_wp(jit_code_ldi_f,u,v) |
| 671 | jit_code_ldr_f, jit_code_ldi_f, |
| 672 | #define jit_ldxr_f(u,v,w) jit_new_node_www(jit_code_ldxr_f,u,v,w) |
| 673 | #define jit_ldxi_f(u,v,w) jit_new_node_www(jit_code_ldxi_f,u,v,w) |
| 674 | jit_code_ldxr_f, jit_code_ldxi_f, |
| 675 | #define jit_str_f(u,v) jit_new_node_ww(jit_code_str_f,u,v) |
| 676 | #define jit_sti_f(u,v) jit_new_node_pw(jit_code_sti_f,u,v) |
| 677 | jit_code_str_f, jit_code_sti_f, |
| 678 | #define jit_stxr_f(u,v,w) jit_new_node_www(jit_code_stxr_f,u,v,w) |
| 679 | #define jit_stxi_f(u,v,w) jit_new_node_www(jit_code_stxi_f,u,v,w) |
| 680 | jit_code_stxr_f, jit_code_stxi_f, |
| 681 | |
| 682 | #define jit_bltr_f(v,w) jit_new_node_pww(jit_code_bltr_f,NULL,v,w) |
| 683 | #define jit_blti_f(v,w) jit_new_node_pwf(jit_code_blti_f,NULL,v,w) |
| 684 | jit_code_bltr_f, jit_code_blti_f, |
| 685 | #define jit_bler_f(v,w) jit_new_node_pww(jit_code_bler_f,NULL,v,w) |
| 686 | #define jit_blei_f(v,w) jit_new_node_pwf(jit_code_blei_f,NULL,v,w) |
| 687 | jit_code_bler_f, jit_code_blei_f, |
| 688 | #define jit_beqr_f(v,w) jit_new_node_pww(jit_code_beqr_f,NULL,v,w) |
| 689 | #define jit_beqi_f(v,w) jit_new_node_pwf(jit_code_beqi_f,NULL,v,w) |
| 690 | jit_code_beqr_f, jit_code_beqi_f, |
| 691 | #define jit_bger_f(v,w) jit_new_node_pww(jit_code_bger_f,NULL,v,w) |
| 692 | #define jit_bgei_f(v,w) jit_new_node_pwf(jit_code_bgei_f,NULL,v,w) |
| 693 | jit_code_bger_f, jit_code_bgei_f, |
| 694 | #define jit_bgtr_f(v,w) jit_new_node_pww(jit_code_bgtr_f,NULL,v,w) |
| 695 | #define jit_bgti_f(v,w) jit_new_node_pwf(jit_code_bgti_f,NULL,v,w) |
| 696 | jit_code_bgtr_f, jit_code_bgti_f, |
| 697 | #define jit_bner_f(v,w) jit_new_node_pww(jit_code_bner_f,NULL,v,w) |
| 698 | #define jit_bnei_f(v,w) jit_new_node_pwf(jit_code_bnei_f,NULL,v,w) |
| 699 | jit_code_bner_f, jit_code_bnei_f, |
| 700 | #define jit_bunltr_f(v,w) jit_new_node_pww(jit_code_bunltr_f,NULL,v,w) |
| 701 | #define jit_bunlti_f(v,w) jit_new_node_pwf(jit_code_bunlti_f,NULL,v,w) |
| 702 | jit_code_bunltr_f, jit_code_bunlti_f, |
| 703 | #define jit_bunler_f(v,w) jit_new_node_pww(jit_code_bunler_f,NULL,v,w) |
| 704 | #define jit_bunlei_f(v,w) jit_new_node_pwf(jit_code_bunlei_f,NULL,v,w) |
| 705 | jit_code_bunler_f, jit_code_bunlei_f, |
| 706 | #define jit_buneqr_f(v,w) jit_new_node_pww(jit_code_buneqr_f,NULL,v,w) |
| 707 | #define jit_buneqi_f(v,w) jit_new_node_pwf(jit_code_buneqi_f,NULL,v,w) |
| 708 | jit_code_buneqr_f, jit_code_buneqi_f, |
| 709 | #define jit_bunger_f(v,w) jit_new_node_pww(jit_code_bunger_f,NULL,v,w) |
| 710 | #define jit_bungei_f(v,w) jit_new_node_pwf(jit_code_bungei_f,NULL,v,w) |
| 711 | jit_code_bunger_f, jit_code_bungei_f, |
| 712 | #define jit_bungtr_f(v,w) jit_new_node_pww(jit_code_bungtr_f,NULL,v,w) |
| 713 | #define jit_bungti_f(v,w) jit_new_node_pwf(jit_code_bungti_f,NULL,v,w) |
| 714 | jit_code_bungtr_f, jit_code_bungti_f, |
| 715 | #define jit_bltgtr_f(v,w) jit_new_node_pww(jit_code_bltgtr_f,NULL,v,w) |
| 716 | #define jit_bltgti_f(v,w) jit_new_node_pwf(jit_code_bltgti_f,NULL,v,w) |
| 717 | jit_code_bltgtr_f, jit_code_bltgti_f, |
| 718 | #define jit_bordr_f(v,w) jit_new_node_pww(jit_code_bordr_f,NULL,v,w) |
| 719 | #define jit_bordi_f(v,w) jit_new_node_pwf(jit_code_bordi_f,NULL,v,w) |
| 720 | jit_code_bordr_f, jit_code_bordi_f, |
| 721 | #define jit_bunordr_f(v,w) jit_new_node_pww(jit_code_bunordr_f,NULL,v,w) |
| 722 | #define jit_bunordi_f(v,w) jit_new_node_pwf(jit_code_bunordi_f,NULL,v,w) |
| 723 | jit_code_bunordr_f, jit_code_bunordi_f, |
| 724 | |
| 725 | #define jit_pushargr_f(u) _jit_pushargr_f(_jit,u) |
| 726 | #define jit_pushargi_f(u) _jit_pushargi_f(_jit,u) |
| 727 | jit_code_pushargr_f, jit_code_pushargi_f, |
| 728 | #define jit_retr_f(u) _jit_retr_f(_jit,u) |
| 729 | #define jit_reti_f(u) _jit_reti_f(_jit,u) |
| 730 | jit_code_retr_f, jit_code_reti_f, |
| 731 | #define jit_retval_f(u) _jit_retval_f(_jit,u) |
| 732 | jit_code_retval_f, |
| 733 | |
| 734 | #define jit_arg_d() _jit_arg_d(_jit) |
| 735 | jit_code_arg_d, |
| 736 | #define jit_getarg_d(u,v) _jit_getarg_d(_jit,u,v) |
| 737 | jit_code_getarg_d, |
| 738 | #define jit_putargr_d(u,v) _jit_putargr_d(_jit,u,v) |
| 739 | #define jit_putargi_d(u,v) _jit_putargi_d(_jit,u,v) |
| 740 | jit_code_putargr_d, jit_code_putargi_d, |
| 741 | |
| 742 | #define jit_addr_d(u,v,w) jit_new_node_www(jit_code_addr_d,u,v,w) |
| 743 | #define jit_addi_d(u,v,w) jit_new_node_wwd(jit_code_addi_d,u,v,w) |
| 744 | jit_code_addr_d, jit_code_addi_d, |
| 745 | #define jit_subr_d(u,v,w) jit_new_node_www(jit_code_subr_d,u,v,w) |
| 746 | #define jit_subi_d(u,v,w) jit_new_node_wwd(jit_code_subi_d,u,v,w) |
| 747 | jit_code_subr_d, jit_code_subi_d, |
| 748 | #define jit_rsbr_d(u,v,w) jit_subr_d(u,w,v) |
| 749 | #define jit_rsbi_d(u,v,w) jit_new_node_wwd(jit_code_rsbi_d,u,v,w) |
| 750 | jit_code_rsbi_d, |
| 751 | #define jit_mulr_d(u,v,w) jit_new_node_www(jit_code_mulr_d,u,v,w) |
| 752 | #define jit_muli_d(u,v,w) jit_new_node_wwd(jit_code_muli_d,u,v,w) |
| 753 | jit_code_mulr_d, jit_code_muli_d, |
| 754 | #define jit_divr_d(u,v,w) jit_new_node_www(jit_code_divr_d,u,v,w) |
| 755 | #define jit_divi_d(u,v,w) jit_new_node_wwd(jit_code_divi_d,u,v,w) |
| 756 | jit_code_divr_d, jit_code_divi_d, |
| 757 | |
| 758 | #define jit_negr_d(u,v) jit_new_node_ww(jit_code_negr_d,u,v) |
| 759 | #define jit_absr_d(u,v) jit_new_node_ww(jit_code_absr_d,u,v) |
| 760 | #define jit_sqrtr_d(u,v) jit_new_node_ww(jit_code_sqrtr_d,u,v) |
| 761 | jit_code_negr_d, jit_code_absr_d, jit_code_sqrtr_d, |
| 762 | |
| 763 | #define jit_ltr_d(u,v,w) jit_new_node_www(jit_code_ltr_d,u,v,w) |
| 764 | #define jit_lti_d(u,v,w) jit_new_node_wwd(jit_code_lti_d,u,v,w) |
| 765 | jit_code_ltr_d, jit_code_lti_d, |
| 766 | #define jit_ler_d(u,v,w) jit_new_node_www(jit_code_ler_d,u,v,w) |
| 767 | #define jit_lei_d(u,v,w) jit_new_node_wwd(jit_code_lei_d,u,v,w) |
| 768 | jit_code_ler_d, jit_code_lei_d, |
| 769 | #define jit_eqr_d(u,v,w) jit_new_node_www(jit_code_eqr_d,u,v,w) |
| 770 | #define jit_eqi_d(u,v,w) jit_new_node_wwd(jit_code_eqi_d,u,v,w) |
| 771 | jit_code_eqr_d, jit_code_eqi_d, |
| 772 | #define jit_ger_d(u,v,w) jit_new_node_www(jit_code_ger_d,u,v,w) |
| 773 | #define jit_gei_d(u,v,w) jit_new_node_wwd(jit_code_gei_d,u,v,w) |
| 774 | jit_code_ger_d, jit_code_gei_d, |
| 775 | #define jit_gtr_d(u,v,w) jit_new_node_www(jit_code_gtr_d,u,v,w) |
| 776 | #define jit_gti_d(u,v,w) jit_new_node_wwd(jit_code_gti_d,u,v,w) |
| 777 | jit_code_gtr_d, jit_code_gti_d, |
| 778 | #define jit_ner_d(u,v,w) jit_new_node_www(jit_code_ner_d,u,v,w) |
| 779 | #define jit_nei_d(u,v,w) jit_new_node_wwd(jit_code_nei_d,u,v,w) |
| 780 | jit_code_ner_d, jit_code_nei_d, |
| 781 | #define jit_unltr_d(u,v,w) jit_new_node_www(jit_code_unltr_d,u,v,w) |
| 782 | #define jit_unlti_d(u,v,w) jit_new_node_wwd(jit_code_unlti_d,u,v,w) |
| 783 | jit_code_unltr_d, jit_code_unlti_d, |
| 784 | #define jit_unler_d(u,v,w) jit_new_node_www(jit_code_unler_d,u,v,w) |
| 785 | #define jit_unlei_d(u,v,w) jit_new_node_wwd(jit_code_unlei_d,u,v,w) |
| 786 | jit_code_unler_d, jit_code_unlei_d, |
| 787 | #define jit_uneqr_d(u,v,w) jit_new_node_www(jit_code_uneqr_d,u,v,w) |
| 788 | #define jit_uneqi_d(u,v,w) jit_new_node_wwd(jit_code_uneqi_d,u,v,w) |
| 789 | jit_code_uneqr_d, jit_code_uneqi_d, |
| 790 | #define jit_unger_d(u,v,w) jit_new_node_www(jit_code_unger_d,u,v,w) |
| 791 | #define jit_ungei_d(u,v,w) jit_new_node_wwd(jit_code_ungei_d,u,v,w) |
| 792 | jit_code_unger_d, jit_code_ungei_d, |
| 793 | #define jit_ungtr_d(u,v,w) jit_new_node_www(jit_code_ungtr_d,u,v,w) |
| 794 | #define jit_ungti_d(u,v,w) jit_new_node_wwd(jit_code_ungti_d,u,v,w) |
| 795 | jit_code_ungtr_d, jit_code_ungti_d, |
| 796 | #define jit_ltgtr_d(u,v,w) jit_new_node_www(jit_code_ltgtr_d,u,v,w) |
| 797 | #define jit_ltgti_d(u,v,w) jit_new_node_wwd(jit_code_ltgti_d,u,v,w) |
| 798 | jit_code_ltgtr_d, jit_code_ltgti_d, |
| 799 | #define jit_ordr_d(u,v,w) jit_new_node_www(jit_code_ordr_d,u,v,w) |
| 800 | #define jit_ordi_d(u,v,w) jit_new_node_wwd(jit_code_ordi_d,u,v,w) |
| 801 | jit_code_ordr_d, jit_code_ordi_d, |
| 802 | #define jit_unordr_d(u,v,w) jit_new_node_www(jit_code_unordr_d,u,v,w) |
| 803 | #define jit_unordi_d(u,v,w) jit_new_node_wwd(jit_code_unordi_d,u,v,w) |
| 804 | jit_code_unordr_d, jit_code_unordi_d, |
| 805 | |
| 806 | #define jit_truncr_d_i(u,v) jit_new_node_ww(jit_code_truncr_d_i,u,v) |
| 807 | jit_code_truncr_d_i, |
| 808 | #if __WORDSIZE == 32 |
| 809 | # define jit_truncr_d(u,v) jit_truncr_d_i(u,v) |
| 810 | #else |
| 811 | # define jit_truncr_d(u,v) jit_truncr_d_l(u,v) |
| 812 | # define jit_truncr_d_l(u,v) jit_new_node_ww(jit_code_truncr_d_l,u,v) |
| 813 | #endif |
| 814 | jit_code_truncr_d_l, |
| 815 | #define jit_extr_d(u,v) jit_new_node_ww(jit_code_extr_d,u,v) |
| 816 | #define jit_extr_f_d(u,v) jit_new_node_ww(jit_code_extr_f_d,u,v) |
| 817 | jit_code_extr_d, jit_code_extr_f_d, |
| 818 | #define jit_movr_d(u,v) jit_new_node_ww(jit_code_movr_d,u,v) |
| 819 | #define jit_movi_d(u,v) jit_new_node_wd(jit_code_movi_d,u,v) |
| 820 | jit_code_movr_d, jit_code_movi_d, |
| 821 | |
| 822 | #define jit_ldr_d(u,v) jit_new_node_ww(jit_code_ldr_d,u,v) |
| 823 | #define jit_ldi_d(u,v) jit_new_node_wp(jit_code_ldi_d,u,v) |
| 824 | jit_code_ldr_d, jit_code_ldi_d, |
| 825 | #define jit_ldxr_d(u,v,w) jit_new_node_www(jit_code_ldxr_d,u,v,w) |
| 826 | #define jit_ldxi_d(u,v,w) jit_new_node_www(jit_code_ldxi_d,u,v,w) |
| 827 | jit_code_ldxr_d, jit_code_ldxi_d, |
| 828 | #define jit_str_d(u,v) jit_new_node_ww(jit_code_str_d,u,v) |
| 829 | #define jit_sti_d(u,v) jit_new_node_pw(jit_code_sti_d,u,v) |
| 830 | jit_code_str_d, jit_code_sti_d, |
| 831 | #define jit_stxr_d(u,v,w) jit_new_node_www(jit_code_stxr_d,u,v,w) |
| 832 | #define jit_stxi_d(u,v,w) jit_new_node_www(jit_code_stxi_d,u,v,w) |
| 833 | jit_code_stxr_d, jit_code_stxi_d, |
| 834 | |
| 835 | #define jit_bltr_d(v,w) jit_new_node_pww(jit_code_bltr_d,NULL,v,w) |
| 836 | #define jit_blti_d(v,w) jit_new_node_pwd(jit_code_blti_d,NULL,v,w) |
| 837 | jit_code_bltr_d, jit_code_blti_d, |
| 838 | #define jit_bler_d(v,w) jit_new_node_pww(jit_code_bler_d,NULL,v,w) |
| 839 | #define jit_blei_d(v,w) jit_new_node_pwd(jit_code_blei_d,NULL,v,w) |
| 840 | jit_code_bler_d, jit_code_blei_d, |
| 841 | #define jit_beqr_d(v,w) jit_new_node_pww(jit_code_beqr_d,NULL,v,w) |
| 842 | #define jit_beqi_d(v,w) jit_new_node_pwd(jit_code_beqi_d,NULL,v,w) |
| 843 | jit_code_beqr_d, jit_code_beqi_d, |
| 844 | #define jit_bger_d(v,w) jit_new_node_pww(jit_code_bger_d,NULL,v,w) |
| 845 | #define jit_bgei_d(v,w) jit_new_node_pwd(jit_code_bgei_d,NULL,v,w) |
| 846 | jit_code_bger_d, jit_code_bgei_d, |
| 847 | #define jit_bgtr_d(v,w) jit_new_node_pww(jit_code_bgtr_d,NULL,v,w) |
| 848 | #define jit_bgti_d(v,w) jit_new_node_pwd(jit_code_bgti_d,NULL,v,w) |
| 849 | jit_code_bgtr_d, jit_code_bgti_d, |
| 850 | #define jit_bner_d(v,w) jit_new_node_pww(jit_code_bner_d,NULL,v,w) |
| 851 | #define jit_bnei_d(v,w) jit_new_node_pwd(jit_code_bnei_d,NULL,v,w) |
| 852 | jit_code_bner_d, jit_code_bnei_d, |
| 853 | #define jit_bunltr_d(v,w) jit_new_node_pww(jit_code_bunltr_d,NULL,v,w) |
| 854 | #define jit_bunlti_d(v,w) jit_new_node_pwd(jit_code_bunlti_d,NULL,v,w) |
| 855 | jit_code_bunltr_d, jit_code_bunlti_d, |
| 856 | #define jit_bunler_d(v,w) jit_new_node_pww(jit_code_bunler_d,NULL,v,w) |
| 857 | #define jit_bunlei_d(v,w) jit_new_node_pwd(jit_code_bunlei_d,NULL,v,w) |
| 858 | jit_code_bunler_d, jit_code_bunlei_d, |
| 859 | #define jit_buneqr_d(v,w) jit_new_node_pww(jit_code_buneqr_d,NULL,v,w) |
| 860 | #define jit_buneqi_d(v,w) jit_new_node_pwd(jit_code_buneqi_d,NULL,v,w) |
| 861 | jit_code_buneqr_d, jit_code_buneqi_d, |
| 862 | #define jit_bunger_d(v,w) jit_new_node_pww(jit_code_bunger_d,NULL,v,w) |
| 863 | #define jit_bungei_d(v,w) jit_new_node_pwd(jit_code_bungei_d,NULL,v,w) |
| 864 | jit_code_bunger_d, jit_code_bungei_d, |
| 865 | #define jit_bungtr_d(v,w) jit_new_node_pww(jit_code_bungtr_d,NULL,v,w) |
| 866 | #define jit_bungti_d(v,w) jit_new_node_pwd(jit_code_bungti_d,NULL,v,w) |
| 867 | jit_code_bungtr_d, jit_code_bungti_d, |
| 868 | #define jit_bltgtr_d(v,w) jit_new_node_pww(jit_code_bltgtr_d,NULL,v,w) |
| 869 | #define jit_bltgti_d(v,w) jit_new_node_pwd(jit_code_bltgti_d,NULL,v,w) |
| 870 | jit_code_bltgtr_d, jit_code_bltgti_d, |
| 871 | #define jit_bordr_d(v,w) jit_new_node_pww(jit_code_bordr_d,NULL,v,w) |
| 872 | #define jit_bordi_d(v,w) jit_new_node_pwd(jit_code_bordi_d,NULL,v,w) |
| 873 | jit_code_bordr_d, jit_code_bordi_d, |
| 874 | #define jit_bunordr_d(v,w) jit_new_node_pww(jit_code_bunordr_d,NULL,v,w) |
| 875 | #define jit_bunordi_d(v,w) jit_new_node_pwd(jit_code_bunordi_d,NULL,v,w) |
| 876 | jit_code_bunordr_d, jit_code_bunordi_d, |
| 877 | |
| 878 | #define jit_pushargr_d(u) _jit_pushargr_d(_jit,u) |
| 879 | #define jit_pushargi_d(u) _jit_pushargi_d(_jit,u) |
| 880 | jit_code_pushargr_d, jit_code_pushargi_d, |
| 881 | #define jit_retr_d(u) _jit_retr_d(_jit,u) |
| 882 | #define jit_reti_d(u) _jit_reti_d(_jit,u) |
| 883 | jit_code_retr_d, jit_code_reti_d, |
| 884 | #define jit_retval_d(u) _jit_retval_d(_jit,u) |
| 885 | jit_code_retval_d, |
| 886 | |
| 887 | /* Special internal backend specific codes */ |
| 888 | jit_code_movr_w_f, jit_code_movr_ww_d, /* w* -> f|d */ |
| 889 | #define jit_movr_w_f(u, v) jit_new_node_ww(jit_code_movr_w_f, u, v) |
| 890 | #define jit_movr_ww_d(u, v, w) jit_new_node_www(jit_code_movr_ww_d, u, v, w) |
| 891 | jit_code_movr_w_d, /* w -> d */ |
| 892 | #define jit_movr_w_d(u, v) jit_new_node_ww(jit_code_movr_w_d, u, v) |
| 893 | |
| 894 | jit_code_movr_f_w, jit_code_movi_f_w, /* f|d -> w* */ |
| 895 | #define jit_movr_f_w(u, v) jit_new_node_ww(jit_code_movr_f_w, u, v) |
| 896 | #define jit_movi_f_w(u, v) jit_new_node_wf(jit_code_movi_f_w, u, v) |
| 897 | jit_code_movr_d_ww, jit_code_movi_d_ww, |
| 898 | #define jit_movr_d_ww(u, v, w) jit_new_node_www(jit_code_movr_d_ww, u, v, w) |
| 899 | #define jit_movi_d_ww(u, v, w) jit_new_node_wwd(jit_code_movi_d_ww, u, v, w) |
| 900 | |
| 901 | jit_code_movr_d_w, jit_code_movi_d_w, /* d -> w */ |
| 902 | #define jit_movr_d_w(u, v) jit_new_node_ww(jit_code_movr_d_w, u, v) |
| 903 | #define jit_movi_d_w(u, v) jit_new_node_wd(jit_code_movi_d_w, u, v) |
| 904 | |
| 905 | #define jit_bswapr_us(u,v) jit_new_node_ww(jit_code_bswapr_us,u,v) |
| 906 | jit_code_bswapr_us, |
| 907 | #define jit_bswapr_ui(u,v) jit_new_node_ww(jit_code_bswapr_ui,u,v) |
| 908 | jit_code_bswapr_ui, |
| 909 | #define jit_bswapr_ul(u,v) jit_new_node_ww(jit_code_bswapr_ul,u,v) |
| 910 | jit_code_bswapr_ul, |
| 911 | #if __WORDSIZE == 32 |
| 912 | #define jit_bswapr(u,v) jit_new_node_ww(jit_code_bswapr_ui,u,v) |
| 913 | #else |
| 914 | #define jit_bswapr(u,v) jit_new_node_ww(jit_code_bswapr_ul,u,v) |
| 915 | #endif |
| 916 | |
| 917 | jit_code_casr, jit_code_casi, |
| 918 | #define jit_casr(u, v, w, x) jit_new_node_wwq(jit_code_casr, u, v, w, x) |
| 919 | #define jit_casi(u, v, w, x) jit_new_node_wwq(jit_code_casi, u, v, w, x) |
| 920 | |
| 921 | jit_code_last_code |
| 922 | } jit_code_t; |
| 923 | |
| 924 | typedef void* (*jit_alloc_func_ptr) (size_t); |
| 925 | typedef void* (*jit_realloc_func_ptr) (void*, size_t); |
| 926 | typedef void (*jit_free_func_ptr) (void*); |
| 927 | |
| 928 | /* |
| 929 | * Prototypes |
| 930 | */ |
| 931 | extern void init_jit(const char*); |
| 932 | extern void finish_jit(void); |
| 933 | |
| 934 | extern jit_state_t *jit_new_state(void); |
| 935 | #define jit_clear_state() _jit_clear_state(_jit) |
| 936 | extern void _jit_clear_state(jit_state_t*); |
| 937 | #define jit_destroy_state() _jit_destroy_state(_jit) |
| 938 | extern void _jit_destroy_state(jit_state_t*); |
| 939 | |
| 940 | #define jit_address(node) _jit_address(_jit, node) |
| 941 | extern jit_pointer_t _jit_address(jit_state_t*, jit_node_t*); |
| 942 | extern jit_node_t *_jit_name(jit_state_t*, const char*); |
| 943 | extern jit_node_t *_jit_note(jit_state_t*, const char*, int); |
| 944 | extern jit_node_t *_jit_label(jit_state_t*); |
| 945 | extern jit_node_t *_jit_forward(jit_state_t*); |
| 946 | extern jit_node_t *_jit_indirect(jit_state_t*); |
| 947 | extern void _jit_link(jit_state_t*, jit_node_t*); |
| 948 | #define jit_forward_p(u) _jit_forward_p(_jit,u) |
| 949 | extern jit_bool_t _jit_forward_p(jit_state_t*,jit_node_t*); |
| 950 | #define jit_indirect_p(u) _jit_indirect_p(_jit,u) |
| 951 | extern jit_bool_t _jit_indirect_p(jit_state_t*,jit_node_t*); |
| 952 | #define jit_target_p(u) _jit_target_p(_jit,u) |
| 953 | extern jit_bool_t _jit_target_p(jit_state_t*,jit_node_t*); |
| 954 | |
| 955 | extern void _jit_prolog(jit_state_t*); |
| 956 | |
| 957 | extern jit_int32_t _jit_allocai(jit_state_t*, jit_int32_t); |
| 958 | extern void _jit_allocar(jit_state_t*, jit_int32_t, jit_int32_t); |
| 959 | extern void _jit_ellipsis(jit_state_t*); |
| 960 | |
| 961 | extern jit_node_t *_jit_arg(jit_state_t*); |
| 962 | extern void _jit_getarg_c(jit_state_t*, jit_gpr_t, jit_node_t*); |
| 963 | extern void _jit_getarg_uc(jit_state_t*, jit_gpr_t, jit_node_t*); |
| 964 | extern void _jit_getarg_s(jit_state_t*, jit_gpr_t, jit_node_t*); |
| 965 | extern void _jit_getarg_us(jit_state_t*, jit_gpr_t, jit_node_t*); |
| 966 | extern void _jit_getarg_i(jit_state_t*, jit_gpr_t, jit_node_t*); |
| 967 | #if __WORDSIZE == 64 |
| 968 | extern void _jit_getarg_ui(jit_state_t*, jit_gpr_t, jit_node_t*); |
| 969 | extern void _jit_getarg_l(jit_state_t*, jit_gpr_t, jit_node_t*); |
| 970 | #endif |
| 971 | extern void _jit_putargr(jit_state_t*, jit_gpr_t, jit_node_t*); |
| 972 | extern void _jit_putargi(jit_state_t*, jit_word_t, jit_node_t*); |
| 973 | |
| 974 | extern void _jit_prepare(jit_state_t*); |
| 975 | extern void _jit_ellipsis(jit_state_t*); |
| 976 | extern void _jit_va_push(jit_state_t*, jit_gpr_t); |
| 977 | extern void _jit_pushargr(jit_state_t*, jit_gpr_t); |
| 978 | extern void _jit_pushargi(jit_state_t*, jit_word_t); |
| 979 | extern void _jit_finishr(jit_state_t*, jit_gpr_t); |
| 980 | extern jit_node_t *_jit_finishi(jit_state_t*, jit_pointer_t); |
| 981 | extern void _jit_ret(jit_state_t*); |
| 982 | extern void _jit_retr(jit_state_t*, jit_gpr_t); |
| 983 | extern void _jit_reti(jit_state_t*, jit_word_t); |
| 984 | extern void _jit_retval_c(jit_state_t*, jit_gpr_t); |
| 985 | extern void _jit_retval_uc(jit_state_t*, jit_gpr_t); |
| 986 | extern void _jit_retval_s(jit_state_t*, jit_gpr_t); |
| 987 | extern void _jit_retval_us(jit_state_t*, jit_gpr_t); |
| 988 | extern void _jit_retval_i(jit_state_t*, jit_gpr_t); |
| 989 | #if __WORDSIZE == 64 |
| 990 | extern void _jit_retval_ui(jit_state_t*, jit_gpr_t); |
| 991 | extern void _jit_retval_l(jit_state_t*, jit_gpr_t); |
| 992 | #endif |
| 993 | extern void _jit_epilog(jit_state_t*); |
| 994 | |
| 995 | #define jit_patch(u) _jit_patch(_jit,u) |
| 996 | extern void _jit_patch(jit_state_t*, jit_node_t*); |
| 997 | #define jit_patch_at(u,v) _jit_patch_at(_jit,u,v) |
| 998 | extern void _jit_patch_at(jit_state_t*, jit_node_t*, jit_node_t*); |
| 999 | #define jit_patch_abs(u,v) _jit_patch_abs(_jit,u,v) |
| 1000 | extern void _jit_patch_abs(jit_state_t*, jit_node_t*, jit_pointer_t); |
| 1001 | #define jit_realize() _jit_realize(_jit) |
| 1002 | extern void _jit_realize(jit_state_t*); |
| 1003 | #define jit_get_code(u) _jit_get_code(_jit,u) |
| 1004 | extern jit_pointer_t _jit_get_code(jit_state_t*, jit_word_t*); |
| 1005 | #define jit_set_code(u,v) _jit_set_code(_jit,u,v) |
| 1006 | extern void _jit_set_code(jit_state_t*, jit_pointer_t, jit_word_t); |
| 1007 | #define jit_get_data(u,v) _jit_get_data(_jit,u,v) |
| 1008 | extern jit_pointer_t _jit_get_data(jit_state_t*, jit_word_t*, jit_word_t*); |
| 1009 | #define jit_set_data(u,v,w) _jit_set_data(_jit,u,v,w) |
| 1010 | extern void _jit_set_data(jit_state_t*, jit_pointer_t, jit_word_t, jit_word_t); |
| 1011 | #define jit_frame(u) _jit_frame(_jit,u) |
| 1012 | extern void _jit_frame(jit_state_t*, jit_int32_t); |
| 1013 | #define jit_tramp(u) _jit_tramp(_jit,u) |
| 1014 | extern void _jit_tramp(jit_state_t*, jit_int32_t); |
| 1015 | #define jit_emit() _jit_emit(_jit) |
| 1016 | extern jit_pointer_t _jit_emit(jit_state_t*); |
| 1017 | |
| 1018 | #define jit_print() _jit_print(_jit) |
| 1019 | extern void _jit_print(jit_state_t*); |
| 1020 | |
| 1021 | extern jit_node_t *_jit_arg_f(jit_state_t*); |
| 1022 | extern void _jit_getarg_f(jit_state_t*, jit_fpr_t, jit_node_t*); |
| 1023 | extern void _jit_putargr_f(jit_state_t*, jit_fpr_t, jit_node_t*); |
| 1024 | extern void _jit_putargi_f(jit_state_t*, jit_float32_t, jit_node_t*); |
| 1025 | extern void _jit_pushargr_f(jit_state_t*, jit_fpr_t); |
| 1026 | extern void _jit_pushargi_f(jit_state_t*, jit_float32_t); |
| 1027 | extern void _jit_retr_f(jit_state_t*, jit_fpr_t); |
| 1028 | extern void _jit_reti_f(jit_state_t*, jit_float32_t); |
| 1029 | extern void _jit_retval_f(jit_state_t*, jit_fpr_t); |
| 1030 | |
| 1031 | extern jit_node_t *_jit_arg_d(jit_state_t*); |
| 1032 | extern void _jit_getarg_d(jit_state_t*, jit_fpr_t, jit_node_t*); |
| 1033 | extern void _jit_putargr_d(jit_state_t*, jit_fpr_t, jit_node_t*); |
| 1034 | extern void _jit_putargi_d(jit_state_t*, jit_float64_t, jit_node_t*); |
| 1035 | extern void _jit_pushargr_d(jit_state_t*, jit_fpr_t); |
| 1036 | extern void _jit_pushargi_d(jit_state_t*, jit_float64_t); |
| 1037 | extern void _jit_retr_d(jit_state_t*, jit_fpr_t); |
| 1038 | extern void _jit_reti_d(jit_state_t*, jit_float64_t); |
| 1039 | extern void _jit_retval_d(jit_state_t*, jit_fpr_t); |
| 1040 | |
| 1041 | #define jit_get_reg(s) _jit_get_reg(_jit,s) |
| 1042 | extern jit_int32_t _jit_get_reg(jit_state_t*, jit_int32_t); |
| 1043 | |
| 1044 | #define jit_unget_reg(r) _jit_unget_reg(_jit,r) |
| 1045 | extern void _jit_unget_reg(jit_state_t*, jit_int32_t); |
| 1046 | |
| 1047 | #define jit_new_node(c) _jit_new_node(_jit,c) |
| 1048 | extern jit_node_t *_jit_new_node(jit_state_t*, jit_code_t); |
| 1049 | #define jit_new_node_w(c,u) _jit_new_node_w(_jit,c,u) |
| 1050 | extern jit_node_t *_jit_new_node_w(jit_state_t*, jit_code_t, |
| 1051 | jit_word_t); |
| 1052 | #define jit_new_node_f(c,u) _jit_new_node_f(_jit,c,u) |
| 1053 | extern jit_node_t *_jit_new_node_f(jit_state_t*, jit_code_t, |
| 1054 | jit_float32_t); |
| 1055 | #define jit_new_node_d(c,u) _jit_new_node_d(_jit,c,u) |
| 1056 | extern jit_node_t *_jit_new_node_d(jit_state_t*, jit_code_t, |
| 1057 | jit_float64_t); |
| 1058 | #define jit_new_node_p(c,u) _jit_new_node_p(_jit,c,u) |
| 1059 | extern jit_node_t *_jit_new_node_p(jit_state_t*, jit_code_t, |
| 1060 | jit_pointer_t); |
| 1061 | #define jit_new_node_ww(c,u,v) _jit_new_node_ww(_jit,c,u,v) |
| 1062 | extern jit_node_t *_jit_new_node_ww(jit_state_t*,jit_code_t, |
| 1063 | jit_word_t, jit_word_t); |
| 1064 | #define jit_new_node_wp(c,u,v) _jit_new_node_wp(_jit,c,u,v) |
| 1065 | extern jit_node_t *_jit_new_node_wp(jit_state_t*,jit_code_t, |
| 1066 | jit_word_t, jit_pointer_t); |
| 1067 | #define jit_new_node_fp(c,u,v) _jit_new_node_fp(_jit,c,u,v) |
| 1068 | extern jit_node_t *_jit_new_node_fp(jit_state_t*,jit_code_t, |
| 1069 | jit_float32_t, jit_pointer_t); |
| 1070 | #define jit_new_node_dp(c,u,v) _jit_new_node_dp(_jit,c,u,v) |
| 1071 | extern jit_node_t *_jit_new_node_dp(jit_state_t*,jit_code_t, |
| 1072 | jit_float64_t, jit_pointer_t); |
| 1073 | #define jit_new_node_pw(c,u,v) _jit_new_node_pw(_jit,c,u,v) |
| 1074 | extern jit_node_t *_jit_new_node_pw(jit_state_t*,jit_code_t, |
| 1075 | jit_pointer_t, jit_word_t); |
| 1076 | #define jit_new_node_wf(c,u,v) _jit_new_node_wf(_jit,c,u,v) |
| 1077 | extern jit_node_t *_jit_new_node_wf(jit_state_t*, jit_code_t, |
| 1078 | jit_word_t, jit_float32_t); |
| 1079 | #define jit_new_node_wd(c,u,v) _jit_new_node_wd(_jit,c,u,v) |
| 1080 | extern jit_node_t *_jit_new_node_wd(jit_state_t*, jit_code_t, |
| 1081 | jit_word_t, jit_float64_t); |
| 1082 | #define jit_new_node_www(c,u,v,w) _jit_new_node_www(_jit,c,u,v,w) |
| 1083 | extern jit_node_t *_jit_new_node_www(jit_state_t*, jit_code_t, |
| 1084 | jit_word_t, jit_word_t, jit_word_t); |
| 1085 | #define jit_new_node_qww(c,l,h,v,w) _jit_new_node_qww(_jit,c,l,h,v,w) |
| 1086 | extern jit_node_t *_jit_new_node_qww(jit_state_t*, jit_code_t, |
| 1087 | jit_int32_t, jit_int32_t, |
| 1088 | jit_word_t, jit_word_t); |
| 1089 | #define jit_new_node_wwq(c,u,v,l,h) _jit_new_node_wwq(_jit,c,u,v,l,h) |
| 1090 | extern jit_node_t *_jit_new_node_wwq(jit_state_t*, jit_code_t, |
| 1091 | jit_word_t, jit_word_t, |
| 1092 | jit_int32_t, jit_int32_t); |
| 1093 | #define jit_new_node_wwf(c,u,v,w) _jit_new_node_wwf(_jit,c,u,v,w) |
| 1094 | extern jit_node_t *_jit_new_node_wwf(jit_state_t*, jit_code_t, |
| 1095 | jit_word_t, jit_word_t, jit_float32_t); |
| 1096 | #define jit_new_node_wwd(c,u,v,w) _jit_new_node_wwd(_jit,c,u,v,w) |
| 1097 | extern jit_node_t *_jit_new_node_wwd(jit_state_t*, jit_code_t, |
| 1098 | jit_word_t, jit_word_t, jit_float64_t); |
| 1099 | #define jit_new_node_pww(c,u,v,w) _jit_new_node_pww(_jit,c,u,v,w) |
| 1100 | extern jit_node_t *_jit_new_node_pww(jit_state_t*, jit_code_t, |
| 1101 | jit_pointer_t, jit_word_t, jit_word_t); |
| 1102 | #define jit_new_node_pwf(c,u,v,w) _jit_new_node_pwf(_jit,c,u,v,w) |
| 1103 | extern jit_node_t *_jit_new_node_pwf(jit_state_t*, jit_code_t, |
| 1104 | jit_pointer_t, jit_word_t, jit_float32_t); |
| 1105 | #define jit_new_node_pwd(c,u,v,w) _jit_new_node_pwd(_jit,c,u,v,w) |
| 1106 | extern jit_node_t *_jit_new_node_pwd(jit_state_t*, jit_code_t, |
| 1107 | jit_pointer_t, jit_word_t, jit_float64_t); |
| 1108 | |
| 1109 | #define jit_arg_register_p(u) _jit_arg_register_p(_jit,u) |
| 1110 | extern jit_bool_t _jit_arg_register_p(jit_state_t*, jit_node_t*); |
| 1111 | #define jit_callee_save_p(u) _jit_callee_save_p(_jit,u) |
| 1112 | extern jit_bool_t _jit_callee_save_p(jit_state_t*, jit_int32_t); |
| 1113 | #define jit_pointer_p(u) _jit_pointer_p(_jit,u) |
| 1114 | extern jit_bool_t _jit_pointer_p(jit_state_t*,jit_pointer_t); |
| 1115 | |
| 1116 | #define jit_get_note(n,u,v,w) _jit_get_note(_jit,n,u,v,w) |
| 1117 | extern jit_bool_t _jit_get_note(jit_state_t*,jit_pointer_t,char**,char**,int*); |
| 1118 | |
| 1119 | #define jit_disassemble() _jit_disassemble(_jit) |
| 1120 | extern void _jit_disassemble(jit_state_t*); |
| 1121 | |
| 1122 | extern void jit_set_memory_functions(jit_alloc_func_ptr, |
| 1123 | jit_realloc_func_ptr, |
| 1124 | jit_free_func_ptr); |
| 1125 | extern void jit_get_memory_functions(jit_alloc_func_ptr*, |
| 1126 | jit_realloc_func_ptr*, |
| 1127 | jit_free_func_ptr*); |
| 1128 | |
| 1129 | #endif /* _lightning_h */ |