Lines Matching refs:compiler

208 static sljit_s32 push_inst(struct sljit_compiler *compiler, sljit_ins ins, sljit_s32 delay_slot)  in push_inst()  argument
214 ptr = (sljit_ins*)ensure_buf(compiler, sizeof(sljit_ins)); in push_inst()
217 compiler->size++; in push_inst()
218 compiler->delay_slot = delay_slot; in push_inst()
297 SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compiler) in sljit_generate_code() argument
315 CHECK_PTR(check_sljit_generate_code(compiler)); in sljit_generate_code()
316 reverse_buf(compiler); in sljit_generate_code()
318 …code = (sljit_ins*)SLJIT_MALLOC_EXEC(compiler->size * sizeof(sljit_ins), compiler->exec_allocator_… in sljit_generate_code()
320 buf = compiler->buf; in sljit_generate_code()
327 label = compiler->labels; in sljit_generate_code()
328 jump = compiler->jumps; in sljit_generate_code()
329 const_ = compiler->consts; in sljit_generate_code()
330 put_label = compiler->put_labels; in sljit_generate_code()
388 SLJIT_ASSERT(code_ptr - code <= (sljit_s32)compiler->size); in sljit_generate_code()
390 jump = compiler->jumps; in sljit_generate_code()
421 put_label = compiler->put_labels; in sljit_generate_code()
436 compiler->error = SLJIT_ERR_COMPILED; in sljit_generate_code()
437 compiler->executable_offset = executable_offset; in sljit_generate_code()
438 compiler->executable_size = (sljit_uw)(code_ptr - code) * sizeof(sljit_ins); in sljit_generate_code()
511 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compiler, in sljit_emit_enter() argument
520 …CHECK(check_sljit_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds,… in sljit_emit_enter()
521 set_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); in sljit_emit_enter()
524 compiler->local_size = local_size; in sljit_emit_enter()
527 FAIL_IF(push_inst(compiler, SAVE | D(SLJIT_SP) | S1(SLJIT_SP) | IMM(-local_size), UNMOVABLE_INS)); in sljit_emit_enter()
530 FAIL_IF(load_immediate(compiler, TMP_REG1, -local_size)); in sljit_emit_enter()
531 FAIL_IF(push_inst(compiler, SAVE | D(SLJIT_SP) | S1(SLJIT_SP) | S2(TMP_REG1), UNMOVABLE_INS)); in sljit_emit_enter()
544 … FAIL_IF(push_inst(compiler, STW | DA(reg_index) | S1(SLJIT_SP) | IMM(float_offset), MOVABLE_INS)); in sljit_emit_enter()
547 …FAIL_IF(push_inst(compiler, STW | DA(reg_index + 1) | S1(SLJIT_SP) | IMM(float_offset + sizeof(slj… in sljit_emit_enter()
549 … FAIL_IF(push_inst(compiler, STD | DA(reg_index) | S1(SLJIT_SP) | IMM(float_offset), MOVABLE_INS)); in sljit_emit_enter()
555 … FAIL_IF(push_inst(compiler, STW | DA(reg_index) | S1(SLJIT_SP) | IMM(float_offset), MOVABLE_INS)); in sljit_emit_enter()
575 …FAIL_IF(push_inst(compiler, LDDF | FD(float_arg_index) | S1(SLJIT_SP) | IMM(float_offset), MOVABLE… in sljit_emit_enter()
577 …FAIL_IF(push_inst(compiler, LDF | FD(float_arg_index) | S1(SLJIT_SP) | IMM(float_offset), MOVABLE_… in sljit_emit_enter()
578 …FAIL_IF(push_inst(compiler, LDF | FD(float_arg_index) | (1 << 25) | S1A(30) | IMM(args_offset), MO… in sljit_emit_enter()
580 … FAIL_IF(push_inst(compiler, LDF | FD(float_arg_index) | S1A(30) | IMM(args_offset), MOVABLE_INS)); in sljit_emit_enter()
581 …FAIL_IF(push_inst(compiler, LDF | FD(float_arg_index) | (1 << 25) | S1A(30) | IMM(args_offset + si… in sljit_emit_enter()
590 …FAIL_IF(push_inst(compiler, LDF | FD(float_arg_index) | S1(SLJIT_SP) | IMM(float_offset), MOVABLE_… in sljit_emit_enter()
592 … FAIL_IF(push_inst(compiler, LDF | FD(float_arg_index) | S1A(30) | IMM(args_offset), MOVABLE_INS)); in sljit_emit_enter()
607 FAIL_IF(push_inst(compiler, OR | DA(tmp) | S1(0) | S2A(reg_index), tmp)); in sljit_emit_enter()
609 FAIL_IF(push_inst(compiler, LDUW | DA(tmp) | S1A(30) | IMM(args_offset), tmp)); in sljit_emit_enter()
620 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *compiler, in sljit_set_context() argument
625 …CHECK(check_sljit_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds… in sljit_set_context()
626 set_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); in sljit_set_context()
628 compiler->local_size = (local_size + SLJIT_LOCALS_OFFSET + 7) & ~0x7; in sljit_set_context()
632 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return_void(struct sljit_compiler *compiler) in sljit_emit_return_void() argument
635 CHECK(check_sljit_emit_return_void(compiler)); in sljit_emit_return_void()
637 FAIL_IF(push_inst(compiler, JMPL | D(0) | S1A(31) | IMM(8), UNMOVABLE_INS)); in sljit_emit_return_void()
638 return push_inst(compiler, RESTORE | D(SLJIT_R0) | S1(SLJIT_R0) | S2(0), UNMOVABLE_INS); in sljit_emit_return_void()
641 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *compiler, sljit_s32 op,… in sljit_emit_return() argument
644 CHECK(check_sljit_emit_return(compiler, op, src, srcw)); in sljit_emit_return()
647 FAIL_IF(emit_mov_before_return(compiler, op, src, srcw)); in sljit_emit_return()
651 FAIL_IF(push_inst(compiler, JMPL | D(0) | S1A(31) | IMM(8), UNMOVABLE_INS)); in sljit_emit_return()
652 return push_inst(compiler, RESTORE | D(SLJIT_R0) | S1(src) | S2(0), UNMOVABLE_INS); in sljit_emit_return()
693 static sljit_s32 getput_arg_fast(struct sljit_compiler *compiler, sljit_u32 flags, sljit_s32 reg, s… in getput_arg_fast() argument
702 FAIL_IF(push_inst(compiler, data_transfer_insts[flags & MEM_MASK] in getput_arg_fast()
734 static sljit_s32 getput_arg(struct sljit_compiler *compiler, sljit_u32 flags, sljit_s32 reg, sljit_… in getput_arg() argument
750 …if (((SLJIT_MEM | (arg & OFFS_REG_MASK)) == compiler->cache_arg) && (argw == compiler->cache_argw)) in getput_arg()
754 compiler->cache_arg = SLJIT_MEM | (arg & OFFS_REG_MASK); in getput_arg()
755 compiler->cache_argw = argw; in getput_arg()
762 …FAIL_IF(push_inst(compiler, SLL_W | D(arg2) | S1(OFFS_REG(arg)) | IMM_ARG | (sljit_ins)argw, DR(ar… in getput_arg()
767 …if ((compiler->cache_arg == SLJIT_MEM) && (argw - compiler->cache_argw) <= SIMM_MAX && (argw - com… in getput_arg()
768 if (argw != compiler->cache_argw) { in getput_arg()
769 …FAIL_IF(push_inst(compiler, ADD | D(TMP_REG3) | S1(TMP_REG3) | IMM(argw - compiler->cache_argw), D… in getput_arg()
770 compiler->cache_argw = argw; in getput_arg()
775 compiler->cache_arg = SLJIT_MEM; in getput_arg()
776 compiler->cache_argw = argw; in getput_arg()
783 FAIL_IF(load_immediate(compiler, arg2, argw)); in getput_arg()
790 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | dest | S1(arg2) | IMM(0), delay… in getput_arg()
791 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | dest | S1(base) | S2(arg2), del… in getput_arg()
794 static SLJIT_INLINE sljit_s32 emit_op_mem(struct sljit_compiler *compiler, sljit_u32 flags, sljit_s… in emit_op_mem() argument
796 if (getput_arg_fast(compiler, flags, reg, arg, argw)) in emit_op_mem()
797 return compiler->error; in emit_op_mem()
798 compiler->cache_arg = 0; in emit_op_mem()
799 compiler->cache_argw = 0; in emit_op_mem()
800 return getput_arg(compiler, flags, reg, arg, argw, 0, 0); in emit_op_mem()
803 static SLJIT_INLINE sljit_s32 emit_op_mem2(struct sljit_compiler *compiler, sljit_u32 flags, sljit_… in emit_op_mem2() argument
805 if (getput_arg_fast(compiler, flags, reg, arg1, arg1w)) in emit_op_mem2()
806 return compiler->error; in emit_op_mem2()
807 return getput_arg(compiler, flags, reg, arg1, arg1w, arg2, arg2w); in emit_op_mem2()
810 static sljit_s32 emit_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_u32 flags, in emit_op() argument
825 compiler->cache_arg = 0; in emit_op()
826 compiler->cache_argw = 0; in emit_op()
836 else if ((dst & SLJIT_MEM) && !getput_arg_fast(compiler, flags | ARG_TEST, TMP_REG1, dst, dstw)) in emit_op()
866 FAIL_IF(load_immediate(compiler, TMP_REG1, src1w)); in emit_op()
873 if (getput_arg_fast(compiler, flags | LOAD_DATA, TMP_REG1, src1, src1w)) in emit_op()
874 FAIL_IF(compiler->error); in emit_op()
890 FAIL_IF(load_immediate(compiler, sugg_src2_r, src2w)); in emit_op()
905 if (getput_arg_fast(compiler, flags | LOAD_DATA, sugg_src2_r, src2, src2w)) in emit_op()
906 FAIL_IF(compiler->error); in emit_op()
915 FAIL_IF(getput_arg(compiler, flags | LOAD_DATA, TMP_REG2, src2, src2w, src1, src1w)); in emit_op()
916 FAIL_IF(getput_arg(compiler, flags | LOAD_DATA, TMP_REG1, src1, src1w, dst, dstw)); in emit_op()
919 FAIL_IF(getput_arg(compiler, flags | LOAD_DATA, TMP_REG1, src1, src1w, src2, src2w)); in emit_op()
920 FAIL_IF(getput_arg(compiler, flags | LOAD_DATA, TMP_REG2, src2, src2w, dst, dstw)); in emit_op()
924 FAIL_IF(getput_arg(compiler, flags | LOAD_DATA, TMP_REG1, src1, src1w, dst, dstw)); in emit_op()
926 FAIL_IF(getput_arg(compiler, flags | LOAD_DATA, sugg_src2_r, src2, src2w, dst, dstw)); in emit_op()
928 FAIL_IF(emit_single_op(compiler, op, flags, dst_r, src1_r, src2_r)); in emit_op()
932 getput_arg_fast(compiler, flags, dst_r, dst, dstw); in emit_op()
933 return compiler->error; in emit_op()
935 return getput_arg(compiler, flags, dst_r, dst, dstw, 0, 0); in emit_op()
941 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compiler, sljit_s32 op) in sljit_emit_op0() argument
944 CHECK(check_sljit_emit_op0(compiler, op)); in sljit_emit_op0()
949 return push_inst(compiler, TA, UNMOVABLE_INS); in sljit_emit_op0()
951 return push_inst(compiler, NOP, UNMOVABLE_INS); in sljit_emit_op0()
955 …FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? UMUL : SMUL) | D(SLJIT_R0) | S1(SLJIT_R0) | S2(… in sljit_emit_op0()
956 return push_inst(compiler, RDY | D(SLJIT_R1), DR(SLJIT_R1)); in sljit_emit_op0()
967 FAIL_IF(push_inst(compiler, WRY | S1(0), MOVABLE_INS)); in sljit_emit_op0()
969 FAIL_IF(push_inst(compiler, SRA | D(TMP_REG1) | S1(SLJIT_R0) | IMM(31), DR(TMP_REG1))); in sljit_emit_op0()
970 FAIL_IF(push_inst(compiler, WRY | S1(TMP_REG1), MOVABLE_INS)); in sljit_emit_op0()
973 FAIL_IF(push_inst(compiler, OR | D(TMP_REG2) | S1(0) | S2(SLJIT_R0), DR(TMP_REG2))); in sljit_emit_op0()
974 …FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? UDIV : SDIV) | D(SLJIT_R0) | S1(SLJIT_R0… in sljit_emit_op0()
977 FAIL_IF(push_inst(compiler, SMUL | D(SLJIT_R1) | S1(SLJIT_R0) | S2(SLJIT_R1), DR(SLJIT_R1))); in sljit_emit_op0()
978 return push_inst(compiler, SUB | D(SLJIT_R1) | S1(TMP_REG2) | S2(SLJIT_R1), DR(SLJIT_R1)); in sljit_emit_op0()
990 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op1() argument
997 CHECK(check_sljit_emit_op1(compiler, op, dst, dstw, src, srcw)); in sljit_emit_op1()
1010 …return emit_op(compiler, SLJIT_MOV, flags | WORD_DATA | MOVE_OP, dst, dstw, TMP_REG1, 0, src, srcw… in sljit_emit_op1()
1013 …return emit_op(compiler, SLJIT_MOV_U8, flags | BYTE_DATA | MOVE_OP, dst, dstw, TMP_REG1, 0, src, (… in sljit_emit_op1()
1016 …return emit_op(compiler, SLJIT_MOV_S8, flags | BYTE_DATA | SIGNED_DATA | MOVE_OP, dst, dstw, TMP_R… in sljit_emit_op1()
1019 …return emit_op(compiler, SLJIT_MOV_U16, flags | HALF_DATA | MOVE_OP, dst, dstw, TMP_REG1, 0, src, … in sljit_emit_op1()
1022 …return emit_op(compiler, SLJIT_MOV_S16, flags | HALF_DATA | SIGNED_DATA | MOVE_OP, dst, dstw, TMP_… in sljit_emit_op1()
1026 return emit_op(compiler, op, flags, dst, dstw, TMP_REG1, 0, src, srcw); in sljit_emit_op1()
1032 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op2() argument
1040 CHECK(check_sljit_emit_op2(compiler, op, 0, dst, dstw, src1, src1w, src2, src2w)); in sljit_emit_op2()
1053 return emit_op(compiler, op, flags | CUMULATIVE_OP | IMM_OP, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
1057 return emit_op(compiler, op, flags | IMM_OP, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
1068 return emit_op(compiler, op, flags | IMM_OP, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
1074 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2u(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op2u() argument
1079 CHECK(check_sljit_emit_op2(compiler, op, 1, 0, 0, src1, src1w, src2, src2w)); in sljit_emit_op2u()
1083 compiler->skip_checks = 1; in sljit_emit_op2u()
1085 return sljit_emit_op2(compiler, op, TMP_REG2, 0, src1, src1w, src2, src2w); in sljit_emit_op2u()
1088 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_src(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op_src() argument
1092 CHECK(check_sljit_emit_op_src(compiler, op, src, srcw)); in sljit_emit_op_src()
1098 FAIL_IF(push_inst(compiler, OR | D(TMP_LINK) | S1(0) | S2(src), DR(TMP_LINK))); in sljit_emit_op_src()
1100 FAIL_IF(emit_op_mem(compiler, WORD_DATA | LOAD_DATA, TMP_LINK, src, srcw)); in sljit_emit_op_src()
1102 FAIL_IF(push_inst(compiler, JMPL | D(0) | S1(TMP_LINK) | IMM(8), UNMOVABLE_INS)); in sljit_emit_op_src()
1103 return push_inst(compiler, NOP, UNMOVABLE_INS); in sljit_emit_op_src()
1127 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_custom(struct sljit_compiler *compiler, in sljit_emit_op_custom() argument
1131 CHECK(check_sljit_emit_op_custom(compiler, instruction, size)); in sljit_emit_op_custom()
1133 return push_inst(compiler, *(sljit_ins*)instruction, UNMOVABLE_INS); in sljit_emit_op_custom()
1144 static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_sw_from_f64(struct sljit_compiler *compiler, slj… in sljit_emit_fop1_conv_sw_from_f64() argument
1149 FAIL_IF(emit_op_mem2(compiler, FLOAT_DATA(op) | LOAD_DATA, TMP_FREG1, src, srcw, dst, dstw)); in sljit_emit_fop1_conv_sw_from_f64()
1153 FAIL_IF(push_inst(compiler, SELECT_FOP(op, FSTOI, FDTOI) | FD(TMP_FREG1) | FS2(src), MOVABLE_INS)); in sljit_emit_fop1_conv_sw_from_f64()
1156 …FAIL_IF(emit_op_mem2(compiler, SINGLE_DATA, TMP_FREG1, SLJIT_MEM1(SLJIT_SP), FLOAT_TMP_MEM_OFFSET,… in sljit_emit_fop1_conv_sw_from_f64()
1157 …return emit_op_mem2(compiler, WORD_DATA | LOAD_DATA, dst, SLJIT_MEM1(SLJIT_SP), FLOAT_TMP_MEM_OFFS… in sljit_emit_fop1_conv_sw_from_f64()
1161 return emit_op_mem2(compiler, SINGLE_DATA, TMP_FREG1, dst, dstw, 0, 0); in sljit_emit_fop1_conv_sw_from_f64()
1164 static SLJIT_INLINE sljit_s32 sljit_emit_fop1_conv_f64_from_sw(struct sljit_compiler *compiler, slj… in sljit_emit_fop1_conv_f64_from_sw() argument
1175 FAIL_IF(load_immediate(compiler, TMP_REG1, srcw)); in sljit_emit_fop1_conv_f64_from_sw()
1181 …FAIL_IF(emit_op_mem2(compiler, WORD_DATA, src, SLJIT_MEM1(SLJIT_SP), FLOAT_TMP_MEM_OFFSET, SLJIT_M… in sljit_emit_fop1_conv_f64_from_sw()
1186 FAIL_IF(emit_op_mem2(compiler, SINGLE_DATA | LOAD_DATA, TMP_FREG1, src, srcw, dst, dstw)); in sljit_emit_fop1_conv_f64_from_sw()
1187 …FAIL_IF(push_inst(compiler, SELECT_FOP(op, FITOS, FITOD) | FD(dst_r) | FS2(TMP_FREG1), MOVABLE_INS… in sljit_emit_fop1_conv_f64_from_sw()
1190 return emit_op_mem2(compiler, FLOAT_DATA(op), TMP_FREG1, dst, dstw, 0, 0); in sljit_emit_fop1_conv_f64_from_sw()
1194 static SLJIT_INLINE sljit_s32 sljit_emit_fop1_cmp(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop1_cmp() argument
1199 FAIL_IF(emit_op_mem2(compiler, FLOAT_DATA(op) | LOAD_DATA, TMP_FREG1, src1, src1w, src2, src2w)); in sljit_emit_fop1_cmp()
1204 FAIL_IF(emit_op_mem2(compiler, FLOAT_DATA(op) | LOAD_DATA, TMP_FREG2, src2, src2w, 0, 0)); in sljit_emit_fop1_cmp()
1208 …return push_inst(compiler, SELECT_FOP(op, FCMPS, FCMPD) | FS1(src1) | FS2(src2), FCC_IS_SET | MOVA… in sljit_emit_fop1_cmp()
1211 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop1() argument
1218 compiler->cache_arg = 0; in sljit_emit_fop1()
1219 compiler->cache_argw = 0; in sljit_emit_fop1()
1222 SELECT_FOP1_OPERATION_WITH_CHECKS(compiler, op, dst, dstw, src, srcw); in sljit_emit_fop1()
1230 FAIL_IF(emit_op_mem2(compiler, FLOAT_DATA(op) | LOAD_DATA, dst_r, src, srcw, dst, dstw)); in sljit_emit_fop1()
1238 FAIL_IF(push_inst(compiler, FMOVS | FD(dst_r) | FS2(src), MOVABLE_INS)); in sljit_emit_fop1()
1240 FAIL_IF(push_inst(compiler, FMOVS | FDN(dst_r) | FS2N(src), MOVABLE_INS)); in sljit_emit_fop1()
1247 FAIL_IF(push_inst(compiler, FNEGS | FD(dst_r) | FS2(src), MOVABLE_INS)); in sljit_emit_fop1()
1249 FAIL_IF(push_inst(compiler, FMOVS | FDN(dst_r) | FS2N(src), MOVABLE_INS)); in sljit_emit_fop1()
1252 FAIL_IF(push_inst(compiler, FABSS | FD(dst_r) | FS2(src), MOVABLE_INS)); in sljit_emit_fop1()
1254 FAIL_IF(push_inst(compiler, FMOVS | FDN(dst_r) | FS2N(src), MOVABLE_INS)); in sljit_emit_fop1()
1257 FAIL_IF(push_inst(compiler, SELECT_FOP(op, FSTOD, FDTOS) | FD(dst_r) | FS2(src), MOVABLE_INS)); in sljit_emit_fop1()
1263 FAIL_IF(emit_op_mem2(compiler, FLOAT_DATA(op), dst_r, dst, dstw, 0, 0)); in sljit_emit_fop1()
1267 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop2(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop2() argument
1275 CHECK(check_sljit_emit_fop2(compiler, op, dst, dstw, src1, src1w, src2, src2w)); in sljit_emit_fop2()
1280 compiler->cache_arg = 0; in sljit_emit_fop2()
1281 compiler->cache_argw = 0; in sljit_emit_fop2()
1286 if (getput_arg_fast(compiler, FLOAT_DATA(op) | LOAD_DATA, TMP_FREG1, src1, src1w)) { in sljit_emit_fop2()
1287 FAIL_IF(compiler->error); in sljit_emit_fop2()
1294 if (getput_arg_fast(compiler, FLOAT_DATA(op) | LOAD_DATA, TMP_FREG2, src2, src2w)) { in sljit_emit_fop2()
1295 FAIL_IF(compiler->error); in sljit_emit_fop2()
1303 FAIL_IF(getput_arg(compiler, FLOAT_DATA(op) | LOAD_DATA, TMP_FREG2, src2, src2w, src1, src1w)); in sljit_emit_fop2()
1304 FAIL_IF(getput_arg(compiler, FLOAT_DATA(op) | LOAD_DATA, TMP_FREG1, src1, src1w, dst, dstw)); in sljit_emit_fop2()
1307 FAIL_IF(getput_arg(compiler, FLOAT_DATA(op) | LOAD_DATA, TMP_FREG1, src1, src1w, src2, src2w)); in sljit_emit_fop2()
1308 FAIL_IF(getput_arg(compiler, FLOAT_DATA(op) | LOAD_DATA, TMP_FREG2, src2, src2w, dst, dstw)); in sljit_emit_fop2()
1312 FAIL_IF(getput_arg(compiler, FLOAT_DATA(op) | LOAD_DATA, TMP_FREG1, src1, src1w, dst, dstw)); in sljit_emit_fop2()
1314 FAIL_IF(getput_arg(compiler, FLOAT_DATA(op) | LOAD_DATA, TMP_FREG2, src2, src2w, dst, dstw)); in sljit_emit_fop2()
1323 …FAIL_IF(push_inst(compiler, SELECT_FOP(op, FADDS, FADDD) | FD(dst_r) | FS1(src1) | FS2(src2), MOVA… in sljit_emit_fop2()
1327 …FAIL_IF(push_inst(compiler, SELECT_FOP(op, FSUBS, FSUBD) | FD(dst_r) | FS1(src1) | FS2(src2), MOVA… in sljit_emit_fop2()
1331 …FAIL_IF(push_inst(compiler, SELECT_FOP(op, FMULS, FMULD) | FD(dst_r) | FS1(src1) | FS2(src2), MOVA… in sljit_emit_fop2()
1335 …FAIL_IF(push_inst(compiler, SELECT_FOP(op, FDIVS, FDIVD) | FD(dst_r) | FS1(src1) | FS2(src2), MOVA… in sljit_emit_fop2()
1340 FAIL_IF(emit_op_mem2(compiler, FLOAT_DATA(op), TMP_FREG2, dst, dstw, 0, 0)); in sljit_emit_fop2()
1352 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_enter(struct sljit_compiler *compiler, sljit_s32… in sljit_emit_fast_enter() argument
1355 CHECK(check_sljit_emit_fast_enter(compiler, dst, dstw)); in sljit_emit_fast_enter()
1359 return push_inst(compiler, OR | D(dst) | S1(0) | S2(TMP_LINK), UNMOVABLE_INS); in sljit_emit_fast_enter()
1362 FAIL_IF(emit_op_mem(compiler, WORD_DATA, TMP_LINK, dst, dstw)); in sljit_emit_fast_enter()
1363 compiler->delay_slot = UNMOVABLE_INS; in sljit_emit_fast_enter()
1371 SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compiler *compiler) in sljit_emit_label() argument
1376 CHECK_PTR(check_sljit_emit_label(compiler)); in sljit_emit_label()
1378 if (compiler->last_label && compiler->last_label->size == compiler->size) in sljit_emit_label()
1379 return compiler->last_label; in sljit_emit_label()
1381 label = (struct sljit_label*)ensure_abuf(compiler, sizeof(struct sljit_label)); in sljit_emit_label()
1383 set_label(label, compiler); in sljit_emit_label()
1384 compiler->delay_slot = UNMOVABLE_INS; in sljit_emit_label()
1388 static sljit_ins get_cc(struct sljit_compiler *compiler, sljit_s32 type) in get_cc() argument
1430 if (!(compiler->status_flags_state & (SLJIT_CURRENT_FLAGS_ADD | SLJIT_CURRENT_FLAGS_SUB))) in get_cc()
1438 if (!(compiler->status_flags_state & (SLJIT_CURRENT_FLAGS_ADD | SLJIT_CURRENT_FLAGS_SUB))) in get_cc()
1451 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compiler *compiler, sljit_… in sljit_emit_jump() argument
1456 CHECK_PTR(check_sljit_emit_jump(compiler, type)); in sljit_emit_jump()
1458 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_jump()
1460 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_jump()
1465 …if (((compiler->delay_slot & DST_INS_MASK) != UNMOVABLE_INS) && !(compiler->delay_slot & ICC_IS_SE… in sljit_emit_jump()
1468 PTR_FAIL_IF(push_inst(compiler, BICC | get_cc(compiler, type ^ 1) | 5, UNMOVABLE_INS)); in sljit_emit_jump()
1475 …if (((compiler->delay_slot & DST_INS_MASK) != UNMOVABLE_INS) && !(compiler->delay_slot & FCC_IS_SE… in sljit_emit_jump()
1478 PTR_FAIL_IF(push_inst(compiler, FBFCC | get_cc(compiler, type ^ 1) | 5, UNMOVABLE_INS)); in sljit_emit_jump()
1484 if ((compiler->delay_slot & DST_INS_MASK) != UNMOVABLE_INS) in sljit_emit_jump()
1490 PTR_FAIL_IF(emit_const(compiler, TMP_REG1, 0)); in sljit_emit_jump()
1491 …PTR_FAIL_IF(push_inst(compiler, JMPL | D(type >= SLJIT_FAST_CALL ? TMP_LINK : 0) | S1(TMP_REG1) | … in sljit_emit_jump()
1492 jump->addr = compiler->size; in sljit_emit_jump()
1493 PTR_FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); in sljit_emit_jump()
1498 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_call(struct sljit_compiler *compiler, sljit_… in sljit_emit_call() argument
1502 CHECK_PTR(check_sljit_emit_call(compiler, type, arg_types)); in sljit_emit_call()
1504 PTR_FAIL_IF(call_with_args(compiler, arg_types, NULL)); in sljit_emit_call()
1508 compiler->skip_checks = 1; in sljit_emit_call()
1511 return sljit_emit_jump(compiler, type); in sljit_emit_call()
1514 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compiler, sljit_s32 type… in sljit_emit_ijump() argument
1520 CHECK(check_sljit_emit_ijump(compiler, type, src, srcw)); in sljit_emit_ijump()
1526 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_ijump()
1528 set_jump(jump, compiler, JUMP_ADDR); in sljit_emit_ijump()
1531 if ((compiler->delay_slot & DST_INS_MASK) != UNMOVABLE_INS) in sljit_emit_ijump()
1536 FAIL_IF(emit_const(compiler, TMP_REG1, 0)); in sljit_emit_ijump()
1540 FAIL_IF(emit_op_mem(compiler, WORD_DATA | LOAD_DATA, TMP_REG1, src, srcw)); in sljit_emit_ijump()
1544 …FAIL_IF(push_inst(compiler, JMPL | D(type >= SLJIT_FAST_CALL ? TMP_LINK : 0) | S1(src_r) | IMM(0),… in sljit_emit_ijump()
1546 jump->addr = compiler->size; in sljit_emit_ijump()
1547 return push_inst(compiler, NOP, UNMOVABLE_INS); in sljit_emit_ijump()
1550 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_icall(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_icall() argument
1555 CHECK(check_sljit_emit_icall(compiler, type, arg_types, src, srcw)); in sljit_emit_icall()
1559 FAIL_IF(emit_op_mem(compiler, WORD_DATA | LOAD_DATA, TMP_REG1, src, srcw)); in sljit_emit_icall()
1563 FAIL_IF(call_with_args(compiler, arg_types, &src)); in sljit_emit_icall()
1567 compiler->skip_checks = 1; in sljit_emit_icall()
1570 return sljit_emit_ijump(compiler, type, src, srcw); in sljit_emit_icall()
1573 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_s32 o… in sljit_emit_op_flags() argument
1581 CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, type)); in sljit_emit_op_flags()
1588 compiler->cache_arg = 0; in sljit_emit_op_flags()
1589 compiler->cache_argw = 0; in sljit_emit_op_flags()
1592 FAIL_IF(emit_op_mem2(compiler, WORD_DATA | LOAD_DATA, TMP_REG1, dst, dstw, dst, dstw)); in sljit_emit_op_flags()
1596 FAIL_IF(push_inst(compiler, BICC | get_cc(compiler, type) | 3, UNMOVABLE_INS)); in sljit_emit_op_flags()
1598 FAIL_IF(push_inst(compiler, FBFCC | get_cc(compiler, type) | 3, UNMOVABLE_INS)); in sljit_emit_op_flags()
1600 FAIL_IF(push_inst(compiler, OR | D(reg) | S1(0) | IMM(1), UNMOVABLE_INS)); in sljit_emit_op_flags()
1601 FAIL_IF(push_inst(compiler, OR | D(reg) | S1(0) | IMM(0), UNMOVABLE_INS)); in sljit_emit_op_flags()
1606 return emit_op(compiler, op, flags, dst, dstw, TMP_REG1, 0, TMP_REG2, 0); in sljit_emit_op_flags()
1607 return emit_op(compiler, op, flags, dst, 0, dst, 0, TMP_REG2, 0); in sljit_emit_op_flags()
1613 return emit_op_mem(compiler, WORD_DATA, TMP_REG2, dst, dstw); in sljit_emit_op_flags()
1619 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_cmov() argument
1624 CHECK(check_sljit_emit_cmov(compiler, type, dst_reg, src, srcw)); in sljit_emit_cmov()
1627 return sljit_emit_cmov_generic(compiler, type, dst_reg, src, srcw);; in sljit_emit_cmov()
1633 SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, slji… in sljit_emit_const() argument
1639 CHECK_PTR(check_sljit_emit_const(compiler, dst, dstw, init_value)); in sljit_emit_const()
1642 const_ = (struct sljit_const*)ensure_abuf(compiler, sizeof(struct sljit_const)); in sljit_emit_const()
1644 set_const(const_, compiler); in sljit_emit_const()
1647 PTR_FAIL_IF(emit_const(compiler, dst_r, init_value)); in sljit_emit_const()
1650 PTR_FAIL_IF(emit_op_mem(compiler, WORD_DATA, TMP_REG2, dst, dstw)); in sljit_emit_const()
1654 …UTE struct sljit_put_label* sljit_emit_put_label(struct sljit_compiler *compiler, sljit_s32 dst, s… in sljit_emit_put_label() argument
1660 CHECK_PTR(check_sljit_emit_put_label(compiler, dst, dstw)); in sljit_emit_put_label()
1663 put_label = (struct sljit_put_label*)ensure_abuf(compiler, sizeof(struct sljit_put_label)); in sljit_emit_put_label()
1665 set_put_label(put_label, compiler, 0); in sljit_emit_put_label()
1668 PTR_FAIL_IF(emit_const(compiler, dst_r, 0)); in sljit_emit_put_label()
1671 PTR_FAIL_IF(emit_op_mem(compiler, WORD_DATA, TMP_REG2, dst, dstw)); in sljit_emit_put_label()