Go to the documentation of this file.Go to the SVN repository for this file.
27 #ifndef SLJIT_CONFIG_INTERNAL_H_
28 #define SLJIT_CONFIG_INTERNAL_H_
30 #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE) \
31 || (defined SLJIT_DEBUG && SLJIT_DEBUG && (!defined(SLJIT_ASSERT) || !defined(SLJIT_UNREACHABLE)))
35 #if (defined SLJIT_DEBUG && SLJIT_DEBUG \
36 && (!defined(SLJIT_ASSERT) || !defined(SLJIT_UNREACHABLE) || !defined(SLJIT_HALT_PROCESS)))
115 #ifdef SLJIT_CONFIG_X86
117 #if defined(__CET__) && !(defined SLJIT_CONFIG_X86_CET && SLJIT_CONFIG_X86_CET)
118 #define SLJIT_CONFIG_X86_CET 1
121 #if (defined SLJIT_CONFIG_X86_CET && SLJIT_CONFIG_X86_CET) && defined(__GNUC__)
122 #include <x86intrin.h>
139 #define SLJIT_MALLOC(size, allocator_data) (malloc(size))
143 #define SLJIT_FREE(ptr, allocator_data) (free(ptr))
147 #define SLJIT_MEMCPY(dest, src, len) (memcpy(dest, src, len))
150 #ifndef SLJIT_MEMMOVE
151 #define SLJIT_MEMMOVE(dest, src, len) (memmove(dest, src, len))
154 #ifndef SLJIT_ZEROMEM
155 #define SLJIT_ZEROMEM(dest, len) (memset(dest, 0, len))
162 #if !defined(SLJIT_LIKELY) && !defined(SLJIT_UNLIKELY)
164 #if defined(__GNUC__) && (__GNUC__ >= 3)
165 #define SLJIT_LIKELY(x) __builtin_expect((x), 1)
166 #define SLJIT_UNLIKELY(x) __builtin_expect((x), 0)
168 #define SLJIT_LIKELY(x) (x)
169 #define SLJIT_UNLIKELY(x) (x)
177 #if __SUNPRO_C < 0x560
180 #define SLJIT_INLINE inline
183 #define SLJIT_INLINE __inline
187 #ifndef SLJIT_NOINLINE
189 #if defined(__GNUC__)
190 #define SLJIT_NOINLINE __attribute__ ((noinline))
192 #define SLJIT_NOINLINE
196 #ifndef SLJIT_UNUSED_ARG
198 #define SLJIT_UNUSED_ARG(arg) (void)arg
205 #ifndef SLJIT_API_FUNC_ATTRIBUTE
206 #if (defined SLJIT_CONFIG_STATIC && SLJIT_CONFIG_STATIC)
209 #if defined(__GNUC__)
211 #define SLJIT_API_FUNC_ATTRIBUTE static __attribute__((unused))
213 #define SLJIT_API_FUNC_ATTRIBUTE static
217 #define SLJIT_API_FUNC_ATTRIBUTE
226 #include <AvailabilityMacros.h>
245 #if (!defined SLJIT_CACHE_FLUSH && defined __has_builtin)
246 #if __has_builtin(__builtin___clear_cache) && !defined(__clang__)
253 #if !defined(SLJIT_CONFIG_PPC)
254 #define SLJIT_CACHE_FLUSH(from, to) \
255 __builtin___clear_cache((char*)(from), (char*)(to))
261 #ifndef SLJIT_CACHE_FLUSH
263 #if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) \
264 || (defined SLJIT_CONFIG_S390X && SLJIT_CONFIG_S390X)
267 #define SLJIT_CACHE_FLUSH(from, to)
269 #elif defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
274 #include <libkern/OSCacheControl.h>
275 #define SLJIT_CACHE_FLUSH(from, to) \
276 sys_icache_invalidate((void*)(from), (size_t)((char*)(to) - (char*)(from)))
278 #elif (defined SLJIT_CONFIG_PPC && SLJIT_CONFIG_PPC)
281 #define SLJIT_CACHE_FLUSH(from, to) \
282 ppc_cache_flush((from), (to))
283 #define SLJIT_CACHE_FLUSH_OWN_IMPL 1
285 #elif defined(_WIN32)
287 #define SLJIT_CACHE_FLUSH(from, to) \
288 FlushInstructionCache(GetCurrentProcess(), (void*)(from), (char*)(to) - (char*)(from))
290 #elif (defined(__GNUC__) && (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || defined(__clang__)
292 #define SLJIT_CACHE_FLUSH(from, to) \
293 __builtin___clear_cache((char*)(from), (char*)(to))
295 #elif defined __ANDROID__
298 #include <sys/cachectl.h>
299 #define SLJIT_CACHE_FLUSH(from, to) \
300 cacheflush((long)(from), (long)(to), 0)
305 #define SLJIT_CACHE_FLUSH(from, to) \
306 __clear_cache((char*)(from), (char*)(to))
331 #if (defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED)
333 #define SLJIT_WORD_SHIFT 0
336 #elif !(defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64) \
337 && !(defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64) \
338 && !(defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) \
339 && !(defined SLJIT_CONFIG_MIPS_64 && SLJIT_CONFIG_MIPS_64) \
340 && !(defined SLJIT_CONFIG_RISCV_64 && SLJIT_CONFIG_RISCV_64) \
341 && !(defined SLJIT_CONFIG_S390X && SLJIT_CONFIG_S390X) \
342 && !(defined SLJIT_CONFIG_LOONGARCH_64 && SLJIT_CONFIG_LOONGARCH_64)
343 #define SLJIT_32BIT_ARCHITECTURE 1
344 #define SLJIT_WORD_SHIFT 2
348 #define SLJIT_64BIT_ARCHITECTURE 1
349 #define SLJIT_WORD_SHIFT 3
353 typedef unsigned long long sljit_uw;
373 #define SLJIT_POINTER_SHIFT SLJIT_WORD_SHIFT
376 #define SLJIT_F32_SHIFT 2
377 #define SLJIT_F64_SHIFT 3
379 #define SLJIT_CONV_RESULT_MAX_INT 0
380 #define SLJIT_CONV_RESULT_MIN_INT 1
381 #define SLJIT_CONV_RESULT_ZERO 2
383 #if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
384 #define SLJIT_CONV_MAX_FLOAT SLJIT_CONV_RESULT_MIN_INT
385 #define SLJIT_CONV_MIN_FLOAT SLJIT_CONV_RESULT_MIN_INT
386 #define SLJIT_CONV_NAN_FLOAT SLJIT_CONV_RESULT_MIN_INT
387 #elif (defined SLJIT_CONFIG_ARM && SLJIT_CONFIG_ARM)
388 #define SLJIT_CONV_MAX_FLOAT SLJIT_CONV_RESULT_MAX_INT
389 #define SLJIT_CONV_MIN_FLOAT SLJIT_CONV_RESULT_MIN_INT
390 #define SLJIT_CONV_NAN_FLOAT SLJIT_CONV_RESULT_ZERO
391 #elif (defined SLJIT_CONFIG_MIPS && SLJIT_CONFIG_MIPS)
392 #define SLJIT_CONV_MAX_FLOAT SLJIT_CONV_RESULT_MAX_INT
393 #define SLJIT_CONV_MIN_FLOAT SLJIT_CONV_RESULT_MAX_INT
394 #define SLJIT_CONV_NAN_FLOAT SLJIT_CONV_RESULT_MAX_INT
395 #elif (defined SLJIT_CONFIG_PPC && SLJIT_CONFIG_PPC)
396 #define SLJIT_CONV_MAX_FLOAT SLJIT_CONV_RESULT_MAX_INT
397 #define SLJIT_CONV_MIN_FLOAT SLJIT_CONV_RESULT_MIN_INT
398 #define SLJIT_CONV_NAN_FLOAT SLJIT_CONV_RESULT_MIN_INT
399 #elif (defined SLJIT_CONFIG_RISCV && SLJIT_CONFIG_RISCV)
400 #define SLJIT_CONV_MAX_FLOAT SLJIT_CONV_RESULT_MAX_INT
401 #define SLJIT_CONV_MIN_FLOAT SLJIT_CONV_RESULT_MIN_INT
402 #define SLJIT_CONV_NAN_FLOAT SLJIT_CONV_RESULT_MAX_INT
403 #elif (defined SLJIT_CONFIG_S390X && SLJIT_CONFIG_S390X)
404 #define SLJIT_CONV_MAX_FLOAT SLJIT_CONV_RESULT_MAX_INT
405 #define SLJIT_CONV_MIN_FLOAT SLJIT_CONV_RESULT_MIN_INT
406 #define SLJIT_CONV_NAN_FLOAT SLJIT_CONV_RESULT_MIN_INT
407 #elif (defined SLJIT_CONFIG_LOONGARCH && SLJIT_CONFIG_LOONGARCH)
408 #define SLJIT_CONV_MAX_FLOAT SLJIT_CONV_RESULT_MAX_INT
409 #define SLJIT_CONV_MIN_FLOAT SLJIT_CONV_RESULT_MIN_INT
410 #define SLJIT_CONV_NAN_FLOAT SLJIT_CONV_RESULT_ZERO
412 #error "Result for float to integer conversion is not defined"
418 #if (defined SLJIT_64BIT_ARCHITECTURE && SLJIT_64BIT_ARCHITECTURE)
420 #define SLJIT_W(w) (w##ll)
422 #define SLJIT_W(w) (w##l)
425 #define SLJIT_W(w) (w)
434 #if !defined(SLJIT_BIG_ENDIAN) && !defined(SLJIT_LITTLE_ENDIAN)
437 #if (defined SLJIT_CONFIG_PPC && SLJIT_CONFIG_PPC)
439 #ifdef __LITTLE_ENDIAN__
440 #define SLJIT_LITTLE_ENDIAN 1
442 #define SLJIT_BIG_ENDIAN 1
445 #elif (defined SLJIT_CONFIG_MIPS && SLJIT_CONFIG_MIPS)
448 #define SLJIT_LITTLE_ENDIAN 1
450 #define SLJIT_BIG_ENDIAN 1
453 #ifndef SLJIT_MIPS_REV
456 #if (defined __mips_isa_rev) && (__mips_isa_rev >= 6)
457 #define SLJIT_MIPS_REV 6
458 #elif defined(__mips_isa_rev) && __mips_isa_rev >= 1
459 #define SLJIT_MIPS_REV __mips_isa_rev
460 #elif defined(__clang__) \
461 && (defined(_MIPS_ARCH_OCTEON) || defined(_MIPS_ARCH_P5600))
468 #define SLJIT_MIPS_REV 1
473 #elif (defined SLJIT_CONFIG_S390X && SLJIT_CONFIG_S390X)
475 #define SLJIT_BIG_ENDIAN 1
478 #define SLJIT_LITTLE_ENDIAN 1
484 #if (defined SLJIT_BIG_ENDIAN && SLJIT_BIG_ENDIAN) && (defined SLJIT_LITTLE_ENDIAN && SLJIT_LITTLE_ENDIAN)
485 #error "Exactly one endianness must be selected"
488 #if !(defined SLJIT_BIG_ENDIAN && SLJIT_BIG_ENDIAN) && !(defined SLJIT_LITTLE_ENDIAN && SLJIT_LITTLE_ENDIAN)
489 #error "Exactly one endianness must be selected"
492 #ifndef SLJIT_UNALIGNED
494 #if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) \
495 || (defined SLJIT_CONFIG_ARM_V7 && SLJIT_CONFIG_ARM_V7) \
496 || (defined SLJIT_CONFIG_ARM_THUMB2 && SLJIT_CONFIG_ARM_THUMB2) \
497 || (defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64) \
498 || (defined SLJIT_CONFIG_PPC && SLJIT_CONFIG_PPC) \
499 || (defined SLJIT_CONFIG_RISCV && SLJIT_CONFIG_RISCV) \
500 || (defined SLJIT_CONFIG_S390X && SLJIT_CONFIG_S390X) \
501 || (defined SLJIT_CONFIG_LOONGARCH && SLJIT_CONFIG_LOONGARCH)
502 #define SLJIT_UNALIGNED 1
507 #ifndef SLJIT_FPU_UNALIGNED
509 #if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) \
510 || (defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64) \
511 || (defined SLJIT_CONFIG_PPC && SLJIT_CONFIG_PPC) \
512 || (defined SLJIT_CONFIG_RISCV && SLJIT_CONFIG_RISCV) \
513 || (defined SLJIT_CONFIG_S390X && SLJIT_CONFIG_S390X) \
514 || (defined SLJIT_CONFIG_LOONGARCH && SLJIT_CONFIG_LOONGARCH)
515 #define SLJIT_FPU_UNALIGNED 1
520 #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
523 #define SLJIT_DETECT_SSE2 1
534 #ifndef SLJIT_INDIRECT_CALL
535 #if ((defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) && (!defined _CALL_ELF || _CALL_ELF == 1)) \
536 || ((defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32) && defined _AIX)
539 #define SLJIT_INDIRECT_CALL 1
545 #ifndef SLJIT_RETURN_ADDRESS_OFFSET
546 #define SLJIT_RETURN_ADDRESS_OFFSET 0
553 #if (defined SLJIT_EXECUTABLE_ALLOCATOR && SLJIT_EXECUTABLE_ALLOCATOR)
557 #define SLJIT_BUILTIN_MALLOC_EXEC(size, exec_allocator_data) sljit_malloc_exec(size)
558 #define SLJIT_BUILTIN_FREE_EXEC(ptr, exec_allocator_data) sljit_free_exec(ptr)
560 #ifndef SLJIT_MALLOC_EXEC
561 #define SLJIT_MALLOC_EXEC(size, exec_allocator_data) SLJIT_BUILTIN_MALLOC_EXEC((size), (exec_allocator_data))
564 #ifndef SLJIT_FREE_EXEC
565 #define SLJIT_FREE_EXEC(ptr, exec_allocator_data) SLJIT_BUILTIN_FREE_EXEC((ptr), (exec_allocator_data))
568 #if (defined SLJIT_PROT_EXECUTABLE_ALLOCATOR && SLJIT_PROT_EXECUTABLE_ALLOCATOR)
570 #define SLJIT_EXEC_OFFSET(code) sljit_exec_offset(code)
575 #ifndef SLJIT_EXEC_OFFSET
576 #define SLJIT_EXEC_OFFSET(ptr) 0
583 #if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
585 #define SLJIT_NUMBER_OF_REGISTERS 12
586 #define SLJIT_NUMBER_OF_SAVED_REGISTERS 7
587 #define SLJIT_NUMBER_OF_TEMPORARY_REGISTERS 1
588 #define SLJIT_NUMBER_OF_FLOAT_REGISTERS 7
589 #define SLJIT_NUMBER_OF_SAVED_FLOAT_REGISTERS 0
590 #define SLJIT_NUMBER_OF_TEMPORARY_FLOAT_REGISTERS 1
591 #define SLJIT_TMP_DEST_REG SLJIT_TMP_R0
592 #define SLJIT_TMP_MEM_REG SLJIT_TMP_R0
593 #define SLJIT_TMP_DEST_FREG SLJIT_TMP_FR0
594 #define SLJIT_LOCALS_OFFSET_BASE (8 * SSIZE_OF(sw))
595 #define SLJIT_PREF_SHIFT_REG SLJIT_R2
596 #define SLJIT_MASKED_SHIFT 1
597 #define SLJIT_MASKED_SHIFT32 1
599 #elif (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
601 #define SLJIT_NUMBER_OF_REGISTERS 13
602 #define SLJIT_NUMBER_OF_TEMPORARY_REGISTERS 2
603 #define SLJIT_NUMBER_OF_FLOAT_REGISTERS 15
604 #define SLJIT_NUMBER_OF_TEMPORARY_FLOAT_REGISTERS 1
606 #define SLJIT_NUMBER_OF_SAVED_REGISTERS 6
607 #define SLJIT_NUMBER_OF_SAVED_FLOAT_REGISTERS 0
608 #define SLJIT_LOCALS_OFFSET_BASE 0
610 #define SLJIT_NUMBER_OF_SAVED_REGISTERS 8
611 #define SLJIT_NUMBER_OF_SAVED_FLOAT_REGISTERS 10
612 #define SLJIT_LOCALS_OFFSET_BASE (4 * SSIZE_OF(sw))
614 #define SLJIT_TMP_DEST_REG SLJIT_TMP_R0
615 #define SLJIT_TMP_MEM_REG SLJIT_TMP_R0
616 #define SLJIT_TMP_DEST_FREG SLJIT_TMP_FR0
617 #define SLJIT_PREF_SHIFT_REG SLJIT_R3
618 #define SLJIT_MASKED_SHIFT 1
619 #define SLJIT_MASKED_SHIFT32 1
621 #elif (defined SLJIT_CONFIG_ARM_32 && SLJIT_CONFIG_ARM_32)
623 #define SLJIT_NUMBER_OF_REGISTERS 12
624 #define SLJIT_NUMBER_OF_SAVED_REGISTERS 8
625 #define SLJIT_NUMBER_OF_TEMPORARY_REGISTERS 2
626 #define SLJIT_NUMBER_OF_FLOAT_REGISTERS 14
627 #define SLJIT_NUMBER_OF_SAVED_FLOAT_REGISTERS 8
628 #define SLJIT_NUMBER_OF_TEMPORARY_FLOAT_REGISTERS 2
629 #define SLJIT_TMP_DEST_REG SLJIT_TMP_R1
630 #define SLJIT_TMP_MEM_REG SLJIT_TMP_R1
631 #define SLJIT_TMP_DEST_FREG SLJIT_TMP_FR0
632 #define SLJIT_LOCALS_OFFSET_BASE 0
634 #elif (defined SLJIT_CONFIG_ARM_64 && SLJIT_CONFIG_ARM_64)
636 #define SLJIT_NUMBER_OF_REGISTERS 26
637 #define SLJIT_NUMBER_OF_SAVED_REGISTERS 10
638 #define SLJIT_NUMBER_OF_TEMPORARY_REGISTERS 3
639 #define SLJIT_NUMBER_OF_FLOAT_REGISTERS 30
640 #define SLJIT_NUMBER_OF_SAVED_FLOAT_REGISTERS 8
641 #define SLJIT_NUMBER_OF_TEMPORARY_FLOAT_REGISTERS 2
642 #define SLJIT_TMP_DEST_REG SLJIT_TMP_R0
643 #define SLJIT_TMP_MEM_REG SLJIT_TMP_R0
644 #define SLJIT_TMP_DEST_FREG SLJIT_TMP_FR0
645 #define SLJIT_LOCALS_OFFSET_BASE (2 * (sljit_s32)sizeof(sljit_sw))
646 #define SLJIT_MASKED_SHIFT 1
647 #define SLJIT_MASKED_SHIFT32 1
649 #elif (defined SLJIT_CONFIG_PPC && SLJIT_CONFIG_PPC)
651 #define SLJIT_NUMBER_OF_REGISTERS 23
652 #define SLJIT_NUMBER_OF_SAVED_REGISTERS 17
653 #define SLJIT_NUMBER_OF_TEMPORARY_REGISTERS 3
654 #define SLJIT_NUMBER_OF_FLOAT_REGISTERS 30
655 #define SLJIT_NUMBER_OF_SAVED_FLOAT_REGISTERS 18
656 #define SLJIT_NUMBER_OF_TEMPORARY_FLOAT_REGISTERS 2
657 #define SLJIT_TMP_DEST_REG SLJIT_TMP_R1
658 #define SLJIT_TMP_MEM_REG SLJIT_TMP_R1
659 #define SLJIT_TMP_DEST_FREG SLJIT_TMP_FR0
660 #if (defined SLJIT_CONFIG_PPC_64 && SLJIT_CONFIG_PPC_64) || (defined _AIX)
661 #define SLJIT_LOCALS_OFFSET_BASE ((6 + 8) * (sljit_s32)sizeof(sljit_sw))
662 #elif (defined SLJIT_CONFIG_PPC_32 && SLJIT_CONFIG_PPC_32)
664 #define SLJIT_LOCALS_OFFSET_BASE ((3 + 1) * (sljit_s32)sizeof(sljit_sw))
666 #define SLJIT_LOCALS_OFFSET_BASE (3 * (sljit_s32)sizeof(sljit_sw))
669 #elif (defined SLJIT_CONFIG_MIPS && SLJIT_CONFIG_MIPS)
671 #define SLJIT_NUMBER_OF_REGISTERS 21
672 #define SLJIT_NUMBER_OF_SAVED_REGISTERS 8
673 #if (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
674 #define SLJIT_LOCALS_OFFSET_BASE (4 * (sljit_s32)sizeof(sljit_sw))
675 #define SLJIT_NUMBER_OF_FLOAT_REGISTERS 13
676 #define SLJIT_NUMBER_OF_SAVED_FLOAT_REGISTERS 6
678 #define SLJIT_LOCALS_OFFSET_BASE 0
679 #define SLJIT_NUMBER_OF_FLOAT_REGISTERS 29
680 #define SLJIT_NUMBER_OF_SAVED_FLOAT_REGISTERS 8
682 #define SLJIT_NUMBER_OF_TEMPORARY_REGISTERS 5
683 #define SLJIT_NUMBER_OF_TEMPORARY_FLOAT_REGISTERS 3
684 #define SLJIT_TMP_DEST_REG SLJIT_TMP_R1
685 #define SLJIT_TMP_MEM_REG SLJIT_TMP_R1
686 #define SLJIT_TMP_DEST_FREG SLJIT_TMP_FR0
687 #define SLJIT_MASKED_SHIFT 1
688 #define SLJIT_MASKED_SHIFT32 1
690 #elif (defined SLJIT_CONFIG_RISCV && SLJIT_CONFIG_RISCV)
692 #define SLJIT_NUMBER_OF_REGISTERS 23
693 #define SLJIT_NUMBER_OF_SAVED_REGISTERS 12
694 #define SLJIT_NUMBER_OF_TEMPORARY_REGISTERS 5
695 #define SLJIT_NUMBER_OF_FLOAT_REGISTERS 30
696 #define SLJIT_NUMBER_OF_SAVED_FLOAT_REGISTERS 12
697 #define SLJIT_NUMBER_OF_TEMPORARY_FLOAT_REGISTERS 2
698 #define SLJIT_TMP_DEST_REG SLJIT_TMP_R1
699 #define SLJIT_TMP_MEM_REG SLJIT_TMP_R1
700 #define SLJIT_TMP_DEST_FREG SLJIT_TMP_FR0
701 #define SLJIT_LOCALS_OFFSET_BASE 0
702 #define SLJIT_MASKED_SHIFT 1
703 #define SLJIT_MASKED_SHIFT32 1
705 #elif (defined SLJIT_CONFIG_S390X && SLJIT_CONFIG_S390X)
726 #define SLJIT_S390X_DEFAULT_STACK_FRAME_SIZE 160
728 #define SLJIT_NUMBER_OF_REGISTERS 12
729 #define SLJIT_NUMBER_OF_SAVED_REGISTERS 8
730 #define SLJIT_NUMBER_OF_TEMPORARY_REGISTERS 3
731 #define SLJIT_NUMBER_OF_FLOAT_REGISTERS 15
732 #define SLJIT_NUMBER_OF_SAVED_FLOAT_REGISTERS 8
733 #define SLJIT_NUMBER_OF_TEMPORARY_FLOAT_REGISTERS 1
734 #define SLJIT_TMP_DEST_REG SLJIT_TMP_R0
735 #define SLJIT_TMP_MEM_REG SLJIT_TMP_R2
736 #define SLJIT_TMP_DEST_FREG SLJIT_TMP_FR0
737 #define SLJIT_LOCALS_OFFSET_BASE SLJIT_S390X_DEFAULT_STACK_FRAME_SIZE
738 #define SLJIT_MASKED_SHIFT 1
740 #elif (defined SLJIT_CONFIG_LOONGARCH && SLJIT_CONFIG_LOONGARCH)
742 #define SLJIT_NUMBER_OF_REGISTERS 23
743 #define SLJIT_NUMBER_OF_SAVED_REGISTERS 10
744 #define SLJIT_NUMBER_OF_TEMPORARY_REGISTERS 5
745 #define SLJIT_NUMBER_OF_FLOAT_REGISTERS 30
746 #define SLJIT_NUMBER_OF_SAVED_FLOAT_REGISTERS 12
747 #define SLJIT_NUMBER_OF_TEMPORARY_FLOAT_REGISTERS 2
748 #define SLJIT_TMP_DEST_REG SLJIT_TMP_R1
749 #define SLJIT_TMP_MEM_REG SLJIT_TMP_R1
750 #define SLJIT_TMP_DEST_FREG SLJIT_TMP_FR0
751 #define SLJIT_LOCALS_OFFSET_BASE 0
752 #define SLJIT_MASKED_SHIFT 1
753 #define SLJIT_MASKED_SHIFT32 1
755 #elif (defined SLJIT_CONFIG_UNSUPPORTED && SLJIT_CONFIG_UNSUPPORTED)
758 #define SLJIT_NUMBER_OF_REGISTERS 0
759 #define SLJIT_NUMBER_OF_SAVED_REGISTERS 0
760 #define SLJIT_NUMBER_OF_TEMPORARY_REGISTERS 0
761 #define SLJIT_NUMBER_OF_FLOAT_REGISTERS 0
762 #define SLJIT_NUMBER_OF_SAVED_FLOAT_REGISTERS 0
763 #define SLJIT_NUMBER_OF_TEMPORARY_FLOAT_REGISTERS 0
764 #define SLJIT_TMP_DEST_REG 0
765 #define SLJIT_TMP_MEM_REG 0
766 #define SLJIT_TMP_DEST_FREG 0
767 #define SLJIT_LOCALS_OFFSET_BASE 0
771 #define SLJIT_LOCALS_OFFSET (SLJIT_LOCALS_OFFSET_BASE)
773 #define SLJIT_NUMBER_OF_SCRATCH_REGISTERS \
774 (SLJIT_NUMBER_OF_REGISTERS - SLJIT_NUMBER_OF_SAVED_REGISTERS)
776 #define SLJIT_NUMBER_OF_SCRATCH_FLOAT_REGISTERS \
777 (SLJIT_NUMBER_OF_FLOAT_REGISTERS - SLJIT_NUMBER_OF_SAVED_FLOAT_REGISTERS)
783 #define SLJIT_TMP_REGISTER_BASE (SLJIT_NUMBER_OF_REGISTERS + 2)
784 #define SLJIT_TMP_FREGISTER_BASE (SLJIT_NUMBER_OF_FLOAT_REGISTERS + 1)
794 #define SLJIT_TMP_R0 (SLJIT_TMP_REGISTER_BASE + 0)
795 #define SLJIT_TMP_R1 (SLJIT_TMP_REGISTER_BASE + 1)
796 #define SLJIT_TMP_R2 (SLJIT_TMP_REGISTER_BASE + 2)
797 #define SLJIT_TMP_R3 (SLJIT_TMP_REGISTER_BASE + 3)
798 #define SLJIT_TMP_R4 (SLJIT_TMP_REGISTER_BASE + 4)
799 #define SLJIT_TMP_R5 (SLJIT_TMP_REGISTER_BASE + 5)
800 #define SLJIT_TMP_R6 (SLJIT_TMP_REGISTER_BASE + 6)
801 #define SLJIT_TMP_R7 (SLJIT_TMP_REGISTER_BASE + 7)
802 #define SLJIT_TMP_R8 (SLJIT_TMP_REGISTER_BASE + 8)
803 #define SLJIT_TMP_R9 (SLJIT_TMP_REGISTER_BASE + 9)
804 #define SLJIT_TMP_R(i) (SLJIT_TMP_REGISTER_BASE + (i))
806 #define SLJIT_TMP_FR0 (SLJIT_TMP_FREGISTER_BASE + 0)
807 #define SLJIT_TMP_FR1 (SLJIT_TMP_FREGISTER_BASE + 1)
808 #define SLJIT_TMP_FR2 (SLJIT_TMP_FREGISTER_BASE + 2)
809 #define SLJIT_TMP_FR3 (SLJIT_TMP_FREGISTER_BASE + 3)
810 #define SLJIT_TMP_FR4 (SLJIT_TMP_FREGISTER_BASE + 4)
811 #define SLJIT_TMP_FR5 (SLJIT_TMP_FREGISTER_BASE + 5)
812 #define SLJIT_TMP_FR6 (SLJIT_TMP_FREGISTER_BASE + 6)
813 #define SLJIT_TMP_FR7 (SLJIT_TMP_FREGISTER_BASE + 7)
814 #define SLJIT_TMP_FR8 (SLJIT_TMP_FREGISTER_BASE + 8)
815 #define SLJIT_TMP_FR9 (SLJIT_TMP_FREGISTER_BASE + 9)
816 #define SLJIT_TMP_FR(i) (SLJIT_TMP_FREGISTER_BASE + (i))
822 #if (defined SLJIT_CONFIG_ARM && SLJIT_CONFIG_ARM) \
823 || (defined SLJIT_CONFIG_PPC && SLJIT_CONFIG_PPC) \
824 || (defined SLJIT_CONFIG_MIPS && SLJIT_CONFIG_MIPS) \
825 || (defined SLJIT_CONFIG_RISCV && SLJIT_CONFIG_RISCV) \
826 || (defined SLJIT_CONFIG_S390X && SLJIT_CONFIG_S390X) \
827 || (defined SLJIT_CONFIG_LOONGARCH && SLJIT_CONFIG_LOONGARCH)
828 #define SLJIT_HAS_STATUS_FLAGS_STATE 1
835 #if (defined SLJIT_CONFIG_ARM_32 && SLJIT_CONFIG_ARM_32) \
836 || (defined SLJIT_CONFIG_MIPS_32 && SLJIT_CONFIG_MIPS_32)
837 #define SLJIT_F64_SECOND(reg) \
838 ((reg) + SLJIT_FS0 + SLJIT_NUMBER_OF_TEMPORARY_FLOAT_REGISTERS)
840 #define SLJIT_F64_SECOND(reg) \
848 #if (defined SLJIT_DEBUG && SLJIT_DEBUG)
850 #if !defined(SLJIT_ASSERT) || !defined(SLJIT_UNREACHABLE)
853 #ifndef SLJIT_HALT_PROCESS
854 #define SLJIT_HALT_PROCESS() \
863 #define SLJIT_ASSERT(x) \
865 if (SLJIT_UNLIKELY(!(x))) { \
866 printf("Assertion failed at " __FILE__ ":%d\n", __LINE__); \
867 SLJIT_HALT_PROCESS(); \
873 #ifndef SLJIT_UNREACHABLE
875 #define SLJIT_UNREACHABLE() \
877 printf("Should never been reached " __FILE__ ":%d\n", __LINE__); \
878 SLJIT_HALT_PROCESS(); \
887 #undef SLJIT_UNREACHABLE
889 #define SLJIT_ASSERT(x) \
891 #define SLJIT_UNREACHABLE() \
896 #ifndef SLJIT_COMPILE_ASSERT
898 #define SLJIT_COMPILE_ASSERT(x, description) \
899 switch(0) { case 0: case ((x) ? 1 : 0): break; }
const struct ncbi::grid::netcache::search::fields::SIZE size
unsigned short int sljit_u16
signed short int sljit_s16
#define SLJIT_API_FUNC_ATTRIBUTE
SLJIT_API_FUNC_ATTRIBUTE void sljit_free_exec(void *ptr)
SLJIT_API_FUNC_ATTRIBUTE void * sljit_malloc_exec(sljit_uw size)
SLJIT_API_FUNC_ATTRIBUTE void sljit_free_unused_memory_exec(void)