Lines Matching refs:compiler
43 if (SLJIT_UNLIKELY(compiler->error)) \
44 return compiler->error; \
49 if (SLJIT_UNLIKELY(compiler->error)) \
56 return compiler->error; \
68 compiler->error = SLJIT_ERR_ALLOC_FAILED; \
76 compiler->error = SLJIT_ERR_ALLOC_FAILED; \
84 compiler->error = SLJIT_ERR_EX_ALLOC_FAILED; \
294 compiler->error = SLJIT_ERR_BAD_ARGUMENT; \
302 compiler->error = SLJIT_ERR_BAD_ARGUMENT; \
358 …struct sljit_compiler *compiler = (struct sljit_compiler*)SLJIT_MALLOC(sizeof(struct sljit_compile… in sljit_create_compiler() local
359 if (!compiler) in sljit_create_compiler()
361 SLJIT_ZEROMEM(compiler, sizeof(struct sljit_compiler)); in sljit_create_compiler()
380 compiler->error = SLJIT_SUCCESS; in sljit_create_compiler()
382 compiler->allocator_data = allocator_data; in sljit_create_compiler()
383 compiler->buf = (struct sljit_memory_fragment*)SLJIT_MALLOC(BUF_SIZE, allocator_data); in sljit_create_compiler()
384 compiler->abuf = (struct sljit_memory_fragment*)SLJIT_MALLOC(ABUF_SIZE, allocator_data); in sljit_create_compiler()
386 if (!compiler->buf || !compiler->abuf) { in sljit_create_compiler()
387 if (compiler->buf) in sljit_create_compiler()
388 SLJIT_FREE(compiler->buf, allocator_data); in sljit_create_compiler()
389 if (compiler->abuf) in sljit_create_compiler()
390 SLJIT_FREE(compiler->abuf, allocator_data); in sljit_create_compiler()
391 SLJIT_FREE(compiler, allocator_data); in sljit_create_compiler()
395 compiler->buf->next = NULL; in sljit_create_compiler()
396 compiler->buf->used_size = 0; in sljit_create_compiler()
397 compiler->abuf->next = NULL; in sljit_create_compiler()
398 compiler->abuf->used_size = 0; in sljit_create_compiler()
400 compiler->scratches = -1; in sljit_create_compiler()
401 compiler->saveds = -1; in sljit_create_compiler()
402 compiler->fscratches = -1; in sljit_create_compiler()
403 compiler->fsaveds = -1; in sljit_create_compiler()
404 compiler->local_size = -1; in sljit_create_compiler()
407 compiler->args = -1; in sljit_create_compiler()
411 compiler->cpool = (sljit_uw*)SLJIT_MALLOC(CPOOL_SIZE * sizeof(sljit_uw) in sljit_create_compiler()
413 if (!compiler->cpool) { in sljit_create_compiler()
414 SLJIT_FREE(compiler->buf, allocator_data); in sljit_create_compiler()
415 SLJIT_FREE(compiler->abuf, allocator_data); in sljit_create_compiler()
416 SLJIT_FREE(compiler, allocator_data); in sljit_create_compiler()
419 compiler->cpool_unique = (sljit_u8*)(compiler->cpool + CPOOL_SIZE); in sljit_create_compiler()
420 compiler->cpool_diff = 0xffffffff; in sljit_create_compiler()
424 compiler->delay_slot = UNMOVABLE_INS; in sljit_create_compiler()
428 compiler->delay_slot = UNMOVABLE_INS; in sljit_create_compiler()
438 return compiler; in sljit_create_compiler()
441 SLJIT_API_FUNC_ATTRIBUTE void sljit_free_compiler(struct sljit_compiler *compiler) in sljit_free_compiler() argument
445 void *allocator_data = compiler->allocator_data; in sljit_free_compiler()
448 buf = compiler->buf; in sljit_free_compiler()
455 buf = compiler->abuf; in sljit_free_compiler()
463 SLJIT_FREE(compiler->cpool, allocator_data); in sljit_free_compiler()
465 SLJIT_FREE(compiler, allocator_data); in sljit_free_compiler()
468 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_compiler_memory_error(struct sljit_compiler *compiler) in sljit_set_compiler_memory_error() argument
470 if (compiler->error == SLJIT_SUCCESS) in sljit_set_compiler_memory_error()
471 compiler->error = SLJIT_ERR_ALLOC_FAILED; in sljit_set_compiler_memory_error()
512 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_current_flags(struct sljit_compiler *compiler, sljit_s32 cu… in sljit_set_current_flags() argument
514 SLJIT_UNUSED_ARG(compiler); in sljit_set_current_flags()
519 …compiler->last_flags = GET_FLAG_TYPE(current_flags) | (current_flags & (SLJIT_I32_OP | SLJIT_SET_Z… in sljit_set_current_flags()
528 static void* ensure_buf(struct sljit_compiler *compiler, sljit_uw size) in ensure_buf() argument
534 …if (compiler->buf->used_size + size <= (BUF_SIZE - (sljit_uw)SLJIT_OFFSETOF(struct sljit_memory_fr… in ensure_buf()
535 ret = compiler->buf->memory + compiler->buf->used_size; in ensure_buf()
536 compiler->buf->used_size += size; in ensure_buf()
539 new_frag = (struct sljit_memory_fragment*)SLJIT_MALLOC(BUF_SIZE, compiler->allocator_data); in ensure_buf()
541 new_frag->next = compiler->buf; in ensure_buf()
542 compiler->buf = new_frag; in ensure_buf()
547 static void* ensure_abuf(struct sljit_compiler *compiler, sljit_uw size) in ensure_abuf() argument
553 …if (compiler->abuf->used_size + size <= (ABUF_SIZE - (sljit_uw)SLJIT_OFFSETOF(struct sljit_memory_… in ensure_abuf()
554 ret = compiler->abuf->memory + compiler->abuf->used_size; in ensure_abuf()
555 compiler->abuf->used_size += size; in ensure_abuf()
558 new_frag = (struct sljit_memory_fragment*)SLJIT_MALLOC(ABUF_SIZE, compiler->allocator_data); in ensure_abuf()
560 new_frag->next = compiler->abuf; in ensure_abuf()
561 compiler->abuf = new_frag; in ensure_abuf()
566 SLJIT_API_FUNC_ATTRIBUTE void* sljit_alloc_memory(struct sljit_compiler *compiler, sljit_s32 size) in sljit_alloc_memory() argument
579 return ensure_abuf(compiler, size); in sljit_alloc_memory()
582 static SLJIT_INLINE void reverse_buf(struct sljit_compiler *compiler) in reverse_buf() argument
584 struct sljit_memory_fragment *buf = compiler->buf; in reverse_buf()
595 compiler->buf = prev; in reverse_buf()
598 static SLJIT_INLINE void set_emit_enter(struct sljit_compiler *compiler, in set_emit_enter() argument
605 compiler->options = options; in set_emit_enter()
606 compiler->scratches = scratches; in set_emit_enter()
607 compiler->saveds = saveds; in set_emit_enter()
608 compiler->fscratches = fscratches; in set_emit_enter()
609 compiler->fsaveds = fsaveds; in set_emit_enter()
611 compiler->logical_local_size = local_size; in set_emit_enter()
615 static SLJIT_INLINE void set_set_context(struct sljit_compiler *compiler, in set_set_context() argument
622 compiler->options = options; in set_set_context()
623 compiler->scratches = scratches; in set_set_context()
624 compiler->saveds = saveds; in set_set_context()
625 compiler->fscratches = fscratches; in set_set_context()
626 compiler->fsaveds = fsaveds; in set_set_context()
628 compiler->logical_local_size = local_size; in set_set_context()
632 static SLJIT_INLINE void set_label(struct sljit_label *label, struct sljit_compiler *compiler) in set_label() argument
635 label->size = compiler->size; in set_label()
636 if (compiler->last_label) in set_label()
637 compiler->last_label->next = label; in set_label()
639 compiler->labels = label; in set_label()
640 compiler->last_label = label; in set_label()
643 static SLJIT_INLINE void set_jump(struct sljit_jump *jump, struct sljit_compiler *compiler, sljit_s… in set_jump() argument
647 if (compiler->last_jump) in set_jump()
648 compiler->last_jump->next = jump; in set_jump()
650 compiler->jumps = jump; in set_jump()
651 compiler->last_jump = jump; in set_jump()
654 static SLJIT_INLINE void set_const(struct sljit_const *const_, struct sljit_compiler *compiler) in set_const() argument
657 const_->addr = compiler->size; in set_const()
658 if (compiler->last_const) in set_const()
659 compiler->last_const->next = const_; in set_const()
661 compiler->consts = const_; in set_const()
662 compiler->last_const = const_; in set_const()
671 (((r) >= SLJIT_R0 && (r) < (SLJIT_R0 + compiler->scratches)) || \
672 ((r) > (SLJIT_S0 - compiler->saveds) && (r) <= SLJIT_S0))
676 ((r) >= SLJIT_R0 && (r) < (SLJIT_R0 + compiler->scratches)) || \
677 ((r) > (SLJIT_S0 - compiler->saveds) && (r) <= SLJIT_S0))
687 CHECK_ARGUMENT(compiler->scratches != -1 && compiler->saveds != -1); \
693 CHECK_ARGUMENT((i) >= 0 && (i) < compiler->logical_local_size); \
708 CHECK_ARGUMENT(compiler->scratches != -1 && compiler->saveds != -1); \
712 CHECK_ARGUMENT((i) >= 0 && (i) < compiler->logical_local_size); \
727 CHECK_ARGUMENT(compiler->fscratches != -1 && compiler->fsaveds != -1); \
728 if (((p) >= SLJIT_FR0 && (p) < (SLJIT_FR0 + compiler->fscratches)) || \
729 ((p) > (SLJIT_FS0 - compiler->fsaveds) && (p) <= SLJIT_FS0)) \
732 CHECK_ARGUMENT((i) >= 0 && (i) < compiler->logical_local_size); \
750 SLJIT_API_FUNC_ATTRIBUTE void sljit_compiler_verbose(struct sljit_compiler *compiler, FILE* verbose) in sljit_compiler_verbose() argument
752 compiler->verbose = verbose; in sljit_compiler_verbose()
765 #define sljit_verbose_reg(compiler, r) \ argument
767 if ((r) < (SLJIT_R0 + compiler->scratches)) \
768 fprintf(compiler->verbose, "r%d", (r) - SLJIT_R0); \
770 fprintf(compiler->verbose, "s%d", SLJIT_NUMBER_OF_REGISTERS - (r)); \
772 fprintf(compiler->verbose, "sp"); \
775 #define sljit_verbose_param(compiler, p, i) \ argument
777 fprintf(compiler->verbose, "#%" SLJIT_PRINT_D "d", (i)); \
780 fputc('[', compiler->verbose); \
781 sljit_verbose_reg(compiler, (p) & REG_MASK); \
783 fprintf(compiler->verbose, " + "); \
784 sljit_verbose_reg(compiler, OFFS_REG(p)); \
786 fprintf(compiler->verbose, " * %d", 1 << (i)); \
789 fprintf(compiler->verbose, " + %" SLJIT_PRINT_D "d", (i)); \
790 fputc(']', compiler->verbose); \
793 fprintf(compiler->verbose, "[#%" SLJIT_PRINT_D "d]", (i)); \
795 sljit_verbose_reg(compiler, p); \
797 fprintf(compiler->verbose, "unused");
799 #define sljit_verbose_fparam(compiler, p, i) \ argument
802 fputc('[', compiler->verbose); \
803 sljit_verbose_reg(compiler, (p) & REG_MASK); \
805 fprintf(compiler->verbose, " + "); \
806 sljit_verbose_reg(compiler, OFFS_REG(p)); \
808 fprintf(compiler->verbose, "%d", 1 << (i)); \
811 fprintf(compiler->verbose, "%" SLJIT_PRINT_D "d", (i)); \
812 fputc(']', compiler->verbose); \
815 fprintf(compiler->verbose, "[#%" SLJIT_PRINT_D "d]", (i)); \
818 if ((p) < (SLJIT_FR0 + compiler->fscratches)) \
819 fprintf(compiler->verbose, "fr%d", (p) - SLJIT_FR0); \
821 fprintf(compiler->verbose, "fs%d", SLJIT_NUMBER_OF_FLOAT_REGISTERS - (p)); \
883 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_generate_code(struct sljit_compiler *compiler) in check_sljit_generate_code() argument
889 SLJIT_UNUSED_ARG(compiler); in check_sljit_generate_code()
892 CHECK_ARGUMENT(compiler->size > 0); in check_sljit_generate_code()
893 jump = compiler->jumps; in check_sljit_generate_code()
903 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_enter(struct sljit_compiler *compiler, in check_sljit_emit_enter() argument
907 SLJIT_UNUSED_ARG(compiler); in check_sljit_emit_enter()
920 compiler->last_flags = 0; in check_sljit_emit_enter()
923 if (SLJIT_UNLIKELY(!!compiler->verbose)) in check_sljit_emit_enter()
924 …fprintf(compiler->verbose, " enter options:none args:%d scratches:%d saveds:%d fscratches:%d fsav… in check_sljit_emit_enter()
930 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_set_context(struct sljit_compiler *compiler, in check_sljit_set_context() argument
945 compiler->last_flags = 0; in check_sljit_set_context()
948 if (SLJIT_UNLIKELY(!!compiler->verbose)) in check_sljit_set_context()
949 …fprintf(compiler->verbose, " set_context options:none args:%d scratches:%d saveds:%d fscratches:%… in check_sljit_set_context()
955 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_return(struct sljit_compiler *compiler, slji… in check_sljit_emit_return() argument
958 CHECK_ARGUMENT(compiler->scratches >= 0); in check_sljit_emit_return()
965 compiler->last_flags = 0; in check_sljit_emit_return()
968 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_return()
970 fprintf(compiler->verbose, " return\n"); in check_sljit_emit_return()
972 fprintf(compiler->verbose, " return%s ", op1_names[op - SLJIT_OP1_BASE]); in check_sljit_emit_return()
973 sljit_verbose_param(compiler, src, srcw); in check_sljit_emit_return()
974 fprintf(compiler->verbose, "\n"); in check_sljit_emit_return()
981 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fast_enter(struct sljit_compiler *compiler, … in check_sljit_emit_fast_enter() argument
985 compiler->last_flags = 0; in check_sljit_emit_fast_enter()
988 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_fast_enter()
989 fprintf(compiler->verbose, " fast_enter "); in check_sljit_emit_fast_enter()
990 sljit_verbose_param(compiler, dst, dstw); in check_sljit_emit_fast_enter()
991 fprintf(compiler->verbose, "\n"); in check_sljit_emit_fast_enter()
997 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fast_return(struct sljit_compiler *compiler,… in check_sljit_emit_fast_return() argument
1001 compiler->last_flags = 0; in check_sljit_emit_fast_return()
1004 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_fast_return()
1005 fprintf(compiler->verbose, " fast_return "); in check_sljit_emit_fast_return()
1006 sljit_verbose_param(compiler, src, srcw); in check_sljit_emit_fast_return()
1007 fprintf(compiler->verbose, "\n"); in check_sljit_emit_fast_return()
1013 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_op0(struct sljit_compiler *compiler, sljit_s… in check_sljit_emit_op0() argument
1018 CHECK_ARGUMENT(op < SLJIT_LMUL_UW || compiler->scratches >= 2); in check_sljit_emit_op0()
1020 compiler->last_flags = 0; in check_sljit_emit_op0()
1023 if (SLJIT_UNLIKELY(!!compiler->verbose)) in check_sljit_emit_op0()
1025 fprintf(compiler->verbose, " %s", op0_names[GET_OPCODE(op) - SLJIT_OP0_BASE]); in check_sljit_emit_op0()
1027 fprintf(compiler->verbose, (op & SLJIT_I32_OP) ? "32" : "w"); in check_sljit_emit_op0()
1029 fprintf(compiler->verbose, "\n"); in check_sljit_emit_op0()
1035 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_op1(struct sljit_compiler *compiler, sljit_s… in check_sljit_emit_op1() argument
1039 if (SLJIT_UNLIKELY(compiler->skip_checks)) { in check_sljit_emit_op1()
1040 compiler->skip_checks = 0; in check_sljit_emit_op1()
1076 compiler->last_flags = GET_FLAG_TYPE(op) | (op & (SLJIT_I32_OP | SLJIT_SET_Z)); in check_sljit_emit_op1()
1088 compiler->last_flags = 0; in check_sljit_emit_op1()
1092 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_op1()
1095 fprintf(compiler->verbose, " mov%s%s%s ", (GET_OPCODE(op) >= SLJIT_MOVU) ? "u" : "", in check_sljit_emit_op1()
1100 …fprintf(compiler->verbose, " %s%s%s%s%s ", op1_names[GET_OPCODE(op) - SLJIT_OP1_BASE], !(op & SLJ… in check_sljit_emit_op1()
1105 sljit_verbose_param(compiler, dst, dstw); in check_sljit_emit_op1()
1106 fprintf(compiler->verbose, ", "); in check_sljit_emit_op1()
1107 sljit_verbose_param(compiler, src, srcw); in check_sljit_emit_op1()
1108 fprintf(compiler->verbose, "\n"); in check_sljit_emit_op1()
1114 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_op2(struct sljit_compiler *compiler, sljit_s… in check_sljit_emit_op2() argument
1119 if (SLJIT_UNLIKELY(compiler->skip_checks)) { in check_sljit_emit_op2()
1120 compiler->skip_checks = 0; in check_sljit_emit_op2()
1157 CHECK_ARGUMENT((compiler->last_flags & 0xff) == GET_FLAG_TYPE(SLJIT_SET_CARRY)); in check_sljit_emit_op2()
1158 CHECK_ARGUMENT((op & SLJIT_I32_OP) == (compiler->last_flags & SLJIT_I32_OP)); in check_sljit_emit_op2()
1168 compiler->last_flags = GET_FLAG_TYPE(op) | (op & (SLJIT_I32_OP | SLJIT_SET_Z)); in check_sljit_emit_op2()
1171 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_op2()
1172 …fprintf(compiler->verbose, " %s%s%s%s%s ", op2_names[GET_OPCODE(op) - SLJIT_OP2_BASE], !(op & SLJ… in check_sljit_emit_op2()
1175 sljit_verbose_param(compiler, dst, dstw); in check_sljit_emit_op2()
1176 fprintf(compiler->verbose, ", "); in check_sljit_emit_op2()
1177 sljit_verbose_param(compiler, src1, src1w); in check_sljit_emit_op2()
1178 fprintf(compiler->verbose, ", "); in check_sljit_emit_op2()
1179 sljit_verbose_param(compiler, src2, src2w); in check_sljit_emit_op2()
1180 fprintf(compiler->verbose, "\n"); in check_sljit_emit_op2()
1204 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_op_custom(struct sljit_compiler *compiler, in check_sljit_emit_op_custom() argument
1211 SLJIT_UNUSED_ARG(compiler); in check_sljit_emit_op_custom()
1225 compiler->last_flags = 0; in check_sljit_emit_op_custom()
1228 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_op_custom()
1229 fprintf(compiler->verbose, " op_custom"); in check_sljit_emit_op_custom()
1231 fprintf(compiler->verbose, " 0x%x", ((sljit_u8*)instruction)[i]); in check_sljit_emit_op_custom()
1232 fprintf(compiler->verbose, "\n"); in check_sljit_emit_op_custom()
1238 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fop1(struct sljit_compiler *compiler, sljit_… in check_sljit_emit_fop1() argument
1242 if (SLJIT_UNLIKELY(compiler->skip_checks)) { in check_sljit_emit_fop1()
1243 compiler->skip_checks = 0; in check_sljit_emit_fop1()
1255 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_fop1()
1257 fprintf(compiler->verbose, " %s%s ", fop1_names[SLJIT_CONV_F64_FROM_F32 - SLJIT_FOP1_BASE], in check_sljit_emit_fop1()
1260 fprintf(compiler->verbose, " %s%s ", fop1_names[GET_OPCODE(op) - SLJIT_FOP1_BASE], in check_sljit_emit_fop1()
1263 sljit_verbose_fparam(compiler, dst, dstw); in check_sljit_emit_fop1()
1264 fprintf(compiler->verbose, ", "); in check_sljit_emit_fop1()
1265 sljit_verbose_fparam(compiler, src, srcw); in check_sljit_emit_fop1()
1266 fprintf(compiler->verbose, "\n"); in check_sljit_emit_fop1()
1272 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fop1_cmp(struct sljit_compiler *compiler, sl… in check_sljit_emit_fop1_cmp() argument
1277 compiler->last_flags = GET_FLAG_TYPE(op) | (op & (SLJIT_I32_OP | SLJIT_SET_Z)); in check_sljit_emit_fop1_cmp()
1280 if (SLJIT_UNLIKELY(compiler->skip_checks)) { in check_sljit_emit_fop1_cmp()
1281 compiler->skip_checks = 0; in check_sljit_emit_fop1_cmp()
1295 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_fop1_cmp()
1296 …fprintf(compiler->verbose, " %s%s", fop1_names[SLJIT_CMP_F64 - SLJIT_FOP1_BASE], (op & SLJIT_F32_… in check_sljit_emit_fop1_cmp()
1298 fprintf(compiler->verbose, ".%s_f", jump_names[GET_FLAG_TYPE(op)]); in check_sljit_emit_fop1_cmp()
1300 fprintf(compiler->verbose, " "); in check_sljit_emit_fop1_cmp()
1301 sljit_verbose_fparam(compiler, src1, src1w); in check_sljit_emit_fop1_cmp()
1302 fprintf(compiler->verbose, ", "); in check_sljit_emit_fop1_cmp()
1303 sljit_verbose_fparam(compiler, src2, src2w); in check_sljit_emit_fop1_cmp()
1304 fprintf(compiler->verbose, "\n"); in check_sljit_emit_fop1_cmp()
1310 …K_RETURN_TYPE check_sljit_emit_fop1_conv_sw_from_f64(struct sljit_compiler *compiler, sljit_s32 op, in check_sljit_emit_fop1_conv_sw_from_f64() argument
1314 if (SLJIT_UNLIKELY(compiler->skip_checks)) { in check_sljit_emit_fop1_conv_sw_from_f64()
1315 compiler->skip_checks = 0; in check_sljit_emit_fop1_conv_sw_from_f64()
1327 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_fop1_conv_sw_from_f64()
1328 fprintf(compiler->verbose, " %s%s.from%s ", fop1_names[GET_OPCODE(op) - SLJIT_FOP1_BASE], in check_sljit_emit_fop1_conv_sw_from_f64()
1331 sljit_verbose_param(compiler, dst, dstw); in check_sljit_emit_fop1_conv_sw_from_f64()
1332 fprintf(compiler->verbose, ", "); in check_sljit_emit_fop1_conv_sw_from_f64()
1333 sljit_verbose_fparam(compiler, src, srcw); in check_sljit_emit_fop1_conv_sw_from_f64()
1334 fprintf(compiler->verbose, "\n"); in check_sljit_emit_fop1_conv_sw_from_f64()
1340 …K_RETURN_TYPE check_sljit_emit_fop1_conv_f64_from_sw(struct sljit_compiler *compiler, sljit_s32 op, in check_sljit_emit_fop1_conv_f64_from_sw() argument
1344 if (SLJIT_UNLIKELY(compiler->skip_checks)) { in check_sljit_emit_fop1_conv_f64_from_sw()
1345 compiler->skip_checks = 0; in check_sljit_emit_fop1_conv_f64_from_sw()
1357 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_fop1_conv_f64_from_sw()
1358 fprintf(compiler->verbose, " %s%s.from%s ", fop1_names[GET_OPCODE(op) - SLJIT_FOP1_BASE], in check_sljit_emit_fop1_conv_f64_from_sw()
1361 sljit_verbose_fparam(compiler, dst, dstw); in check_sljit_emit_fop1_conv_f64_from_sw()
1362 fprintf(compiler->verbose, ", "); in check_sljit_emit_fop1_conv_f64_from_sw()
1363 sljit_verbose_param(compiler, src, srcw); in check_sljit_emit_fop1_conv_f64_from_sw()
1364 fprintf(compiler->verbose, "\n"); in check_sljit_emit_fop1_conv_f64_from_sw()
1370 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fop2(struct sljit_compiler *compiler, sljit_… in check_sljit_emit_fop2() argument
1384 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_fop2()
1385 …fprintf(compiler->verbose, " %s%s ", fop2_names[GET_OPCODE(op) - SLJIT_FOP2_BASE], (op & SLJIT_F3… in check_sljit_emit_fop2()
1386 sljit_verbose_fparam(compiler, dst, dstw); in check_sljit_emit_fop2()
1387 fprintf(compiler->verbose, ", "); in check_sljit_emit_fop2()
1388 sljit_verbose_fparam(compiler, src1, src1w); in check_sljit_emit_fop2()
1389 fprintf(compiler->verbose, ", "); in check_sljit_emit_fop2()
1390 sljit_verbose_fparam(compiler, src2, src2w); in check_sljit_emit_fop2()
1391 fprintf(compiler->verbose, "\n"); in check_sljit_emit_fop2()
1397 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_label(struct sljit_compiler *compiler) in check_sljit_emit_label() argument
1399 SLJIT_UNUSED_ARG(compiler); in check_sljit_emit_label()
1402 compiler->last_flags = 0; in check_sljit_emit_label()
1406 if (SLJIT_UNLIKELY(!!compiler->verbose)) in check_sljit_emit_label()
1407 fprintf(compiler->verbose, "label:\n"); in check_sljit_emit_label()
1412 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_jump(struct sljit_compiler *compiler, sljit_… in check_sljit_emit_jump() argument
1414 if (SLJIT_UNLIKELY(compiler->skip_checks)) { in check_sljit_emit_jump()
1415 compiler->skip_checks = 0; in check_sljit_emit_jump()
1424 …CHECK_ARGUMENT((type & 0xff) <= SLJIT_CALL0 || ((type & 0xff) - SLJIT_CALL0) <= compiler->scratche… in check_sljit_emit_jump()
1428 CHECK_ARGUMENT(compiler->last_flags & SLJIT_SET_Z); in check_sljit_emit_jump()
1430 CHECK_ARGUMENT((type & 0xff) == (compiler->last_flags & 0xff)); in check_sljit_emit_jump()
1431 CHECK_ARGUMENT((type & SLJIT_I32_OP) == (compiler->last_flags & SLJIT_I32_OP)); in check_sljit_emit_jump()
1435 if (SLJIT_UNLIKELY(!!compiler->verbose)) in check_sljit_emit_jump()
1436 fprintf(compiler->verbose, " jump%s %s%s\n", !(type & SLJIT_REWRITABLE_JUMP) ? "" : ".r", in check_sljit_emit_jump()
1442 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_cmp(struct sljit_compiler *compiler, sljit_s… in check_sljit_emit_cmp() argument
1451 compiler->last_flags = 0; in check_sljit_emit_cmp()
1454 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_cmp()
1455 fprintf(compiler->verbose, " cmp%s %s%s, ", !(type & SLJIT_REWRITABLE_JUMP) ? "" : ".r", in check_sljit_emit_cmp()
1457 sljit_verbose_param(compiler, src1, src1w); in check_sljit_emit_cmp()
1458 fprintf(compiler->verbose, ", "); in check_sljit_emit_cmp()
1459 sljit_verbose_param(compiler, src2, src2w); in check_sljit_emit_cmp()
1460 fprintf(compiler->verbose, "\n"); in check_sljit_emit_cmp()
1466 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fcmp(struct sljit_compiler *compiler, sljit_… in check_sljit_emit_fcmp() argument
1476 compiler->last_flags = 0; in check_sljit_emit_fcmp()
1479 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_fcmp()
1480 fprintf(compiler->verbose, " fcmp%s %s%s, ", !(type & SLJIT_REWRITABLE_JUMP) ? "" : ".r", in check_sljit_emit_fcmp()
1482 sljit_verbose_fparam(compiler, src1, src1w); in check_sljit_emit_fcmp()
1483 fprintf(compiler->verbose, ", "); in check_sljit_emit_fcmp()
1484 sljit_verbose_fparam(compiler, src2, src2w); in check_sljit_emit_fcmp()
1485 fprintf(compiler->verbose, "\n"); in check_sljit_emit_fcmp()
1491 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_ijump(struct sljit_compiler *compiler, sljit… in check_sljit_emit_ijump() argument
1494 compiler->last_flags = 0; in check_sljit_emit_ijump()
1497 if (SLJIT_UNLIKELY(compiler->skip_checks)) { in check_sljit_emit_ijump()
1498 compiler->skip_checks = 0; in check_sljit_emit_ijump()
1504 CHECK_ARGUMENT(type <= SLJIT_CALL0 || (type - SLJIT_CALL0) <= compiler->scratches); in check_sljit_emit_ijump()
1508 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_ijump()
1509 fprintf(compiler->verbose, " ijump.%s ", jump_names[type]); in check_sljit_emit_ijump()
1510 sljit_verbose_param(compiler, src, srcw); in check_sljit_emit_ijump()
1511 fprintf(compiler->verbose, "\n"); in check_sljit_emit_ijump()
1517 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_op_flags(struct sljit_compiler *compiler, sl… in check_sljit_emit_op_flags() argument
1531 CHECK_ARGUMENT(compiler->last_flags & SLJIT_SET_Z); in check_sljit_emit_op_flags()
1533 CHECK_ARGUMENT((type & 0xff) == (compiler->last_flags & 0xff)); in check_sljit_emit_op_flags()
1539 compiler->last_flags = GET_FLAG_TYPE(op) | (op & (SLJIT_I32_OP | SLJIT_SET_Z)); in check_sljit_emit_op_flags()
1544 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_op_flags()
1545 fprintf(compiler->verbose, " flags%s %s%s, ", in check_sljit_emit_op_flags()
1549 sljit_verbose_param(compiler, dst, dstw); in check_sljit_emit_op_flags()
1551 fprintf(compiler->verbose, ", "); in check_sljit_emit_op_flags()
1552 sljit_verbose_param(compiler, src, srcw); in check_sljit_emit_op_flags()
1554 fprintf(compiler->verbose, ", %s%s\n", jump_names[type & 0xff], JUMP_POSTFIX(type)); in check_sljit_emit_op_flags()
1560 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_get_local_base(struct sljit_compiler *compiler, s… in check_sljit_get_local_base() argument
1568 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_get_local_base()
1569 fprintf(compiler->verbose, " local_base "); in check_sljit_get_local_base()
1570 sljit_verbose_param(compiler, dst, dstw); in check_sljit_get_local_base()
1571 fprintf(compiler->verbose, ", #%" SLJIT_PRINT_D "d\n", offset); in check_sljit_get_local_base()
1577 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_const(struct sljit_compiler *compiler, sljit… in check_sljit_emit_const() argument
1585 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_const()
1586 fprintf(compiler->verbose, " const "); in check_sljit_emit_const()
1587 sljit_verbose_param(compiler, dst, dstw); in check_sljit_emit_const()
1588 fprintf(compiler->verbose, ", #%" SLJIT_PRINT_D "d\n", init_value); in check_sljit_emit_const()
1596 #define SELECT_FOP1_OPERATION_WITH_CHECKS(compiler, op, dst, dstw, src, srcw) \ argument
1601 CHECK(check_sljit_emit_fop1_cmp(compiler, op, dst, dstw, src, srcw)); \
1604 return sljit_emit_fop1_cmp(compiler, op, dst, dstw, src, srcw); \
1607 CHECK(check_sljit_emit_fop1_conv_sw_from_f64(compiler, op, dst, dstw, src, srcw)); \
1610 return sljit_emit_fop1_conv_sw_from_f64(compiler, op, dst, dstw, src, srcw); \
1612 CHECK(check_sljit_emit_fop1_conv_f64_from_sw(compiler, op, dst, dstw, src, srcw)); \
1615 return sljit_emit_fop1_conv_f64_from_sw(compiler, op, dst, dstw, src, srcw); \
1617 CHECK(check_sljit_emit_fop1(compiler, op, dst, dstw, src, srcw)); \
1621 static SLJIT_INLINE sljit_s32 emit_mov_before_return(struct sljit_compiler *compiler, sljit_s32 op,… in emit_mov_before_return() argument
1638 compiler->skip_checks = 1; in emit_mov_before_return()
1640 return sljit_emit_op1(compiler, op, SLJIT_RETURN_REG, 0, src, srcw); in emit_mov_before_return()
1691 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_cmp(struct sljit_compiler *compiler, sljit_s… in sljit_emit_cmp() argument
1700 CHECK_PTR(check_sljit_emit_cmp(compiler, type, src1, src1w, src2, src2w)); in sljit_emit_cmp()
1712 return emit_cmp_to0(compiler, type, src1, src1w); in sljit_emit_cmp()
1761 compiler->skip_checks = 1; in sljit_emit_cmp()
1763 PTR_FAIL_IF(sljit_emit_op2(compiler, SLJIT_SUB | flags | (type & SLJIT_I32_OP), in sljit_emit_cmp()
1767 compiler->skip_checks = 1; in sljit_emit_cmp()
1769 return sljit_emit_jump(compiler, condition | (type & (SLJIT_REWRITABLE_JUMP | SLJIT_I32_OP))); in sljit_emit_cmp()
1774 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_fcmp(struct sljit_compiler *compiler, sljit_… in sljit_emit_fcmp() argument
1779 CHECK_PTR(check_sljit_emit_fcmp(compiler, type, src1, src1w, src2, src2w)); in sljit_emit_fcmp()
1783 compiler->skip_checks = 1; in sljit_emit_fcmp()
1785 …sljit_emit_fop1(compiler, SLJIT_CMP_F64 | ((type & 0xff) << VARIABLE_FLAG_SHIFT) | (type & SLJIT_I… in sljit_emit_fcmp()
1789 compiler->skip_checks = 1; in sljit_emit_fcmp()
1791 return sljit_emit_jump(compiler, type); in sljit_emit_fcmp()
1796 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_local_base(struct sljit_compiler *compiler, sljit_s32 … in sljit_get_local_base() argument
1799 CHECK(check_sljit_get_local_base(compiler, dst, dstw, offset)); in sljit_get_local_base()
1804 compiler->skip_checks = 1; in sljit_get_local_base()
1807 return sljit_emit_op2(compiler, SLJIT_ADD, dst, dstw, SLJIT_SP, 0, SLJIT_IMM, offset); in sljit_get_local_base()
1808 return sljit_emit_op1(compiler, SLJIT_MOV, dst, dstw, SLJIT_SP, 0); in sljit_get_local_base()
1829 SLJIT_API_FUNC_ATTRIBUTE void sljit_free_compiler(struct sljit_compiler *compiler) in sljit_free_compiler() argument
1831 SLJIT_UNUSED_ARG(compiler); in sljit_free_compiler()
1835 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_compiler_memory_error(struct sljit_compiler *compiler) in sljit_set_compiler_memory_error() argument
1837 SLJIT_UNUSED_ARG(compiler); in sljit_set_compiler_memory_error()
1841 SLJIT_API_FUNC_ATTRIBUTE void* sljit_alloc_memory(struct sljit_compiler *compiler, sljit_s32 size) in sljit_alloc_memory() argument
1843 SLJIT_UNUSED_ARG(compiler); in sljit_alloc_memory()
1850 SLJIT_API_FUNC_ATTRIBUTE void sljit_compiler_verbose(struct sljit_compiler *compiler, FILE* verbose) in sljit_compiler_verbose() argument
1852 SLJIT_UNUSED_ARG(compiler); in sljit_compiler_verbose()
1858 SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compiler) in sljit_generate_code() argument
1860 SLJIT_UNUSED_ARG(compiler); in sljit_generate_code()
1871 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compiler, in sljit_emit_enter() argument
1875 SLJIT_UNUSED_ARG(compiler); in sljit_emit_enter()
1887 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *compiler, in sljit_set_context() argument
1891 SLJIT_UNUSED_ARG(compiler); in sljit_set_context()
1903 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *compiler, sljit_s32 op,… in sljit_emit_return() argument
1905 SLJIT_UNUSED_ARG(compiler); in sljit_emit_return()
1913 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_enter(struct sljit_compiler *compiler, sljit_s32… in sljit_emit_fast_enter() argument
1915 SLJIT_UNUSED_ARG(compiler); in sljit_emit_fast_enter()
1922 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler *compiler, sljit_s3… in sljit_emit_fast_return() argument
1924 SLJIT_UNUSED_ARG(compiler); in sljit_emit_fast_return()
1931 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compiler, sljit_s32 op) in sljit_emit_op0() argument
1933 SLJIT_UNUSED_ARG(compiler); in sljit_emit_op0()
1939 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op1() argument
1943 SLJIT_UNUSED_ARG(compiler); in sljit_emit_op1()
1953 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op2() argument
1958 SLJIT_UNUSED_ARG(compiler); in sljit_emit_op2()
1976 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_custom(struct sljit_compiler *compiler, in sljit_emit_op_custom() argument
1979 SLJIT_UNUSED_ARG(compiler); in sljit_emit_op_custom()
1986 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_current_flags(struct sljit_compiler *compiler, sljit_s32 cu… in sljit_set_current_flags() argument
1988 SLJIT_UNUSED_ARG(compiler); in sljit_set_current_flags()
1998 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop1() argument
2002 SLJIT_UNUSED_ARG(compiler); in sljit_emit_fop1()
2012 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop2(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop2() argument
2017 SLJIT_UNUSED_ARG(compiler); in sljit_emit_fop2()
2029 SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compiler *compiler) in sljit_emit_label() argument
2031 SLJIT_UNUSED_ARG(compiler); in sljit_emit_label()
2036 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compiler *compiler, sljit_… in sljit_emit_jump() argument
2038 SLJIT_UNUSED_ARG(compiler); in sljit_emit_jump()
2044 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_cmp(struct sljit_compiler *compiler, sljit_s… in sljit_emit_cmp() argument
2048 SLJIT_UNUSED_ARG(compiler); in sljit_emit_cmp()
2058 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_fcmp(struct sljit_compiler *compiler, sljit_… in sljit_emit_fcmp() argument
2062 SLJIT_UNUSED_ARG(compiler); in sljit_emit_fcmp()
2086 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compiler, sljit_s32 type… in sljit_emit_ijump() argument
2088 SLJIT_UNUSED_ARG(compiler); in sljit_emit_ijump()
2096 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_s32 o… in sljit_emit_op_flags() argument
2101 SLJIT_UNUSED_ARG(compiler); in sljit_emit_op_flags()
2112 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_get_local_base(struct sljit_compiler *compiler, sljit_s32 … in sljit_get_local_base() argument
2114 SLJIT_UNUSED_ARG(compiler); in sljit_get_local_base()
2122 SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, slji… in sljit_emit_const() argument
2124 SLJIT_UNUSED_ARG(compiler); in sljit_emit_const()