root/lj_arch.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2 ** Target architecture selection.
   3 ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
   4 */
   5 
   6 #ifndef _LJ_ARCH_H
   7 #define _LJ_ARCH_H
   8 
   9 #include "lua.h"
  10 
  11 /* Target endianess. */
  12 #define LUAJIT_LE       0
  13 #define LUAJIT_BE       1
  14 
  15 /* Target architectures. */
  16 #define LUAJIT_ARCH_X86         1
  17 #define LUAJIT_ARCH_x86         1
  18 #define LUAJIT_ARCH_X64         2
  19 #define LUAJIT_ARCH_x64         2
  20 #define LUAJIT_ARCH_ARM         3
  21 #define LUAJIT_ARCH_arm         3
  22 #define LUAJIT_ARCH_ARM64       4
  23 #define LUAJIT_ARCH_arm64       4
  24 #define LUAJIT_ARCH_PPC         5
  25 #define LUAJIT_ARCH_ppc         5
  26 #define LUAJIT_ARCH_MIPS        6
  27 #define LUAJIT_ARCH_mips        6
  28 #define LUAJIT_ARCH_MIPS32      6
  29 #define LUAJIT_ARCH_mips32      6
  30 #define LUAJIT_ARCH_MIPS64      7
  31 #define LUAJIT_ARCH_mips64      7
  32 
  33 /* Target OS. */
  34 #define LUAJIT_OS_OTHER         0
  35 #define LUAJIT_OS_WINDOWS       1
  36 #define LUAJIT_OS_LINUX         2
  37 #define LUAJIT_OS_OSX           3
  38 #define LUAJIT_OS_BSD           4
  39 #define LUAJIT_OS_POSIX         5
  40 
  41 /* Select native target if no target defined. */
  42 #ifndef LUAJIT_TARGET
  43 
  44 #if defined(__i386) || defined(__i386__) || defined(_M_IX86)
  45 #define LUAJIT_TARGET   LUAJIT_ARCH_X86
  46 #elif defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)
  47 #define LUAJIT_TARGET   LUAJIT_ARCH_X64
  48 #elif defined(__arm__) || defined(__arm) || defined(__ARM__) || defined(__ARM)
  49 #define LUAJIT_TARGET   LUAJIT_ARCH_ARM
  50 #elif defined(__aarch64__)
  51 #define LUAJIT_TARGET   LUAJIT_ARCH_ARM64
  52 #elif defined(__ppc__) || defined(__ppc) || defined(__PPC__) || defined(__PPC) || defined(__powerpc__) || defined(__powerpc) || defined(__POWERPC__) || defined(__POWERPC) || defined(_M_PPC)
  53 #define LUAJIT_TARGET   LUAJIT_ARCH_PPC
  54 #elif defined(__mips64__) || defined(__mips64) || defined(__MIPS64__) || defined(__MIPS64)
  55 #define LUAJIT_TARGET   LUAJIT_ARCH_MIPS64
  56 #elif defined(__mips__) || defined(__mips) || defined(__MIPS__) || defined(__MIPS)
  57 #define LUAJIT_TARGET   LUAJIT_ARCH_MIPS32
  58 #else
  59 #error "No support for this architecture (yet)"
  60 #endif
  61 
  62 #endif
  63 
  64 /* Select native OS if no target OS defined. */
  65 #ifndef LUAJIT_OS
  66 
  67 #if defined(_WIN32) && !defined(_XBOX_VER)
  68 #define LUAJIT_OS       LUAJIT_OS_WINDOWS
  69 #elif defined(__linux__)
  70 #define LUAJIT_OS       LUAJIT_OS_LINUX
  71 #elif defined(__MACH__) && defined(__APPLE__)
  72 #define LUAJIT_OS       LUAJIT_OS_OSX
  73 #elif (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
  74        defined(__NetBSD__) || defined(__OpenBSD__) || \
  75        defined(__DragonFly__)) && !defined(__ORBIS__)
  76 #define LUAJIT_OS       LUAJIT_OS_BSD
  77 #elif (defined(__sun__) && defined(__svr4__)) || defined(__HAIKU__)
  78 #define LUAJIT_OS       LUAJIT_OS_POSIX
  79 #elif defined(__CYGWIN__)
  80 #define LJ_TARGET_CYGWIN        1
  81 #define LUAJIT_OS       LUAJIT_OS_POSIX
  82 #else
  83 #define LUAJIT_OS       LUAJIT_OS_OTHER
  84 #endif
  85 
  86 #endif
  87 
  88 /* Set target OS properties. */
  89 #if LUAJIT_OS == LUAJIT_OS_WINDOWS
  90 #define LJ_OS_NAME      "Windows"
  91 #elif LUAJIT_OS == LUAJIT_OS_LINUX
  92 #define LJ_OS_NAME      "Linux"
  93 #elif LUAJIT_OS == LUAJIT_OS_OSX
  94 #define LJ_OS_NAME      "OSX"
  95 #elif LUAJIT_OS == LUAJIT_OS_BSD
  96 #define LJ_OS_NAME      "BSD"
  97 #elif LUAJIT_OS == LUAJIT_OS_POSIX
  98 #define LJ_OS_NAME      "POSIX"
  99 #else
 100 #define LJ_OS_NAME      "Other"
 101 #endif
 102 
 103 #define LJ_TARGET_WINDOWS       (LUAJIT_OS == LUAJIT_OS_WINDOWS)
 104 #define LJ_TARGET_LINUX         (LUAJIT_OS == LUAJIT_OS_LINUX)
 105 #define LJ_TARGET_OSX           (LUAJIT_OS == LUAJIT_OS_OSX)
 106 #define LJ_TARGET_IOS           (LJ_TARGET_OSX && (LUAJIT_TARGET == LUAJIT_ARCH_ARM || LUAJIT_TARGET == LUAJIT_ARCH_ARM64))
 107 #define LJ_TARGET_POSIX         (LUAJIT_OS > LUAJIT_OS_WINDOWS)
 108 #define LJ_TARGET_DLOPEN        LJ_TARGET_POSIX
 109 
 110 #ifdef __CELLOS_LV2__
 111 #define LJ_TARGET_PS3           1
 112 #define LJ_TARGET_CONSOLE       1
 113 #endif
 114 
 115 #ifdef __ORBIS__
 116 #define LJ_TARGET_PS4           1
 117 #define LJ_TARGET_CONSOLE       1
 118 #undef NULL
 119 #define NULL ((void*)0)
 120 #endif
 121 
 122 #ifdef __psp2__
 123 #define LJ_TARGET_PSVITA        1
 124 #define LJ_TARGET_CONSOLE       1
 125 #endif
 126 
 127 #if _XBOX_VER >= 200
 128 #define LJ_TARGET_XBOX360       1
 129 #define LJ_TARGET_CONSOLE       1
 130 #endif
 131 
 132 #ifdef _DURANGO
 133 #define LJ_TARGET_XBOXONE       1
 134 #define LJ_TARGET_CONSOLE       1
 135 #define LJ_TARGET_GC64          1
 136 #endif
 137 
 138 #define LJ_NUMMODE_SINGLE       0       /* Single-number mode only. */
 139 #define LJ_NUMMODE_SINGLE_DUAL  1       /* Default to single-number mode. */
 140 #define LJ_NUMMODE_DUAL         2       /* Dual-number mode only. */
 141 #define LJ_NUMMODE_DUAL_SINGLE  3       /* Default to dual-number mode. */
 142 
 143 /* Set target architecture properties. */
 144 #if LUAJIT_TARGET == LUAJIT_ARCH_X86
 145 
 146 #define LJ_ARCH_NAME            "x86"
 147 #define LJ_ARCH_BITS            32
 148 #define LJ_ARCH_ENDIAN          LUAJIT_LE
 149 #if LJ_TARGET_WINDOWS || LJ_TARGET_CYGWIN
 150 #define LJ_ABI_WIN              1
 151 #else
 152 #define LJ_ABI_WIN              0
 153 #endif
 154 #define LJ_TARGET_X86           1
 155 #define LJ_TARGET_X86ORX64      1
 156 #define LJ_TARGET_EHRETREG      0
 157 #define LJ_TARGET_MASKSHIFT     1
 158 #define LJ_TARGET_MASKROT       1
 159 #define LJ_TARGET_UNALIGNED     1
 160 #define LJ_ARCH_NUMMODE         LJ_NUMMODE_SINGLE_DUAL
 161 
 162 #elif LUAJIT_TARGET == LUAJIT_ARCH_X64
 163 
 164 #define LJ_ARCH_NAME            "x64"
 165 #define LJ_ARCH_BITS            64
 166 #define LJ_ARCH_ENDIAN          LUAJIT_LE
 167 #if LJ_TARGET_WINDOWS || LJ_TARGET_CYGWIN
 168 #define LJ_ABI_WIN              1
 169 #else
 170 #define LJ_ABI_WIN              0
 171 #endif
 172 #define LJ_TARGET_X64           1
 173 #define LJ_TARGET_X86ORX64      1
 174 #define LJ_TARGET_EHRETREG      0
 175 #define LJ_TARGET_JUMPRANGE     31      /* +-2^31 = +-2GB */
 176 #define LJ_TARGET_MASKSHIFT     1
 177 #define LJ_TARGET_MASKROT       1
 178 #define LJ_TARGET_UNALIGNED     1
 179 #define LJ_ARCH_NUMMODE         LJ_NUMMODE_SINGLE_DUAL
 180 #ifdef LUAJIT_ENABLE_GC64
 181 #define LJ_TARGET_GC64          1
 182 #endif
 183 
 184 #elif LUAJIT_TARGET == LUAJIT_ARCH_ARM
 185 
 186 #define LJ_ARCH_NAME            "arm"
 187 #define LJ_ARCH_BITS            32
 188 #define LJ_ARCH_ENDIAN          LUAJIT_LE
 189 #if !defined(LJ_ARCH_HASFPU) && __SOFTFP__
 190 #define LJ_ARCH_HASFPU          0
 191 #endif
 192 #if !defined(LJ_ABI_SOFTFP) && !__ARM_PCS_VFP
 193 #define LJ_ABI_SOFTFP           1
 194 #endif
 195 #define LJ_ABI_EABI             1
 196 #define LJ_TARGET_ARM           1
 197 #define LJ_TARGET_EHRETREG      0
 198 #define LJ_TARGET_JUMPRANGE     25      /* +-2^25 = +-32MB */
 199 #define LJ_TARGET_MASKSHIFT     0
 200 #define LJ_TARGET_MASKROT       1
 201 #define LJ_TARGET_UNIFYROT      2       /* Want only IR_BROR. */
 202 #define LJ_ARCH_NUMMODE         LJ_NUMMODE_DUAL
 203 
 204 #if __ARM_ARCH____ARM_ARCH_8__ || __ARM_ARCH_8A__
 205 #define LJ_ARCH_VERSION         80
 206 #elif __ARM_ARCH_7__ || __ARM_ARCH_7A__ || __ARM_ARCH_7R__ || __ARM_ARCH_7S__ || __ARM_ARCH_7VE__
 207 #define LJ_ARCH_VERSION         70
 208 #elif __ARM_ARCH_6T2__
 209 #define LJ_ARCH_VERSION         61
 210 #elif __ARM_ARCH_6__ || __ARM_ARCH_6J__ || __ARM_ARCH_6K__ || __ARM_ARCH_6Z__ || __ARM_ARCH_6ZK__
 211 #define LJ_ARCH_VERSION         60
 212 #else
 213 #define LJ_ARCH_VERSION         50
 214 #endif
 215 
 216 #elif LUAJIT_TARGET == LUAJIT_ARCH_ARM64
 217 
 218 #define LJ_ARCH_BITS            64
 219 #if defined(__AARCH64EB__)
 220 #define LJ_ARCH_NAME            "arm64be"
 221 #define LJ_ARCH_ENDIAN          LUAJIT_BE
 222 #else
 223 #define LJ_ARCH_NAME            "arm64"
 224 #define LJ_ARCH_ENDIAN          LUAJIT_LE
 225 #endif
 226 #define LJ_TARGET_ARM64         1
 227 #define LJ_TARGET_EHRETREG      0
 228 #define LJ_TARGET_JUMPRANGE     27      /* +-2^27 = +-128MB */
 229 #define LJ_TARGET_MASKSHIFT     1
 230 #define LJ_TARGET_MASKROT       1
 231 #define LJ_TARGET_UNIFYROT      2       /* Want only IR_BROR. */
 232 #define LJ_TARGET_GC64          1
 233 #define LJ_ARCH_NUMMODE         LJ_NUMMODE_DUAL
 234 
 235 #define LJ_ARCH_VERSION         80
 236 
 237 #elif LUAJIT_TARGET == LUAJIT_ARCH_PPC
 238 
 239 #ifndef LJ_ARCH_ENDIAN
 240 #if __BYTE_ORDER__ != __ORDER_BIG_ENDIAN__
 241 #define LJ_ARCH_ENDIAN          LUAJIT_LE
 242 #else
 243 #define LJ_ARCH_ENDIAN          LUAJIT_BE
 244 #endif
 245 #endif
 246 
 247 #if _LP64
 248 #define LJ_ARCH_BITS            64
 249 #if LJ_ARCH_ENDIAN == LUAJIT_LE
 250 #define LJ_ARCH_NAME            "ppc64le"
 251 #else
 252 #define LJ_ARCH_NAME            "ppc64"
 253 #endif
 254 #else
 255 #define LJ_ARCH_BITS            32
 256 #define LJ_ARCH_NAME            "ppc"
 257 
 258 #if !defined(LJ_ARCH_HASFPU)
 259 #if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
 260 #define LJ_ARCH_HASFPU          0
 261 #else
 262 #define LJ_ARCH_HASFPU          1
 263 #endif
 264 #endif
 265 
 266 #if !defined(LJ_ABI_SOFTFP)
 267 #if defined(_SOFT_FLOAT) || defined(_SOFT_DOUBLE)
 268 #define LJ_ABI_SOFTFP           1
 269 #else
 270 #define LJ_ABI_SOFTFP           0
 271 #endif
 272 #endif
 273 #endif
 274 
 275 #if LJ_ABI_SOFTFP
 276 #define LJ_ARCH_NUMMODE         LJ_NUMMODE_DUAL
 277 #else
 278 #define LJ_ARCH_NUMMODE         LJ_NUMMODE_DUAL_SINGLE
 279 #endif
 280 
 281 #define LJ_TARGET_PPC           1
 282 #define LJ_TARGET_EHRETREG      3
 283 #define LJ_TARGET_JUMPRANGE     25      /* +-2^25 = +-32MB */
 284 #define LJ_TARGET_MASKSHIFT     0
 285 #define LJ_TARGET_MASKROT       1
 286 #define LJ_TARGET_UNIFYROT      1       /* Want only IR_BROL. */
 287 
 288 #if LJ_TARGET_CONSOLE
 289 #define LJ_ARCH_PPC32ON64       1
 290 #define LJ_ARCH_NOFFI           1
 291 #elif LJ_ARCH_BITS == 64
 292 #define LJ_ARCH_PPC64           1
 293 #define LJ_TARGET_GC64          1
 294 #define LJ_ARCH_NOJIT           1       /* NYI */
 295 #endif
 296 
 297 #if _ARCH_PWR7
 298 #define LJ_ARCH_VERSION         70
 299 #elif _ARCH_PWR6
 300 #define LJ_ARCH_VERSION         60
 301 #elif _ARCH_PWR5X
 302 #define LJ_ARCH_VERSION         51
 303 #elif _ARCH_PWR5
 304 #define LJ_ARCH_VERSION         50
 305 #elif _ARCH_PWR4
 306 #define LJ_ARCH_VERSION         40
 307 #else
 308 #define LJ_ARCH_VERSION         0
 309 #endif
 310 #if _ARCH_PPCSQ
 311 #define LJ_ARCH_SQRT            1
 312 #endif
 313 #if _ARCH_PWR5X
 314 #define LJ_ARCH_ROUND           1
 315 #endif
 316 #if __PPU__
 317 #define LJ_ARCH_CELL            1
 318 #endif
 319 #if LJ_TARGET_XBOX360
 320 #define LJ_ARCH_XENON           1
 321 #endif
 322 
 323 #elif LUAJIT_TARGET == LUAJIT_ARCH_MIPS32 || LUAJIT_TARGET == LUAJIT_ARCH_MIPS64
 324 
 325 #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL)
 326 #if LUAJIT_TARGET == LUAJIT_ARCH_MIPS32
 327 #define LJ_ARCH_NAME            "mipsel"
 328 #else
 329 #define LJ_ARCH_NAME            "mips64el"
 330 #endif
 331 #define LJ_ARCH_ENDIAN          LUAJIT_LE
 332 #else
 333 #if LUAJIT_TARGET == LUAJIT_ARCH_MIPS32
 334 #define LJ_ARCH_NAME            "mips"
 335 #else
 336 #define LJ_ARCH_NAME            "mips64"
 337 #endif
 338 #define LJ_ARCH_ENDIAN          LUAJIT_BE
 339 #endif
 340 
 341 #if !defined(LJ_ARCH_HASFPU)
 342 #ifdef __mips_soft_float
 343 #define LJ_ARCH_HASFPU          0
 344 #else
 345 #define LJ_ARCH_HASFPU          1
 346 #endif
 347 #endif
 348 
 349 #if !defined(LJ_ABI_SOFTFP)
 350 #ifdef __mips_soft_float
 351 #define LJ_ABI_SOFTFP           1
 352 #else
 353 #define LJ_ABI_SOFTFP           0
 354 #endif
 355 #endif
 356 
 357 #if LUAJIT_TARGET == LUAJIT_ARCH_MIPS32
 358 #define LJ_ARCH_BITS            32
 359 #define LJ_TARGET_MIPS32        1
 360 #else
 361 #define LJ_ARCH_BITS            64
 362 #define LJ_TARGET_MIPS64        1
 363 #define LJ_TARGET_GC64          1
 364 #endif
 365 #define LJ_TARGET_MIPS          1
 366 #define LJ_TARGET_EHRETREG      4
 367 #define LJ_TARGET_JUMPRANGE     27      /* 2*2^27 = 256MB-aligned region */
 368 #define LJ_TARGET_MASKSHIFT     1
 369 #define LJ_TARGET_MASKROT       1
 370 #define LJ_TARGET_UNIFYROT      2       /* Want only IR_BROR. */
 371 #define LJ_ARCH_NUMMODE         LJ_NUMMODE_DUAL
 372 
 373 #if _MIPS_ARCH_MIPS32R2 || _MIPS_ARCH_MIPS64R2
 374 #define LJ_ARCH_VERSION         20
 375 #else
 376 #define LJ_ARCH_VERSION         10
 377 #endif
 378 
 379 #else
 380 #error "No target architecture defined"
 381 #endif
 382 
 383 #ifndef LJ_PAGESIZE
 384 #define LJ_PAGESIZE             4096
 385 #endif
 386 
 387 /* Check for minimum required compiler versions. */
 388 #if defined(__GNUC__)
 389 #if LJ_TARGET_X86
 390 #if (__GNUC__ < 3) || ((__GNUC__ == 3) && __GNUC_MINOR__ < 4)
 391 #error "Need at least GCC 3.4 or newer"
 392 #endif
 393 #elif LJ_TARGET_X64
 394 #if __GNUC__ < 4
 395 #error "Need at least GCC 4.0 or newer"
 396 #endif
 397 #elif LJ_TARGET_ARM
 398 #if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 2)
 399 #error "Need at least GCC 4.2 or newer"
 400 #endif
 401 #elif LJ_TARGET_ARM64
 402 #if __clang__
 403 #if ((__clang_major__ < 3) || ((__clang_major__ == 3) && __clang_minor__ < 5)) && !defined(__NX_TOOLCHAIN_MAJOR__)
 404 #error "Need at least Clang 3.5 or newer"
 405 #endif
 406 #else
 407 #if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 8)
 408 #error "Need at least GCC 4.8 or newer"
 409 #endif
 410 #endif
 411 #elif !LJ_TARGET_PS3
 412 #if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 3)
 413 #error "Need at least GCC 4.3 or newer"
 414 #endif
 415 #endif
 416 #endif
 417 
 418 /* Check target-specific constraints. */
 419 #ifndef _BUILDVM_H
 420 #if LJ_TARGET_X64
 421 #if __USING_SJLJ_EXCEPTIONS__
 422 #error "Need a C compiler with native exception handling on x64"
 423 #endif
 424 #elif LJ_TARGET_ARM
 425 #if defined(__ARMEB__)
 426 #error "No support for big-endian ARM"
 427 #endif
 428 #if __ARM_ARCH_6M__ || __ARM_ARCH_7M__ || __ARM_ARCH_7EM__
 429 #error "No support for Cortex-M CPUs"
 430 #endif
 431 #if !(__ARM_EABI__ || LJ_TARGET_IOS)
 432 #error "Only ARM EABI or iOS 3.0+ ABI is supported"
 433 #endif
 434 #elif LJ_TARGET_ARM64
 435 #if defined(_ILP32)
 436 #error "No support for ILP32 model on ARM64"
 437 #endif
 438 #elif LJ_TARGET_PPC
 439 #if !LJ_ARCH_PPC64 && LJ_ARCH_ENDIAN == LUAJIT_LE
 440 #error "No support for little-endian PPC32"
 441 #endif
 442 #if LJ_ARCH_PPC64
 443 #error "No support for PowerPC 64 bit mode (yet)"
 444 #endif
 445 #if defined(__NO_FPRS__) && !defined(_SOFT_FLOAT)
 446 #error "No support for PPC/e500 anymore (use LuaJIT 2.0)"
 447 #endif
 448 #elif LJ_TARGET_MIPS32
 449 #if !((defined(_MIPS_SIM_ABI32) && _MIPS_SIM == _MIPS_SIM_ABI32) || (defined(_ABIO32) && _MIPS_SIM == _ABIO32))
 450 #error "Only o32 ABI supported for MIPS32"
 451 #endif
 452 #elif LJ_TARGET_MIPS64
 453 #if !((defined(_MIPS_SIM_ABI64) && _MIPS_SIM == _MIPS_SIM_ABI64) || (defined(_ABI64) && _MIPS_SIM == _ABI64))
 454 #error "Only n64 ABI supported for MIPS64"
 455 #endif
 456 #endif
 457 #endif
 458 
 459 /* Enable or disable the dual-number mode for the VM. */
 460 #if (LJ_ARCH_NUMMODE == LJ_NUMMODE_SINGLE && LUAJIT_NUMMODE == 2) || \
 461     (LJ_ARCH_NUMMODE == LJ_NUMMODE_DUAL && LUAJIT_NUMMODE == 1)
 462 #error "No support for this number mode on this architecture"
 463 #endif
 464 #if LJ_ARCH_NUMMODE == LJ_NUMMODE_DUAL || \
 465     (LJ_ARCH_NUMMODE == LJ_NUMMODE_DUAL_SINGLE && LUAJIT_NUMMODE != 1) || \
 466     (LJ_ARCH_NUMMODE == LJ_NUMMODE_SINGLE_DUAL && LUAJIT_NUMMODE == 2)
 467 #define LJ_DUALNUM              1
 468 #else
 469 #define LJ_DUALNUM              0
 470 #endif
 471 
 472 #if LJ_TARGET_IOS || LJ_TARGET_CONSOLE
 473 /* Runtime code generation is restricted on iOS. Complain to Apple, not me. */
 474 /* Ditto for the consoles. Complain to Sony or MS, not me. */
 475 #ifndef LUAJIT_ENABLE_JIT
 476 #define LJ_OS_NOJIT             1
 477 #endif
 478 #endif
 479 
 480 /* 64 bit GC references. */
 481 #if LJ_TARGET_GC64
 482 #define LJ_GC64                 1
 483 #else
 484 #define LJ_GC64                 0
 485 #endif
 486 
 487 /* 2-slot frame info. */
 488 #if LJ_GC64
 489 #define LJ_FR2                  1
 490 #else
 491 #define LJ_FR2                  0
 492 #endif
 493 
 494 /* Disable or enable the JIT compiler. */
 495 #if defined(LUAJIT_DISABLE_JIT) || defined(LJ_ARCH_NOJIT) || defined(LJ_OS_NOJIT)
 496 #define LJ_HASJIT               0
 497 #else
 498 #define LJ_HASJIT               1
 499 #endif
 500 
 501 /* Disable or enable the FFI extension. */
 502 #if defined(LUAJIT_DISABLE_FFI) || defined(LJ_ARCH_NOFFI)
 503 #define LJ_HASFFI               0
 504 #else
 505 #define LJ_HASFFI               1
 506 #endif
 507 
 508 #if defined(LUAJIT_DISABLE_PROFILE)
 509 #define LJ_HASPROFILE           0
 510 #elif LJ_TARGET_POSIX
 511 #define LJ_HASPROFILE           1
 512 #define LJ_PROFILE_SIGPROF      1
 513 #elif LJ_TARGET_PS3
 514 #define LJ_HASPROFILE           1
 515 #define LJ_PROFILE_PTHREAD      1
 516 #elif LJ_TARGET_WINDOWS || LJ_TARGET_XBOX360
 517 #define LJ_HASPROFILE           1
 518 #define LJ_PROFILE_WTHREAD      1
 519 #else
 520 #define LJ_HASPROFILE           0
 521 #endif
 522 
 523 #ifndef LJ_ARCH_HASFPU
 524 #define LJ_ARCH_HASFPU          1
 525 #endif
 526 #ifndef LJ_ABI_SOFTFP
 527 #define LJ_ABI_SOFTFP           0
 528 #endif
 529 #define LJ_SOFTFP               (!LJ_ARCH_HASFPU)
 530 #define LJ_SOFTFP32             (LJ_SOFTFP && LJ_32)
 531 
 532 #if LJ_ARCH_ENDIAN == LUAJIT_BE
 533 #define LJ_LE                   0
 534 #define LJ_BE                   1
 535 #define LJ_ENDIAN_SELECT(le, be)        be
 536 #define LJ_ENDIAN_LOHI(lo, hi)          hi lo
 537 #else
 538 #define LJ_LE                   1
 539 #define LJ_BE                   0
 540 #define LJ_ENDIAN_SELECT(le, be)        le
 541 #define LJ_ENDIAN_LOHI(lo, hi)          lo hi
 542 #endif
 543 
 544 #if LJ_ARCH_BITS == 32
 545 #define LJ_32                   1
 546 #define LJ_64                   0
 547 #else
 548 #define LJ_32                   0
 549 #define LJ_64                   1
 550 #endif
 551 
 552 #ifndef LJ_TARGET_UNALIGNED
 553 #define LJ_TARGET_UNALIGNED     0
 554 #endif
 555 
 556 /* Various workarounds for embedded operating systems or weak C runtimes. */
 557 #if defined(__ANDROID__) || defined(__symbian__) || LJ_TARGET_XBOX360 || LJ_TARGET_WINDOWS
 558 #define LUAJIT_NO_LOG2
 559 #endif
 560 #if defined(__symbian__) || LJ_TARGET_WINDOWS
 561 #define LUAJIT_NO_EXP2
 562 #endif
 563 #if LJ_TARGET_CONSOLE || (LJ_TARGET_IOS && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_8_0)
 564 #define LJ_NO_SYSTEM            1
 565 #endif
 566 
 567 #if !defined(LUAJIT_NO_UNWIND) && __GNU_COMPACT_EH__
 568 /* NYI: no support for compact unwind specification, yet. */
 569 #define LUAJIT_NO_UNWIND        1
 570 #endif
 571 
 572 #if defined(LUAJIT_NO_UNWIND) || defined(__symbian__) || LJ_TARGET_IOS || LJ_TARGET_PS3 || LJ_TARGET_PS4
 573 #define LJ_NO_UNWIND            1
 574 #endif
 575 
 576 /* Compatibility with Lua 5.1 vs. 5.2. */
 577 #ifdef LUAJIT_ENABLE_LUA52COMPAT
 578 #define LJ_52                   1
 579 #else
 580 #define LJ_52                   0
 581 #endif
 582 
 583 #endif

/* [<][>][^][v][top][bottom][index][help] */