github.com/goccy/go-jit@v0.0.0-20200514131505-ff78d45cf6af/internal/ccall/jit-symbol.c (about) 1 /* 2 * jit-symbol.c - Table of registered intrinsic symbols. 3 * 4 * Copyright (C) 2004 Southern Storm Software, Pty Ltd. 5 * 6 * This file is part of the libjit library. 7 * 8 * The libjit library is free software: you can redistribute it and/or 9 * modify it under the terms of the GNU Lesser General Public License 10 * as published by the Free Software Foundation, either version 2.1 of 11 * the License, or (at your option) any later version. 12 * 13 * The libjit library is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * Lesser General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with the libjit library. If not, see 20 * <http://www.gnu.org/licenses/>. 21 */ 22 23 #include "jit-internal.h" 24 25 /* 26 * This list must be sorted, so that a binary search can be used on it. 27 */ 28 typedef struct 29 { 30 const char *name; 31 void *value; 32 33 } jit_internalsym; 34 jit_internalsym const _jit_internal_symbols[] = { 35 {"jit_exception_builtin", (void *)jit_exception_builtin}, 36 {"jit_exception_get_stack_trace", (void *)jit_exception_get_stack_trace}, 37 {"jit_exception_throw", (void *)jit_exception_throw}, 38 {"jit_float32_abs", (void *)jit_float32_abs}, 39 {"jit_float32_acos", (void *)jit_float32_acos}, 40 {"jit_float32_add", (void *)jit_float32_add}, 41 {"jit_float32_asin", (void *)jit_float32_asin}, 42 {"jit_float32_atan", (void *)jit_float32_atan}, 43 {"jit_float32_atan2", (void *)jit_float32_atan2}, 44 {"jit_float32_ceil", (void *)jit_float32_ceil}, 45 {"jit_float32_cmpg", (void *)jit_float32_cmpg}, 46 {"jit_float32_cmpl", (void *)jit_float32_cmpl}, 47 {"jit_float32_cos", (void *)jit_float32_cos}, 48 {"jit_float32_cosh", (void *)jit_float32_cosh}, 49 {"jit_float32_div", (void *)jit_float32_div}, 50 {"jit_float32_eq", (void *)jit_float32_eq}, 51 {"jit_float32_exp", (void *)jit_float32_exp}, 52 {"jit_float32_floor", (void *)jit_float32_floor}, 53 {"jit_float32_ge", (void *)jit_float32_ge}, 54 {"jit_float32_gt", (void *)jit_float32_gt}, 55 {"jit_float32_ieee_rem", (void *)jit_float32_ieee_rem}, 56 {"jit_float32_is_finite", (void *)jit_float32_is_finite}, 57 {"jit_float32_is_inf", (void *)jit_float32_is_inf}, 58 {"jit_float32_is_nan", (void *)jit_float32_is_nan}, 59 {"jit_float32_le", (void *)jit_float32_le}, 60 {"jit_float32_log", (void *)jit_float32_log}, 61 {"jit_float32_log10", (void *)jit_float32_log10}, 62 {"jit_float32_lt", (void *)jit_float32_lt}, 63 {"jit_float32_max", (void *)jit_float32_max}, 64 {"jit_float32_min", (void *)jit_float32_min}, 65 {"jit_float32_mul", (void *)jit_float32_mul}, 66 {"jit_float32_ne", (void *)jit_float32_ne}, 67 {"jit_float32_neg", (void *)jit_float32_neg}, 68 {"jit_float32_pow", (void *)jit_float32_pow}, 69 {"jit_float32_rem", (void *)jit_float32_rem}, 70 {"jit_float32_rint", (void *)jit_float32_rint}, 71 {"jit_float32_round", (void *)jit_float32_round}, 72 {"jit_float32_sign", (void *)jit_float32_sign}, 73 {"jit_float32_sin", (void *)jit_float32_sin}, 74 {"jit_float32_sinh", (void *)jit_float32_sinh}, 75 {"jit_float32_sqrt", (void *)jit_float32_sqrt}, 76 {"jit_float32_sub", (void *)jit_float32_sub}, 77 {"jit_float32_tan", (void *)jit_float32_tan}, 78 {"jit_float32_tanh", (void *)jit_float32_tanh}, 79 {"jit_float32_to_float64", (void *)jit_float32_to_float64}, 80 {"jit_float32_to_int", (void *)jit_float32_to_int}, 81 {"jit_float32_to_int_ovf", (void *)jit_float32_to_int_ovf}, 82 {"jit_float32_to_long", (void *)jit_float32_to_long}, 83 {"jit_float32_to_long_ovf", (void *)jit_float32_to_long_ovf}, 84 {"jit_float32_to_nfloat", (void *)jit_float32_to_nfloat}, 85 {"jit_float32_to_uint", (void *)jit_float32_to_uint}, 86 {"jit_float32_to_uint_ovf", (void *)jit_float32_to_uint_ovf}, 87 {"jit_float32_to_ulong", (void *)jit_float32_to_ulong}, 88 {"jit_float32_to_ulong_ovf", (void *)jit_float32_to_ulong_ovf}, 89 {"jit_float32_trunc", (void *)jit_float32_trunc}, 90 {"jit_float64_abs", (void *)jit_float64_abs}, 91 {"jit_float64_acos", (void *)jit_float64_acos}, 92 {"jit_float64_add", (void *)jit_float64_add}, 93 {"jit_float64_asin", (void *)jit_float64_asin}, 94 {"jit_float64_atan", (void *)jit_float64_atan}, 95 {"jit_float64_atan2", (void *)jit_float64_atan2}, 96 {"jit_float64_ceil", (void *)jit_float64_ceil}, 97 {"jit_float64_cmpg", (void *)jit_float64_cmpg}, 98 {"jit_float64_cmpl", (void *)jit_float64_cmpl}, 99 {"jit_float64_cos", (void *)jit_float64_cos}, 100 {"jit_float64_cosh", (void *)jit_float64_cosh}, 101 {"jit_float64_div", (void *)jit_float64_div}, 102 {"jit_float64_eq", (void *)jit_float64_eq}, 103 {"jit_float64_exp", (void *)jit_float64_exp}, 104 {"jit_float64_floor", (void *)jit_float64_floor}, 105 {"jit_float64_ge", (void *)jit_float64_ge}, 106 {"jit_float64_gt", (void *)jit_float64_gt}, 107 {"jit_float64_ieee_rem", (void *)jit_float64_ieee_rem}, 108 {"jit_float64_is_finite", (void *)jit_float64_is_finite}, 109 {"jit_float64_is_inf", (void *)jit_float64_is_inf}, 110 {"jit_float64_is_nan", (void *)jit_float64_is_nan}, 111 {"jit_float64_le", (void *)jit_float64_le}, 112 {"jit_float64_log", (void *)jit_float64_log}, 113 {"jit_float64_log10", (void *)jit_float64_log10}, 114 {"jit_float64_lt", (void *)jit_float64_lt}, 115 {"jit_float64_max", (void *)jit_float64_max}, 116 {"jit_float64_min", (void *)jit_float64_min}, 117 {"jit_float64_mul", (void *)jit_float64_mul}, 118 {"jit_float64_ne", (void *)jit_float64_ne}, 119 {"jit_float64_neg", (void *)jit_float64_neg}, 120 {"jit_float64_pow", (void *)jit_float64_pow}, 121 {"jit_float64_rem", (void *)jit_float64_rem}, 122 {"jit_float64_rint", (void *)jit_float64_rint}, 123 {"jit_float64_round", (void *)jit_float64_round}, 124 {"jit_float64_sign", (void *)jit_float64_sign}, 125 {"jit_float64_sin", (void *)jit_float64_sin}, 126 {"jit_float64_sinh", (void *)jit_float64_sinh}, 127 {"jit_float64_sqrt", (void *)jit_float64_sqrt}, 128 {"jit_float64_sub", (void *)jit_float64_sub}, 129 {"jit_float64_tan", (void *)jit_float64_tan}, 130 {"jit_float64_tanh", (void *)jit_float64_tanh}, 131 {"jit_float64_to_float32", (void *)jit_float64_to_float32}, 132 {"jit_float64_to_int", (void *)jit_float64_to_int}, 133 {"jit_float64_to_int_ovf", (void *)jit_float64_to_int_ovf}, 134 {"jit_float64_to_long", (void *)jit_float64_to_long}, 135 {"jit_float64_to_long_ovf", (void *)jit_float64_to_long_ovf}, 136 {"jit_float64_to_nfloat", (void *)jit_float64_to_nfloat}, 137 {"jit_float64_to_uint", (void *)jit_float64_to_uint}, 138 {"jit_float64_to_uint_ovf", (void *)jit_float64_to_uint_ovf}, 139 {"jit_float64_to_ulong", (void *)jit_float64_to_ulong}, 140 {"jit_float64_to_ulong_ovf", (void *)jit_float64_to_ulong_ovf}, 141 {"jit_float64_trunc", (void *)jit_float64_trunc}, 142 {"jit_int_abs", (void *)jit_int_abs}, 143 {"jit_int_add", (void *)jit_int_add}, 144 {"jit_int_add_ovf", (void *)jit_int_add_ovf}, 145 {"jit_int_and", (void *)jit_int_and}, 146 {"jit_int_cmp", (void *)jit_int_cmp}, 147 {"jit_int_div", (void *)jit_int_div}, 148 {"jit_int_eq", (void *)jit_int_eq}, 149 {"jit_int_ge", (void *)jit_int_ge}, 150 {"jit_int_gt", (void *)jit_int_gt}, 151 {"jit_int_le", (void *)jit_int_le}, 152 {"jit_int_lt", (void *)jit_int_lt}, 153 {"jit_int_max", (void *)jit_int_max}, 154 {"jit_int_min", (void *)jit_int_min}, 155 {"jit_int_mul", (void *)jit_int_mul}, 156 {"jit_int_mul_ovf", (void *)jit_int_mul_ovf}, 157 {"jit_int_ne", (void *)jit_int_ne}, 158 {"jit_int_neg", (void *)jit_int_neg}, 159 {"jit_int_not", (void *)jit_int_not}, 160 {"jit_int_or", (void *)jit_int_or}, 161 {"jit_int_rem", (void *)jit_int_rem}, 162 {"jit_int_shl", (void *)jit_int_shl}, 163 {"jit_int_shr", (void *)jit_int_shr}, 164 {"jit_int_sign", (void *)jit_int_sign}, 165 {"jit_int_sub", (void *)jit_int_sub}, 166 {"jit_int_sub_ovf", (void *)jit_int_sub_ovf}, 167 {"jit_int_to_float32", (void *)jit_int_to_float32}, 168 {"jit_int_to_float64", (void *)jit_int_to_float64}, 169 {"jit_int_to_int", (void *)jit_int_to_int}, 170 {"jit_int_to_int_ovf", (void *)jit_int_to_int_ovf}, 171 {"jit_int_to_long", (void *)jit_int_to_long}, 172 {"jit_int_to_long_ovf", (void *)jit_int_to_long_ovf}, 173 {"jit_int_to_nfloat", (void *)jit_int_to_nfloat}, 174 {"jit_int_to_sbyte", (void *)jit_int_to_sbyte}, 175 {"jit_int_to_sbyte_ovf", (void *)jit_int_to_sbyte_ovf}, 176 {"jit_int_to_short", (void *)jit_int_to_short}, 177 {"jit_int_to_short_ovf", (void *)jit_int_to_short_ovf}, 178 {"jit_int_to_ubyte", (void *)jit_int_to_ubyte}, 179 {"jit_int_to_ubyte_ovf", (void *)jit_int_to_ubyte_ovf}, 180 {"jit_int_to_uint", (void *)jit_int_to_uint}, 181 {"jit_int_to_uint_ovf", (void *)jit_int_to_uint_ovf}, 182 {"jit_int_to_ulong", (void *)jit_int_to_ulong}, 183 {"jit_int_to_ulong_ovf", (void *)jit_int_to_ulong_ovf}, 184 {"jit_int_to_ushort", (void *)jit_int_to_ushort}, 185 {"jit_int_to_ushort_ovf", (void *)jit_int_to_ushort_ovf}, 186 {"jit_int_xor", (void *)jit_int_xor}, 187 {"jit_long_abs", (void *)jit_long_abs}, 188 {"jit_long_add", (void *)jit_long_add}, 189 {"jit_long_add_ovf", (void *)jit_long_add_ovf}, 190 {"jit_long_and", (void *)jit_long_and}, 191 {"jit_long_cmp", (void *)jit_long_cmp}, 192 {"jit_long_div", (void *)jit_long_div}, 193 {"jit_long_eq", (void *)jit_long_eq}, 194 {"jit_long_ge", (void *)jit_long_ge}, 195 {"jit_long_gt", (void *)jit_long_gt}, 196 {"jit_long_le", (void *)jit_long_le}, 197 {"jit_long_lt", (void *)jit_long_lt}, 198 {"jit_long_max", (void *)jit_long_max}, 199 {"jit_long_min", (void *)jit_long_min}, 200 {"jit_long_mul", (void *)jit_long_mul}, 201 {"jit_long_mul_ovf", (void *)jit_long_mul_ovf}, 202 {"jit_long_ne", (void *)jit_long_ne}, 203 {"jit_long_neg", (void *)jit_long_neg}, 204 {"jit_long_not", (void *)jit_long_not}, 205 {"jit_long_or", (void *)jit_long_or}, 206 {"jit_long_rem", (void *)jit_long_rem}, 207 {"jit_long_shl", (void *)jit_long_shl}, 208 {"jit_long_shr", (void *)jit_long_shr}, 209 {"jit_long_sign", (void *)jit_long_sign}, 210 {"jit_long_sub", (void *)jit_long_sub}, 211 {"jit_long_sub_ovf", (void *)jit_long_sub_ovf}, 212 {"jit_long_to_float32", (void *)jit_long_to_float32}, 213 {"jit_long_to_float64", (void *)jit_long_to_float64}, 214 {"jit_long_to_int", (void *)jit_long_to_int}, 215 {"jit_long_to_int_ovf", (void *)jit_long_to_int_ovf}, 216 {"jit_long_to_long", (void *)jit_long_to_long}, 217 {"jit_long_to_long_ovf", (void *)jit_long_to_long_ovf}, 218 {"jit_long_to_nfloat", (void *)jit_long_to_nfloat}, 219 {"jit_long_to_uint", (void *)jit_long_to_uint}, 220 {"jit_long_to_uint_ovf", (void *)jit_long_to_uint_ovf}, 221 {"jit_long_to_ulong", (void *)jit_long_to_ulong}, 222 {"jit_long_to_ulong_ovf", (void *)jit_long_to_ulong_ovf}, 223 {"jit_long_xor", (void *)jit_long_xor}, 224 {"jit_nfloat_abs", (void *)jit_nfloat_abs}, 225 {"jit_nfloat_acos", (void *)jit_nfloat_acos}, 226 {"jit_nfloat_add", (void *)jit_nfloat_add}, 227 {"jit_nfloat_asin", (void *)jit_nfloat_asin}, 228 {"jit_nfloat_atan", (void *)jit_nfloat_atan}, 229 {"jit_nfloat_atan2", (void *)jit_nfloat_atan2}, 230 {"jit_nfloat_ceil", (void *)jit_nfloat_ceil}, 231 {"jit_nfloat_cmpg", (void *)jit_nfloat_cmpg}, 232 {"jit_nfloat_cmpl", (void *)jit_nfloat_cmpl}, 233 {"jit_nfloat_cos", (void *)jit_nfloat_cos}, 234 {"jit_nfloat_cosh", (void *)jit_nfloat_cosh}, 235 {"jit_nfloat_div", (void *)jit_nfloat_div}, 236 {"jit_nfloat_eq", (void *)jit_nfloat_eq}, 237 {"jit_nfloat_exp", (void *)jit_nfloat_exp}, 238 {"jit_nfloat_floor", (void *)jit_nfloat_floor}, 239 {"jit_nfloat_ge", (void *)jit_nfloat_ge}, 240 {"jit_nfloat_gt", (void *)jit_nfloat_gt}, 241 {"jit_nfloat_ieee_rem", (void *)jit_nfloat_ieee_rem}, 242 {"jit_nfloat_is_finite", (void *)jit_nfloat_is_finite}, 243 {"jit_nfloat_is_inf", (void *)jit_nfloat_is_inf}, 244 {"jit_nfloat_is_nan", (void *)jit_nfloat_is_nan}, 245 {"jit_nfloat_le", (void *)jit_nfloat_le}, 246 {"jit_nfloat_log", (void *)jit_nfloat_log}, 247 {"jit_nfloat_log10", (void *)jit_nfloat_log10}, 248 {"jit_nfloat_lt", (void *)jit_nfloat_lt}, 249 {"jit_nfloat_max", (void *)jit_nfloat_max}, 250 {"jit_nfloat_min", (void *)jit_nfloat_min}, 251 {"jit_nfloat_mul", (void *)jit_nfloat_mul}, 252 {"jit_nfloat_ne", (void *)jit_nfloat_ne}, 253 {"jit_nfloat_neg", (void *)jit_nfloat_neg}, 254 {"jit_nfloat_pow", (void *)jit_nfloat_pow}, 255 {"jit_nfloat_rem", (void *)jit_nfloat_rem}, 256 {"jit_nfloat_rint", (void *)jit_nfloat_rint}, 257 {"jit_nfloat_round", (void *)jit_nfloat_round}, 258 {"jit_nfloat_sign", (void *)jit_nfloat_sign}, 259 {"jit_nfloat_sin", (void *)jit_nfloat_sin}, 260 {"jit_nfloat_sinh", (void *)jit_nfloat_sinh}, 261 {"jit_nfloat_sqrt", (void *)jit_nfloat_sqrt}, 262 {"jit_nfloat_sub", (void *)jit_nfloat_sub}, 263 {"jit_nfloat_tan", (void *)jit_nfloat_tan}, 264 {"jit_nfloat_tanh", (void *)jit_nfloat_tanh}, 265 {"jit_nfloat_to_float32", (void *)jit_nfloat_to_float32}, 266 {"jit_nfloat_to_float64", (void *)jit_nfloat_to_float64}, 267 {"jit_nfloat_to_int", (void *)jit_nfloat_to_int}, 268 {"jit_nfloat_to_int_ovf", (void *)jit_nfloat_to_int_ovf}, 269 {"jit_nfloat_to_long", (void *)jit_nfloat_to_long}, 270 {"jit_nfloat_to_long_ovf", (void *)jit_nfloat_to_long_ovf}, 271 {"jit_nfloat_to_uint", (void *)jit_nfloat_to_uint}, 272 {"jit_nfloat_to_uint_ovf", (void *)jit_nfloat_to_uint_ovf}, 273 {"jit_nfloat_to_ulong", (void *)jit_nfloat_to_ulong}, 274 {"jit_nfloat_to_ulong_ovf", (void *)jit_nfloat_to_ulong_ovf}, 275 {"jit_nfloat_trunc", (void *)jit_nfloat_trunc}, 276 {"jit_uint_add", (void *)jit_uint_add}, 277 {"jit_uint_add_ovf", (void *)jit_uint_add_ovf}, 278 {"jit_uint_and", (void *)jit_uint_and}, 279 {"jit_uint_cmp", (void *)jit_uint_cmp}, 280 {"jit_uint_div", (void *)jit_uint_div}, 281 {"jit_uint_eq", (void *)jit_uint_eq}, 282 {"jit_uint_ge", (void *)jit_uint_ge}, 283 {"jit_uint_gt", (void *)jit_uint_gt}, 284 {"jit_uint_le", (void *)jit_uint_le}, 285 {"jit_uint_lt", (void *)jit_uint_lt}, 286 {"jit_uint_max", (void *)jit_uint_max}, 287 {"jit_uint_min", (void *)jit_uint_min}, 288 {"jit_uint_mul", (void *)jit_uint_mul}, 289 {"jit_uint_mul_ovf", (void *)jit_uint_mul_ovf}, 290 {"jit_uint_ne", (void *)jit_uint_ne}, 291 {"jit_uint_neg", (void *)jit_uint_neg}, 292 {"jit_uint_not", (void *)jit_uint_not}, 293 {"jit_uint_or", (void *)jit_uint_or}, 294 {"jit_uint_rem", (void *)jit_uint_rem}, 295 {"jit_uint_shl", (void *)jit_uint_shl}, 296 {"jit_uint_shr", (void *)jit_uint_shr}, 297 {"jit_uint_sub", (void *)jit_uint_sub}, 298 {"jit_uint_sub_ovf", (void *)jit_uint_sub_ovf}, 299 {"jit_uint_to_float32", (void *)jit_uint_to_float32}, 300 {"jit_uint_to_float64", (void *)jit_uint_to_float64}, 301 {"jit_uint_to_int", (void *)jit_uint_to_int}, 302 {"jit_uint_to_int_ovf", (void *)jit_uint_to_int_ovf}, 303 {"jit_uint_to_long", (void *)jit_uint_to_long}, 304 {"jit_uint_to_long_ovf", (void *)jit_uint_to_long_ovf}, 305 {"jit_uint_to_nfloat", (void *)jit_uint_to_nfloat}, 306 {"jit_uint_to_uint", (void *)jit_uint_to_uint}, 307 {"jit_uint_to_uint_ovf", (void *)jit_uint_to_uint_ovf}, 308 {"jit_uint_to_ulong", (void *)jit_uint_to_ulong}, 309 {"jit_uint_to_ulong_ovf", (void *)jit_uint_to_ulong_ovf}, 310 {"jit_uint_xor", (void *)jit_uint_xor}, 311 {"jit_ulong_add", (void *)jit_ulong_add}, 312 {"jit_ulong_add_ovf", (void *)jit_ulong_add_ovf}, 313 {"jit_ulong_and", (void *)jit_ulong_and}, 314 {"jit_ulong_cmp", (void *)jit_ulong_cmp}, 315 {"jit_ulong_div", (void *)jit_ulong_div}, 316 {"jit_ulong_eq", (void *)jit_ulong_eq}, 317 {"jit_ulong_ge", (void *)jit_ulong_ge}, 318 {"jit_ulong_gt", (void *)jit_ulong_gt}, 319 {"jit_ulong_le", (void *)jit_ulong_le}, 320 {"jit_ulong_lt", (void *)jit_ulong_lt}, 321 {"jit_ulong_max", (void *)jit_ulong_max}, 322 {"jit_ulong_min", (void *)jit_ulong_min}, 323 {"jit_ulong_mul", (void *)jit_ulong_mul}, 324 {"jit_ulong_mul_ovf", (void *)jit_ulong_mul_ovf}, 325 {"jit_ulong_ne", (void *)jit_ulong_ne}, 326 {"jit_ulong_neg", (void *)jit_ulong_neg}, 327 {"jit_ulong_not", (void *)jit_ulong_not}, 328 {"jit_ulong_or", (void *)jit_ulong_or}, 329 {"jit_ulong_rem", (void *)jit_ulong_rem}, 330 {"jit_ulong_shl", (void *)jit_ulong_shl}, 331 {"jit_ulong_shr", (void *)jit_ulong_shr}, 332 {"jit_ulong_sub", (void *)jit_ulong_sub}, 333 {"jit_ulong_sub_ovf", (void *)jit_ulong_sub_ovf}, 334 {"jit_ulong_to_float32", (void *)jit_ulong_to_float32}, 335 {"jit_ulong_to_float64", (void *)jit_ulong_to_float64}, 336 {"jit_ulong_to_int", (void *)jit_ulong_to_int}, 337 {"jit_ulong_to_int_ovf", (void *)jit_ulong_to_int_ovf}, 338 {"jit_ulong_to_long", (void *)jit_ulong_to_long}, 339 {"jit_ulong_to_long_ovf", (void *)jit_ulong_to_long_ovf}, 340 {"jit_ulong_to_nfloat", (void *)jit_ulong_to_nfloat}, 341 {"jit_ulong_to_uint", (void *)jit_ulong_to_uint}, 342 {"jit_ulong_to_uint_ovf", (void *)jit_ulong_to_uint_ovf}, 343 {"jit_ulong_to_ulong", (void *)jit_ulong_to_ulong}, 344 {"jit_ulong_to_ulong_ovf", (void *)jit_ulong_to_ulong_ovf}, 345 {"jit_ulong_xor", (void *)jit_ulong_xor}, 346 }; 347 int const _jit_num_internal_symbols = 348 (sizeof(_jit_internal_symbols) / sizeof(jit_internalsym));