Lines Matching refs:compiler

31 		if (SLJIT_UNLIKELY(compiler->error)) \
32 return compiler->error; \
37 if (SLJIT_UNLIKELY(compiler->error)) \
44 return compiler->error; \
56 compiler->error = SLJIT_ERR_ALLOC_FAILED; \
64 compiler->error = SLJIT_ERR_ALLOC_FAILED; \
72 compiler->error = SLJIT_ERR_EX_ALLOC_FAILED; \
266 compiler->error = SLJIT_ERR_BAD_ARGUMENT; \
274 compiler->error = SLJIT_ERR_BAD_ARGUMENT; \
330 …struct sljit_compiler *compiler = (struct sljit_compiler*)SLJIT_MALLOC(sizeof(struct sljit_compile… in sljit_create_compiler() local
331 if (!compiler) in sljit_create_compiler()
333 SLJIT_ZEROMEM(compiler, sizeof(struct sljit_compiler)); in sljit_create_compiler()
350 compiler->error = SLJIT_SUCCESS; in sljit_create_compiler()
352 compiler->allocator_data = allocator_data; in sljit_create_compiler()
353 compiler->buf = (struct sljit_memory_fragment*)SLJIT_MALLOC(BUF_SIZE, allocator_data); in sljit_create_compiler()
354 compiler->abuf = (struct sljit_memory_fragment*)SLJIT_MALLOC(ABUF_SIZE, allocator_data); in sljit_create_compiler()
356 if (!compiler->buf || !compiler->abuf) { in sljit_create_compiler()
357 if (compiler->buf) in sljit_create_compiler()
358 SLJIT_FREE(compiler->buf, allocator_data); in sljit_create_compiler()
359 if (compiler->abuf) in sljit_create_compiler()
360 SLJIT_FREE(compiler->abuf, allocator_data); in sljit_create_compiler()
361 SLJIT_FREE(compiler, allocator_data); in sljit_create_compiler()
365 compiler->buf->next = NULL; in sljit_create_compiler()
366 compiler->buf->used_size = 0; in sljit_create_compiler()
367 compiler->abuf->next = NULL; in sljit_create_compiler()
368 compiler->abuf->used_size = 0; in sljit_create_compiler()
370 compiler->scratches = -1; in sljit_create_compiler()
371 compiler->saveds = -1; in sljit_create_compiler()
372 compiler->fscratches = -1; in sljit_create_compiler()
373 compiler->fsaveds = -1; in sljit_create_compiler()
374 compiler->local_size = -1; in sljit_create_compiler()
377 compiler->args = -1; in sljit_create_compiler()
381 compiler->cpool = (sljit_uw*)SLJIT_MALLOC(CPOOL_SIZE * sizeof(sljit_uw) in sljit_create_compiler()
383 if (!compiler->cpool) { in sljit_create_compiler()
384 SLJIT_FREE(compiler->buf, allocator_data); in sljit_create_compiler()
385 SLJIT_FREE(compiler->abuf, allocator_data); in sljit_create_compiler()
386 SLJIT_FREE(compiler, allocator_data); in sljit_create_compiler()
389 compiler->cpool_unique = (sljit_ub*)(compiler->cpool + CPOOL_SIZE); in sljit_create_compiler()
390 compiler->cpool_diff = 0xffffffff; in sljit_create_compiler()
394 compiler->delay_slot = UNMOVABLE_INS; in sljit_create_compiler()
398 compiler->delay_slot = UNMOVABLE_INS; in sljit_create_compiler()
408 return compiler; in sljit_create_compiler()
411 SLJIT_API_FUNC_ATTRIBUTE void sljit_free_compiler(struct sljit_compiler *compiler) in sljit_free_compiler() argument
415 void *allocator_data = compiler->allocator_data; in sljit_free_compiler()
418 buf = compiler->buf; in sljit_free_compiler()
425 buf = compiler->abuf; in sljit_free_compiler()
433 SLJIT_FREE(compiler->cpool, allocator_data); in sljit_free_compiler()
435 SLJIT_FREE(compiler, allocator_data); in sljit_free_compiler()
438 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_compiler_memory_error(struct sljit_compiler *compiler) in sljit_set_compiler_memory_error() argument
440 if (compiler->error == SLJIT_SUCCESS) in sljit_set_compiler_memory_error()
441 compiler->error = SLJIT_ERR_ALLOC_FAILED; in sljit_set_compiler_memory_error()
486 static void* ensure_buf(struct sljit_compiler *compiler, sljit_uw size) in ensure_buf() argument
492 …if (compiler->buf->used_size + size <= (BUF_SIZE - (sljit_uw)SLJIT_OFFSETOF(struct sljit_memory_fr… in ensure_buf()
493 ret = compiler->buf->memory + compiler->buf->used_size; in ensure_buf()
494 compiler->buf->used_size += size; in ensure_buf()
497 new_frag = (struct sljit_memory_fragment*)SLJIT_MALLOC(BUF_SIZE, compiler->allocator_data); in ensure_buf()
499 new_frag->next = compiler->buf; in ensure_buf()
500 compiler->buf = new_frag; in ensure_buf()
505 static void* ensure_abuf(struct sljit_compiler *compiler, sljit_uw size) in ensure_abuf() argument
511 …if (compiler->abuf->used_size + size <= (ABUF_SIZE - (sljit_uw)SLJIT_OFFSETOF(struct sljit_memory_… in ensure_abuf()
512 ret = compiler->abuf->memory + compiler->abuf->used_size; in ensure_abuf()
513 compiler->abuf->used_size += size; in ensure_abuf()
516 new_frag = (struct sljit_memory_fragment*)SLJIT_MALLOC(ABUF_SIZE, compiler->allocator_data); in ensure_abuf()
518 new_frag->next = compiler->abuf; in ensure_abuf()
519 compiler->abuf = new_frag; in ensure_abuf()
524 SLJIT_API_FUNC_ATTRIBUTE void* sljit_alloc_memory(struct sljit_compiler *compiler, sljit_si size) in sljit_alloc_memory() argument
537 return ensure_abuf(compiler, size); in sljit_alloc_memory()
540 static SLJIT_INLINE void reverse_buf(struct sljit_compiler *compiler) in reverse_buf() argument
542 struct sljit_memory_fragment *buf = compiler->buf; in reverse_buf()
553 compiler->buf = prev; in reverse_buf()
556 static SLJIT_INLINE void set_emit_enter(struct sljit_compiler *compiler, in set_emit_enter() argument
563 compiler->options = options; in set_emit_enter()
564 compiler->scratches = scratches; in set_emit_enter()
565 compiler->saveds = saveds; in set_emit_enter()
566 compiler->fscratches = fscratches; in set_emit_enter()
567 compiler->fsaveds = fsaveds; in set_emit_enter()
569 compiler->logical_local_size = local_size; in set_emit_enter()
573 static SLJIT_INLINE void set_set_context(struct sljit_compiler *compiler, in set_set_context() argument
580 compiler->options = options; in set_set_context()
581 compiler->scratches = scratches; in set_set_context()
582 compiler->saveds = saveds; in set_set_context()
583 compiler->fscratches = fscratches; in set_set_context()
584 compiler->fsaveds = fsaveds; in set_set_context()
586 compiler->logical_local_size = local_size; in set_set_context()
590 static SLJIT_INLINE void set_label(struct sljit_label *label, struct sljit_compiler *compiler) in set_label() argument
593 label->size = compiler->size; in set_label()
594 if (compiler->last_label) in set_label()
595 compiler->last_label->next = label; in set_label()
597 compiler->labels = label; in set_label()
598 compiler->last_label = label; in set_label()
601 static SLJIT_INLINE void set_jump(struct sljit_jump *jump, struct sljit_compiler *compiler, sljit_s… in set_jump() argument
605 if (compiler->last_jump) in set_jump()
606 compiler->last_jump->next = jump; in set_jump()
608 compiler->jumps = jump; in set_jump()
609 compiler->last_jump = jump; in set_jump()
612 static SLJIT_INLINE void set_const(struct sljit_const *const_, struct sljit_compiler *compiler) in set_const() argument
615 const_->addr = compiler->size; in set_const()
616 if (compiler->last_const) in set_const()
617 compiler->last_const->next = const_; in set_const()
619 compiler->consts = const_; in set_const()
620 compiler->last_const = const_; in set_const()
688 (((r) >= SLJIT_R0 && (r) < (SLJIT_R0 + compiler->scratches)) || \
689 ((r) > (SLJIT_S0 - compiler->saveds) && (r) <= SLJIT_S0))
693 ((r) >= SLJIT_R0 && (r) < (SLJIT_R0 + compiler->scratches)) || \
694 ((r) > (SLJIT_S0 - compiler->saveds) && (r) <= SLJIT_S0))
704 CHECK_ARGUMENT(compiler->scratches != -1 && compiler->saveds != -1); \
710 CHECK_ARGUMENT((i) >= 0 && (i) < compiler->logical_local_size); \
725 CHECK_ARGUMENT(compiler->scratches != -1 && compiler->saveds != -1); \
729 CHECK_ARGUMENT((i) >= 0 && (i) < compiler->logical_local_size); \
744 CHECK_ARGUMENT(compiler->fscratches != -1 && compiler->fsaveds != -1); \
745 if (((p) >= SLJIT_FR0 && (p) < (SLJIT_FR0 + compiler->fscratches)) || \
746 ((p) > (SLJIT_FS0 - compiler->fsaveds) && (p) <= SLJIT_FS0)) \
749 CHECK_ARGUMENT((i) >= 0 && (i) < compiler->logical_local_size); \
775 SLJIT_API_FUNC_ATTRIBUTE void sljit_compiler_verbose(struct sljit_compiler *compiler, FILE* verbose) in sljit_compiler_verbose() argument
777 compiler->verbose = verbose; in sljit_compiler_verbose()
790 #define sljit_verbose_reg(compiler, r) \ argument
792 if ((r) < (SLJIT_R0 + compiler->scratches)) \
793 fprintf(compiler->verbose, "r%d", (r) - SLJIT_R0); \
795 fprintf(compiler->verbose, "s%d", SLJIT_NUMBER_OF_REGISTERS - (r)); \
798 #define sljit_verbose_param(compiler, p, i) \ argument
800 fprintf(compiler->verbose, "#%" SLJIT_PRINT_D "d", (i)); \
803 fputc('[', compiler->verbose); \
804 sljit_verbose_reg(compiler, (p) & REG_MASK); \
806 fprintf(compiler->verbose, " + "); \
807 sljit_verbose_reg(compiler, OFFS_REG(p)); \
809 fprintf(compiler->verbose, " * %d", 1 << (i)); \
812 fprintf(compiler->verbose, " + %" SLJIT_PRINT_D "d", (i)); \
813 fputc(']', compiler->verbose); \
816 fprintf(compiler->verbose, "[#%" SLJIT_PRINT_D "d]", (i)); \
818 sljit_verbose_reg(compiler, p); \
820 fprintf(compiler->verbose, "unused");
822 #define sljit_verbose_fparam(compiler, p, i) \ argument
825 fputc('[', compiler->verbose); \
826 sljit_verbose_reg(compiler, (p) & REG_MASK); \
828 fprintf(compiler->verbose, " + "); \
829 sljit_verbose_reg(compiler, OFFS_REG(p)); \
831 fprintf(compiler->verbose, "%d", 1 << (i)); \
834 fprintf(compiler->verbose, "%" SLJIT_PRINT_D "d", (i)); \
835 fputc(']', compiler->verbose); \
838 fprintf(compiler->verbose, "[#%" SLJIT_PRINT_D "d]", (i)); \
841 if ((p) < (SLJIT_FR0 + compiler->fscratches)) \
842 fprintf(compiler->verbose, "fr%d", (p) - SLJIT_FR0); \
844 fprintf(compiler->verbose, "fs%d", SLJIT_NUMBER_OF_FLOAT_REGISTERS - (p)); \
905 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_generate_code(struct sljit_compiler *compiler) in check_sljit_generate_code() argument
911 SLJIT_UNUSED_ARG(compiler); in check_sljit_generate_code()
914 CHECK_ARGUMENT(compiler->size > 0); in check_sljit_generate_code()
915 jump = compiler->jumps; in check_sljit_generate_code()
925 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_enter(struct sljit_compiler *compiler, in check_sljit_emit_enter() argument
929 SLJIT_UNUSED_ARG(compiler); in check_sljit_emit_enter()
944 if (SLJIT_UNLIKELY(!!compiler->verbose)) in check_sljit_emit_enter()
945 …fprintf(compiler->verbose, " enter options:none args:%d scratches:%d saveds:%d fscratches:%d fsav… in check_sljit_emit_enter()
951 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_set_context(struct sljit_compiler *compiler, in check_sljit_set_context() argument
955 if (SLJIT_UNLIKELY(compiler->skip_checks)) { in check_sljit_set_context()
956 compiler->skip_checks = 0; in check_sljit_set_context()
973 if (SLJIT_UNLIKELY(!!compiler->verbose)) in check_sljit_set_context()
974 …fprintf(compiler->verbose, " set_context options:none args:%d scratches:%d saveds:%d fscratches:%… in check_sljit_set_context()
980 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_return(struct sljit_compiler *compiler, slji… in check_sljit_emit_return() argument
983 CHECK_ARGUMENT(compiler->scratches >= 0); in check_sljit_emit_return()
992 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_return()
994 fprintf(compiler->verbose, " return\n"); in check_sljit_emit_return()
996 fprintf(compiler->verbose, " return.%s ", op1_names[op - SLJIT_OP1_BASE]); in check_sljit_emit_return()
997 sljit_verbose_param(compiler, src, srcw); in check_sljit_emit_return()
998 fprintf(compiler->verbose, "\n"); in check_sljit_emit_return()
1005 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fast_enter(struct sljit_compiler *compiler, … in check_sljit_emit_fast_enter() argument
1011 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_fast_enter()
1012 fprintf(compiler->verbose, " fast_enter "); in check_sljit_emit_fast_enter()
1013 sljit_verbose_param(compiler, dst, dstw); in check_sljit_emit_fast_enter()
1014 fprintf(compiler->verbose, "\n"); in check_sljit_emit_fast_enter()
1020 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fast_return(struct sljit_compiler *compiler,… in check_sljit_emit_fast_return() argument
1026 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_fast_return()
1027 fprintf(compiler->verbose, " fast_return "); in check_sljit_emit_fast_return()
1028 sljit_verbose_param(compiler, src, srcw); in check_sljit_emit_fast_return()
1029 fprintf(compiler->verbose, "\n"); in check_sljit_emit_fast_return()
1035 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_op0(struct sljit_compiler *compiler, sljit_s… in check_sljit_emit_op0() argument
1040 CHECK_ARGUMENT(op < SLJIT_LUMUL || compiler->scratches >= 2); in check_sljit_emit_op0()
1043 if (SLJIT_UNLIKELY(!!compiler->verbose)) in check_sljit_emit_op0()
1044 …fprintf(compiler->verbose, " %s%s\n", !(op & SLJIT_INT_OP) ? "" : "i", op0_names[GET_OPCODE(op) -… in check_sljit_emit_op0()
1049 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_op1(struct sljit_compiler *compiler, sljit_s… in check_sljit_emit_op1() argument
1053 if (SLJIT_UNLIKELY(compiler->skip_checks)) { in check_sljit_emit_op1()
1054 compiler->skip_checks = 0; in check_sljit_emit_op1()
1066 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_op1()
1067 …fprintf(compiler->verbose, " %s%s%s%s%s%s%s%s ", !(op & SLJIT_INT_OP) ? "" : "i", op1_names[GET_O… in check_sljit_emit_op1()
1070 sljit_verbose_param(compiler, dst, dstw); in check_sljit_emit_op1()
1071 fprintf(compiler->verbose, ", "); in check_sljit_emit_op1()
1072 sljit_verbose_param(compiler, src, srcw); in check_sljit_emit_op1()
1073 fprintf(compiler->verbose, "\n"); in check_sljit_emit_op1()
1079 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_op2(struct sljit_compiler *compiler, sljit_s… in check_sljit_emit_op2() argument
1084 if (SLJIT_UNLIKELY(compiler->skip_checks)) { in check_sljit_emit_op2()
1085 compiler->skip_checks = 0; in check_sljit_emit_op2()
1097 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_op2()
1098 …fprintf(compiler->verbose, " %s%s%s%s%s%s%s%s ", !(op & SLJIT_INT_OP) ? "" : "i", op2_names[GET_O… in check_sljit_emit_op2()
1101 sljit_verbose_param(compiler, dst, dstw); in check_sljit_emit_op2()
1102 fprintf(compiler->verbose, ", "); in check_sljit_emit_op2()
1103 sljit_verbose_param(compiler, src1, src1w); in check_sljit_emit_op2()
1104 fprintf(compiler->verbose, ", "); in check_sljit_emit_op2()
1105 sljit_verbose_param(compiler, src2, src2w); in check_sljit_emit_op2()
1106 fprintf(compiler->verbose, "\n"); in check_sljit_emit_op2()
1130 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_op_custom(struct sljit_compiler *compiler, in check_sljit_emit_op_custom() argument
1137 SLJIT_UNUSED_ARG(compiler); in check_sljit_emit_op_custom()
1152 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_op_custom()
1153 fprintf(compiler->verbose, " op_custom"); in check_sljit_emit_op_custom()
1155 fprintf(compiler->verbose, " 0x%x", ((sljit_ub*)instruction)[i]); in check_sljit_emit_op_custom()
1156 fprintf(compiler->verbose, "\n"); in check_sljit_emit_op_custom()
1162 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fop1(struct sljit_compiler *compiler, sljit_… in check_sljit_emit_fop1() argument
1166 if (SLJIT_UNLIKELY(compiler->skip_checks)) { in check_sljit_emit_fop1()
1167 compiler->skip_checks = 0; in check_sljit_emit_fop1()
1179 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_fop1()
1181 fprintf(compiler->verbose, " %s%s ", fop1_names[SLJIT_CONVD_FROMS - SLJIT_FOP1_BASE], in check_sljit_emit_fop1()
1184 fprintf(compiler->verbose, " %s%s ", (op & SLJIT_SINGLE_OP) ? "s" : "d", in check_sljit_emit_fop1()
1187 sljit_verbose_fparam(compiler, dst, dstw); in check_sljit_emit_fop1()
1188 fprintf(compiler->verbose, ", "); in check_sljit_emit_fop1()
1189 sljit_verbose_fparam(compiler, src, srcw); in check_sljit_emit_fop1()
1190 fprintf(compiler->verbose, "\n"); in check_sljit_emit_fop1()
1196 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fop1_cmp(struct sljit_compiler *compiler, sl… in check_sljit_emit_fop1_cmp() argument
1200 if (SLJIT_UNLIKELY(compiler->skip_checks)) { in check_sljit_emit_fop1_cmp()
1201 compiler->skip_checks = 0; in check_sljit_emit_fop1_cmp()
1213 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_fop1_cmp()
1214 …fprintf(compiler->verbose, " %s%s%s%s ", (op & SLJIT_SINGLE_OP) ? "s" : "d", fop1_names[SLJIT_DCM… in check_sljit_emit_fop1_cmp()
1216 sljit_verbose_fparam(compiler, src1, src1w); in check_sljit_emit_fop1_cmp()
1217 fprintf(compiler->verbose, ", "); in check_sljit_emit_fop1_cmp()
1218 sljit_verbose_fparam(compiler, src2, src2w); in check_sljit_emit_fop1_cmp()
1219 fprintf(compiler->verbose, "\n"); in check_sljit_emit_fop1_cmp()
1225 …E CHECK_RETURN_TYPE check_sljit_emit_fop1_convw_fromd(struct sljit_compiler *compiler, sljit_si op, in check_sljit_emit_fop1_convw_fromd() argument
1229 if (SLJIT_UNLIKELY(compiler->skip_checks)) { in check_sljit_emit_fop1_convw_fromd()
1230 compiler->skip_checks = 0; in check_sljit_emit_fop1_convw_fromd()
1242 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_fop1_convw_fromd()
1243 fprintf(compiler->verbose, " %s%s.from%s ", fop1_names[GET_OPCODE(op) - SLJIT_FOP1_BASE], in check_sljit_emit_fop1_convw_fromd()
1246 sljit_verbose_param(compiler, dst, dstw); in check_sljit_emit_fop1_convw_fromd()
1247 fprintf(compiler->verbose, ", "); in check_sljit_emit_fop1_convw_fromd()
1248 sljit_verbose_fparam(compiler, src, srcw); in check_sljit_emit_fop1_convw_fromd()
1249 fprintf(compiler->verbose, "\n"); in check_sljit_emit_fop1_convw_fromd()
1255 …E CHECK_RETURN_TYPE check_sljit_emit_fop1_convd_fromw(struct sljit_compiler *compiler, sljit_si op, in check_sljit_emit_fop1_convd_fromw() argument
1259 if (SLJIT_UNLIKELY(compiler->skip_checks)) { in check_sljit_emit_fop1_convd_fromw()
1260 compiler->skip_checks = 0; in check_sljit_emit_fop1_convd_fromw()
1272 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_fop1_convd_fromw()
1273 fprintf(compiler->verbose, " %s%s.from%s ", fop1_names[GET_OPCODE(op) - SLJIT_FOP1_BASE], in check_sljit_emit_fop1_convd_fromw()
1276 sljit_verbose_fparam(compiler, dst, dstw); in check_sljit_emit_fop1_convd_fromw()
1277 fprintf(compiler->verbose, ", "); in check_sljit_emit_fop1_convd_fromw()
1278 sljit_verbose_param(compiler, src, srcw); in check_sljit_emit_fop1_convd_fromw()
1279 fprintf(compiler->verbose, "\n"); in check_sljit_emit_fop1_convd_fromw()
1285 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fop2(struct sljit_compiler *compiler, sljit_… in check_sljit_emit_fop2() argument
1299 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_fop2()
1300 …fprintf(compiler->verbose, " %s%s ", (op & SLJIT_SINGLE_OP) ? "s" : "d", fop2_names[GET_OPCODE(op… in check_sljit_emit_fop2()
1301 sljit_verbose_fparam(compiler, dst, dstw); in check_sljit_emit_fop2()
1302 fprintf(compiler->verbose, ", "); in check_sljit_emit_fop2()
1303 sljit_verbose_fparam(compiler, src1, src1w); in check_sljit_emit_fop2()
1304 fprintf(compiler->verbose, ", "); in check_sljit_emit_fop2()
1305 sljit_verbose_fparam(compiler, src2, src2w); in check_sljit_emit_fop2()
1306 fprintf(compiler->verbose, "\n"); in check_sljit_emit_fop2()
1312 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_label(struct sljit_compiler *compiler) in check_sljit_emit_label() argument
1314 SLJIT_UNUSED_ARG(compiler); in check_sljit_emit_label()
1317 if (SLJIT_UNLIKELY(!!compiler->verbose)) in check_sljit_emit_label()
1318 fprintf(compiler->verbose, "label:\n"); in check_sljit_emit_label()
1323 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_jump(struct sljit_compiler *compiler, sljit_… in check_sljit_emit_jump() argument
1325 if (SLJIT_UNLIKELY(compiler->skip_checks)) { in check_sljit_emit_jump()
1326 compiler->skip_checks = 0; in check_sljit_emit_jump()
1334 …CHECK_ARGUMENT((type & 0xff) <= SLJIT_CALL0 || ((type & 0xff) - SLJIT_CALL0) <= compiler->scratche… in check_sljit_emit_jump()
1337 if (SLJIT_UNLIKELY(!!compiler->verbose)) in check_sljit_emit_jump()
1338 fprintf(compiler->verbose, " jump%s.%s%s\n", !(type & SLJIT_REWRITABLE_JUMP) ? "" : ".r", in check_sljit_emit_jump()
1344 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_cmp(struct sljit_compiler *compiler, sljit_s… in check_sljit_emit_cmp() argument
1355 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_cmp()
1356 fprintf(compiler->verbose, " cmp%s.%s%s ", !(type & SLJIT_REWRITABLE_JUMP) ? "" : ".r", in check_sljit_emit_cmp()
1358 sljit_verbose_param(compiler, src1, src1w); in check_sljit_emit_cmp()
1359 fprintf(compiler->verbose, ", "); in check_sljit_emit_cmp()
1360 sljit_verbose_param(compiler, src2, src2w); in check_sljit_emit_cmp()
1361 fprintf(compiler->verbose, "\n"); in check_sljit_emit_cmp()
1367 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_fcmp(struct sljit_compiler *compiler, sljit_… in check_sljit_emit_fcmp() argument
1379 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_fcmp()
1380 fprintf(compiler->verbose, " fcmp%s.%s%s ", !(type & SLJIT_REWRITABLE_JUMP) ? "" : ".r", in check_sljit_emit_fcmp()
1382 sljit_verbose_fparam(compiler, src1, src1w); in check_sljit_emit_fcmp()
1383 fprintf(compiler->verbose, ", "); in check_sljit_emit_fcmp()
1384 sljit_verbose_fparam(compiler, src2, src2w); in check_sljit_emit_fcmp()
1385 fprintf(compiler->verbose, "\n"); in check_sljit_emit_fcmp()
1391 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_ijump(struct sljit_compiler *compiler, sljit… in check_sljit_emit_ijump() argument
1393 if (SLJIT_UNLIKELY(compiler->skip_checks)) { in check_sljit_emit_ijump()
1394 compiler->skip_checks = 0; in check_sljit_emit_ijump()
1400 CHECK_ARGUMENT(type <= SLJIT_CALL0 || (type - SLJIT_CALL0) <= compiler->scratches); in check_sljit_emit_ijump()
1404 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_ijump()
1405 fprintf(compiler->verbose, " ijump.%s ", jump_names[type]); in check_sljit_emit_ijump()
1406 sljit_verbose_param(compiler, src, srcw); in check_sljit_emit_ijump()
1407 fprintf(compiler->verbose, "\n"); in check_sljit_emit_ijump()
1413 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_op_flags(struct sljit_compiler *compiler, sl… in check_sljit_emit_op_flags() argument
1433 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_op_flags()
1434 fprintf(compiler->verbose, " flags.%s%s%s%s ", !(op & SLJIT_INT_OP) ? "" : "i", in check_sljit_emit_op_flags()
1437 sljit_verbose_param(compiler, dst, dstw); in check_sljit_emit_op_flags()
1439 fprintf(compiler->verbose, ", "); in check_sljit_emit_op_flags()
1440 sljit_verbose_param(compiler, src, srcw); in check_sljit_emit_op_flags()
1442 fprintf(compiler->verbose, ", %s%s\n", JUMP_PREFIX(type), jump_names[type & 0xff]); in check_sljit_emit_op_flags()
1448 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_get_local_base(struct sljit_compiler *compiler, s… in check_sljit_get_local_base() argument
1456 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_get_local_base()
1457 fprintf(compiler->verbose, " local_base "); in check_sljit_get_local_base()
1458 sljit_verbose_param(compiler, dst, dstw); in check_sljit_get_local_base()
1459 fprintf(compiler->verbose, ", #%" SLJIT_PRINT_D "d\n", offset); in check_sljit_get_local_base()
1465 static SLJIT_INLINE CHECK_RETURN_TYPE check_sljit_emit_const(struct sljit_compiler *compiler, sljit… in check_sljit_emit_const() argument
1473 if (SLJIT_UNLIKELY(!!compiler->verbose)) { in check_sljit_emit_const()
1474 fprintf(compiler->verbose, " const "); in check_sljit_emit_const()
1475 sljit_verbose_param(compiler, dst, dstw); in check_sljit_emit_const()
1476 fprintf(compiler->verbose, ", #%" SLJIT_PRINT_D "d\n", init_value); in check_sljit_emit_const()
1484 #define SELECT_FOP1_OPERATION_WITH_CHECKS(compiler, op, dst, dstw, src, srcw) \ argument
1489 CHECK(check_sljit_emit_fop1_cmp(compiler, op, dst, dstw, src, srcw)); \
1492 return sljit_emit_fop1_cmp(compiler, op, dst, dstw, src, srcw); \
1495 CHECK(check_sljit_emit_fop1_convw_fromd(compiler, op, dst, dstw, src, srcw)); \
1498 return sljit_emit_fop1_convw_fromd(compiler, op, dst, dstw, src, srcw); \
1500 CHECK(check_sljit_emit_fop1_convd_fromw(compiler, op, dst, dstw, src, srcw)); \
1503 return sljit_emit_fop1_convd_fromw(compiler, op, dst, dstw, src, srcw); \
1505 CHECK(check_sljit_emit_fop1(compiler, op, dst, dstw, src, srcw)); \
1509 static SLJIT_INLINE sljit_si emit_mov_before_return(struct sljit_compiler *compiler, sljit_si op, s… in emit_mov_before_return() argument
1526 compiler->skip_checks = 1; in emit_mov_before_return()
1528 return sljit_emit_op1(compiler, op, SLJIT_RETURN_REG, 0, src, srcw); in emit_mov_before_return()
1579 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_cmp(struct sljit_compiler *compiler, sljit_s… in sljit_emit_cmp() argument
1588 CHECK_PTR(check_sljit_emit_cmp(compiler, type, src1, src1w, src2, src2w)); in sljit_emit_cmp()
1600 return emit_cmp_to0(compiler, type, src1, src1w); in sljit_emit_cmp()
1650 compiler->skip_checks = 1; in sljit_emit_cmp()
1652 PTR_FAIL_IF(sljit_emit_op2(compiler, SLJIT_SUB | flags | (type & SLJIT_INT_OP), in sljit_emit_cmp()
1656 compiler->skip_checks = 1; in sljit_emit_cmp()
1658 return sljit_emit_jump(compiler, condition | (type & SLJIT_REWRITABLE_JUMP)); in sljit_emit_cmp()
1661 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_fcmp(struct sljit_compiler *compiler, sljit_… in sljit_emit_fcmp() argument
1668 CHECK_PTR(check_sljit_emit_fcmp(compiler, type, src1, src1w, src2, src2w)); in sljit_emit_fcmp()
1677 compiler->skip_checks = 1; in sljit_emit_fcmp()
1679 sljit_emit_fop1(compiler, SLJIT_DCMP | flags, src1, src1w, src2, src2w); in sljit_emit_fcmp()
1683 compiler->skip_checks = 1; in sljit_emit_fcmp()
1685 return sljit_emit_jump(compiler, condition | (type & SLJIT_REWRITABLE_JUMP)); in sljit_emit_fcmp()
1692 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_local_base(struct sljit_compiler *compiler, sljit_si ds… in sljit_get_local_base() argument
1695 CHECK(check_sljit_get_local_base(compiler, dst, dstw, offset)); in sljit_get_local_base()
1700 compiler->skip_checks = 1; in sljit_get_local_base()
1703 …return sljit_emit_op2(compiler, SLJIT_ADD | SLJIT_KEEP_FLAGS, dst, dstw, SLJIT_SP, 0, SLJIT_IMM, o… in sljit_get_local_base()
1704 return sljit_emit_op1(compiler, SLJIT_MOV, dst, dstw, SLJIT_SP, 0); in sljit_get_local_base()
1724 SLJIT_API_FUNC_ATTRIBUTE void sljit_free_compiler(struct sljit_compiler *compiler) in sljit_free_compiler() argument
1726 SLJIT_UNUSED_ARG(compiler); in sljit_free_compiler()
1730 SLJIT_API_FUNC_ATTRIBUTE void* sljit_alloc_memory(struct sljit_compiler *compiler, sljit_si size) in sljit_alloc_memory() argument
1732 SLJIT_UNUSED_ARG(compiler); in sljit_alloc_memory()
1739 SLJIT_API_FUNC_ATTRIBUTE void sljit_compiler_verbose(struct sljit_compiler *compiler, FILE* verbose) in sljit_compiler_verbose() argument
1741 SLJIT_UNUSED_ARG(compiler); in sljit_compiler_verbose()
1747 SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compiler) in sljit_generate_code() argument
1749 SLJIT_UNUSED_ARG(compiler); in sljit_generate_code()
1760 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_enter(struct sljit_compiler *compiler, in sljit_emit_enter() argument
1764 SLJIT_UNUSED_ARG(compiler); in sljit_emit_enter()
1776 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_set_context(struct sljit_compiler *compiler, in sljit_set_context() argument
1780 SLJIT_UNUSED_ARG(compiler); in sljit_set_context()
1792 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_return(struct sljit_compiler *compiler, sljit_si op, s… in sljit_emit_return() argument
1794 SLJIT_UNUSED_ARG(compiler); in sljit_emit_return()
1802 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_fast_enter(struct sljit_compiler *compiler, sljit_si d… in sljit_emit_fast_enter() argument
1804 SLJIT_UNUSED_ARG(compiler); in sljit_emit_fast_enter()
1811 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_fast_return(struct sljit_compiler *compiler, sljit_si … in sljit_emit_fast_return() argument
1813 SLJIT_UNUSED_ARG(compiler); in sljit_emit_fast_return()
1820 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op0(struct sljit_compiler *compiler, sljit_si op) in sljit_emit_op0() argument
1822 SLJIT_UNUSED_ARG(compiler); in sljit_emit_op0()
1828 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op1(struct sljit_compiler *compiler, sljit_si op, in sljit_emit_op1() argument
1832 SLJIT_UNUSED_ARG(compiler); in sljit_emit_op1()
1842 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op2(struct sljit_compiler *compiler, sljit_si op, in sljit_emit_op2() argument
1847 SLJIT_UNUSED_ARG(compiler); in sljit_emit_op2()
1865 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_custom(struct sljit_compiler *compiler, in sljit_emit_op_custom() argument
1868 SLJIT_UNUSED_ARG(compiler); in sljit_emit_op_custom()
1881 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_fop1(struct sljit_compiler *compiler, sljit_si op, in sljit_emit_fop1() argument
1885 SLJIT_UNUSED_ARG(compiler); in sljit_emit_fop1()
1895 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_fop2(struct sljit_compiler *compiler, sljit_si op, in sljit_emit_fop2() argument
1900 SLJIT_UNUSED_ARG(compiler); in sljit_emit_fop2()
1912 SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compiler *compiler) in sljit_emit_label() argument
1914 SLJIT_UNUSED_ARG(compiler); in sljit_emit_label()
1919 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compiler *compiler, sljit_… in sljit_emit_jump() argument
1921 SLJIT_UNUSED_ARG(compiler); in sljit_emit_jump()
1927 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_cmp(struct sljit_compiler *compiler, sljit_s… in sljit_emit_cmp() argument
1931 SLJIT_UNUSED_ARG(compiler); in sljit_emit_cmp()
1941 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_fcmp(struct sljit_compiler *compiler, sljit_… in sljit_emit_fcmp() argument
1945 SLJIT_UNUSED_ARG(compiler); in sljit_emit_fcmp()
1969 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_ijump(struct sljit_compiler *compiler, sljit_si type, … in sljit_emit_ijump() argument
1971 SLJIT_UNUSED_ARG(compiler); in sljit_emit_ijump()
1979 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_si op, in sljit_emit_op_flags() argument
1984 SLJIT_UNUSED_ARG(compiler); in sljit_emit_op_flags()
1995 SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_local_base(struct sljit_compiler *compiler, sljit_si ds… in sljit_get_local_base() argument
1997 SLJIT_UNUSED_ARG(compiler); in sljit_get_local_base()
2005 SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, slji… in sljit_emit_const() argument
2007 SLJIT_UNUSED_ARG(compiler); in sljit_emit_const()