Lines Matching refs:compiler

275 static sljit_s32 push_inst(struct sljit_compiler *compiler, sljit_ins ins)  in push_inst()  argument
277 sljit_ins *ptr = (sljit_ins*)ensure_buf(compiler, sizeof(sljit_ins)); in push_inst()
280 compiler->size++; in push_inst()
404 SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compiler) in sljit_generate_code() argument
422 CHECK_PTR(check_sljit_generate_code(compiler)); in sljit_generate_code()
423 reverse_buf(compiler); in sljit_generate_code()
427compiler->size += (compiler->size & 0x1) + (sizeof(struct sljit_function_context) / sizeof(sljit_i… in sljit_generate_code()
429 compiler->size += (sizeof(struct sljit_function_context) / sizeof(sljit_ins)); in sljit_generate_code()
432 …code = (sljit_ins*)SLJIT_MALLOC_EXEC(compiler->size * sizeof(sljit_ins), compiler->exec_allocator_… in sljit_generate_code()
434 buf = compiler->buf; in sljit_generate_code()
441 label = compiler->labels; in sljit_generate_code()
442 jump = compiler->jumps; in sljit_generate_code()
443 const_ = compiler->consts; in sljit_generate_code()
444 put_label = compiler->put_labels; in sljit_generate_code()
539 …SLJIT_ASSERT(code_ptr - code <= (sljit_sw)(compiler->size - (sizeof(struct sljit_function_context)… in sljit_generate_code()
541 SLJIT_ASSERT(code_ptr - code <= (sljit_sw)compiler->size); in sljit_generate_code()
544 jump = compiler->jumps; in sljit_generate_code()
609 put_label = compiler->put_labels; in sljit_generate_code()
624 compiler->error = SLJIT_ERR_COMPILED; in sljit_generate_code()
625 compiler->executable_offset = executable_offset; in sljit_generate_code()
626 compiler->executable_size = (sljit_uw)(code_ptr - code) * sizeof(sljit_ins); in sljit_generate_code()
747 static sljit_s32 emit_op_mem(struct sljit_compiler *compiler, sljit_s32 inp_flags, sljit_s32 reg,
750 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compiler, in sljit_emit_enter() argument
762 …CHECK(check_sljit_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds,… in sljit_emit_enter()
763 set_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); in sljit_emit_enter()
772 compiler->local_size = local_size; in sljit_emit_enter()
774 FAIL_IF(push_inst(compiler, MFLR | D(0))); in sljit_emit_enter()
781 FAIL_IF(push_inst(compiler, STWU | S(SLJIT_SP) | A(SLJIT_SP) | IMM(-local_size))); in sljit_emit_enter()
783 FAIL_IF(push_inst(compiler, STDU | S(SLJIT_SP) | A(SLJIT_SP) | IMM(-local_size))); in sljit_emit_enter()
787 FAIL_IF(push_inst(compiler, OR | S(SLJIT_SP) | A(TMP_REG1) | B(SLJIT_SP))); in sljit_emit_enter()
788 FAIL_IF(load_immediate(compiler, TMP_REG2, -local_size)); in sljit_emit_enter()
790 FAIL_IF(push_inst(compiler, STWUX | S(SLJIT_SP) | A(SLJIT_SP) | B(TMP_REG2))); in sljit_emit_enter()
792 FAIL_IF(push_inst(compiler, STDUX | S(SLJIT_SP) | A(SLJIT_SP) | B(TMP_REG2))); in sljit_emit_enter()
801 FAIL_IF(push_inst(compiler, STFD | FS(i) | A(base) | IMM(offset))); in sljit_emit_enter()
806 FAIL_IF(push_inst(compiler, STFD | FS(i) | A(base) | IMM(offset))); in sljit_emit_enter()
811 FAIL_IF(push_inst(compiler, STACK_STORE | S(TMP_ZERO) | A(base) | IMM(offset))); in sljit_emit_enter()
817 FAIL_IF(push_inst(compiler, STACK_STORE | S(i) | A(base) | IMM(offset))); in sljit_emit_enter()
822 FAIL_IF(push_inst(compiler, STACK_STORE | S(i) | A(base) | IMM(offset))); in sljit_emit_enter()
825 FAIL_IF(push_inst(compiler, STACK_STORE | S(0) | A(base) | IMM(local_size + LR_SAVE_OFFSET))); in sljit_emit_enter()
830 FAIL_IF(push_inst(compiler, ADDI | D(TMP_ZERO) | A(0) | 0)); in sljit_emit_enter()
847 FAIL_IF(push_inst(compiler, OR | S(SLJIT_R0 + arg_count) | A(tmp) | B(SLJIT_R0 + arg_count))); in sljit_emit_enter()
851 …FAIL_IF(push_inst(compiler, OR | S(SLJIT_R0 + word_arg_count) | A(SLJIT_S0 - saved_arg_count) | B(… in sljit_emit_enter()
867 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *compiler, in sljit_set_context() argument
872 …CHECK(check_sljit_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds… in sljit_set_context()
873 set_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); in sljit_set_context()
881 compiler->local_size = (local_size + SLJIT_LOCALS_OFFSET + 15) & ~0xf; in sljit_set_context()
885 static sljit_s32 emit_stack_frame_release(struct sljit_compiler *compiler, sljit_s32 is_return_to) in emit_stack_frame_release() argument
888 sljit_s32 local_size = compiler->local_size; in emit_stack_frame_release()
894 FAIL_IF(push_inst(compiler, STACK_LOAD | D(base) | A(SLJIT_SP) | IMM(0))); in emit_stack_frame_release()
897 …FAIL_IF(push_inst(compiler, ADDI | D(TMP_REG1) | A(SLJIT_SP) | IMM(local_size - STACK_MAX_DISTANCE… in emit_stack_frame_release()
904 FAIL_IF(push_inst(compiler, STACK_LOAD | S(0) | A(base) | IMM(offset + LR_SAVE_OFFSET))); in emit_stack_frame_release()
906 tmp = SLJIT_FS0 - compiler->fsaveds; in emit_stack_frame_release()
909 FAIL_IF(push_inst(compiler, LFD | FS(i) | A(base) | IMM(offset))); in emit_stack_frame_release()
912 for (i = compiler->fscratches; i >= SLJIT_FIRST_SAVED_FLOAT_REG; i--) { in emit_stack_frame_release()
914 FAIL_IF(push_inst(compiler, LFD | FS(i) | A(base) | IMM(offset))); in emit_stack_frame_release()
917 if (!(compiler->options & SLJIT_ENTER_REG_ARG)) { in emit_stack_frame_release()
919 FAIL_IF(push_inst(compiler, STACK_LOAD | S(TMP_ZERO) | A(base) | IMM(offset))); in emit_stack_frame_release()
922 tmp = SLJIT_S0 - compiler->saveds; in emit_stack_frame_release()
923 for (i = SLJIT_S0 - SLJIT_KEPT_SAVEDS_COUNT(compiler->options); i > tmp; i--) { in emit_stack_frame_release()
925 FAIL_IF(push_inst(compiler, STACK_LOAD | S(i) | A(base) | IMM(offset))); in emit_stack_frame_release()
928 for (i = compiler->scratches; i >= SLJIT_FIRST_SAVED_REG; i--) { in emit_stack_frame_release()
930 FAIL_IF(push_inst(compiler, STACK_LOAD | S(i) | A(base) | IMM(offset))); in emit_stack_frame_release()
934 push_inst(compiler, MTLR | S(0)); in emit_stack_frame_release()
937 return push_inst(compiler, ADDI | D(SLJIT_SP) | A(base) | IMM(local_size)); in emit_stack_frame_release()
940 return push_inst(compiler, OR | S(base) | A(SLJIT_SP) | B(base)); in emit_stack_frame_release()
946 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return_void(struct sljit_compiler *compiler) in sljit_emit_return_void() argument
949 CHECK(check_sljit_emit_return_void(compiler)); in sljit_emit_return_void()
951 FAIL_IF(emit_stack_frame_release(compiler, 0)); in sljit_emit_return_void()
952 return push_inst(compiler, BLR); in sljit_emit_return_void()
955 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return_to(struct sljit_compiler *compiler, in sljit_emit_return_to() argument
959 CHECK(check_sljit_emit_return_to(compiler, src, srcw)); in sljit_emit_return_to()
963 FAIL_IF(emit_op_mem(compiler, WORD_DATA | LOAD_DATA, TMP_CALL_REG, src, srcw, TMP_CALL_REG)); in sljit_emit_return_to()
966 …} else if (src >= SLJIT_FIRST_SAVED_REG && src <= (SLJIT_S0 - SLJIT_KEPT_SAVEDS_COUNT(compiler->op… in sljit_emit_return_to()
967 FAIL_IF(push_inst(compiler, OR | S(src) | A(TMP_CALL_REG) | B(src))); in sljit_emit_return_to()
972 FAIL_IF(emit_stack_frame_release(compiler, 1)); in sljit_emit_return_to()
974 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_return_to()
975 return sljit_emit_ijump(compiler, SLJIT_JUMP, src, srcw); in sljit_emit_return_to()
1137 static sljit_s32 emit_op_mem(struct sljit_compiler *compiler, sljit_s32 inp_flags, sljit_s32 reg, in emit_op_mem() argument
1152 FAIL_IF(push_inst(compiler, SLWI_W(argw) | S(OFFS_REG(arg)) | A(tmp_reg))); in emit_op_mem()
1162 …return push_inst(compiler, INST_CODE_AND_DST(inst, inp_flags, reg) | A(arg & REG_MASK) | B(offs_re… in emit_op_mem()
1170 FAIL_IF(load_immediate(compiler, tmp_reg, argw)); in emit_op_mem()
1173 return push_inst(compiler, INST_CODE_AND_DST(inst, inp_flags, reg) | A(arg) | B(tmp_reg)); in emit_op_mem()
1178 return push_inst(compiler, INST_CODE_AND_DST(inst, inp_flags, reg) | A(arg) | IMM(argw)); in emit_op_mem()
1183 FAIL_IF(push_inst(compiler, ADDIS | D(tmp_reg) | A(arg) | IMM((argw + 0x8000) >> 16))); in emit_op_mem()
1184 return push_inst(compiler, INST_CODE_AND_DST(inst, inp_flags, reg) | A(tmp_reg) | IMM(argw)); in emit_op_mem()
1188 FAIL_IF(load_immediate(compiler, tmp_reg, argw)); in emit_op_mem()
1191 return push_inst(compiler, INST_CODE_AND_DST(inst, inp_flags, reg) | A(arg) | B(tmp_reg)); in emit_op_mem()
1195 static sljit_s32 emit_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_s32 input_flags, in emit_op() argument
1228 FAIL_IF(load_immediate(compiler, TMP_REG1, src1w)); in emit_op()
1233 FAIL_IF(emit_op_mem(compiler, input_flags | LOAD_DATA, TMP_REG1, src1, src1w, TMP_REG1)); in emit_op()
1248 FAIL_IF(load_immediate(compiler, sugg_src2_r, src2w)); in emit_op()
1253 FAIL_IF(emit_op_mem(compiler, input_flags | LOAD_DATA, sugg_src2_r, src2, src2w, TMP_REG2)); in emit_op()
1257 FAIL_IF(emit_single_op(compiler, op, flags, dst_r, src1_r, src2_r)); in emit_op()
1262 return emit_op_mem(compiler, input_flags, dst_r, dst, dstw, TMP_REG1); in emit_op()
1265 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compiler, sljit_s32 op) in sljit_emit_op0() argument
1272 CHECK(check_sljit_emit_op0(compiler, op)); in sljit_emit_op0()
1278 return push_inst(compiler, NOP); in sljit_emit_op0()
1281 FAIL_IF(push_inst(compiler, OR | S(SLJIT_R0) | A(TMP_REG1) | B(SLJIT_R0))); in sljit_emit_op0()
1283 FAIL_IF(push_inst(compiler, MULLD | D(SLJIT_R0) | A(TMP_REG1) | B(SLJIT_R1))); in sljit_emit_op0()
1284 …return push_inst(compiler, (op == SLJIT_LMUL_UW ? MULHDU : MULHD) | D(SLJIT_R1) | A(TMP_REG1) | B(… in sljit_emit_op0()
1286 FAIL_IF(push_inst(compiler, MULLW | D(SLJIT_R0) | A(TMP_REG1) | B(SLJIT_R1))); in sljit_emit_op0()
1287 …return push_inst(compiler, (op == SLJIT_LMUL_UW ? MULHWU : MULHW) | D(SLJIT_R1) | A(TMP_REG1) | B(… in sljit_emit_op0()
1291 FAIL_IF(push_inst(compiler, OR | S(SLJIT_R0) | A(TMP_REG1) | B(SLJIT_R0))); in sljit_emit_op0()
1293 …FAIL_IF(push_inst(compiler, (int_op ? (op == SLJIT_DIVMOD_UW ? DIVWU : DIVW) : (op == SLJIT_DIVMOD… in sljit_emit_op0()
1294 FAIL_IF(push_inst(compiler, (int_op ? MULLW : MULLD) | D(SLJIT_R1) | A(SLJIT_R0) | B(SLJIT_R1))); in sljit_emit_op0()
1296 …FAIL_IF(push_inst(compiler, (op == SLJIT_DIVMOD_UW ? DIVWU : DIVW) | D(SLJIT_R0) | A(SLJIT_R0) | B… in sljit_emit_op0()
1297 FAIL_IF(push_inst(compiler, MULLW | D(SLJIT_R1) | A(SLJIT_R0) | B(SLJIT_R1))); in sljit_emit_op0()
1299 return push_inst(compiler, SUBF | D(SLJIT_R1) | A(SLJIT_R1) | B(TMP_REG1)); in sljit_emit_op0()
1303 …return push_inst(compiler, (int_op ? (op == SLJIT_DIV_UW ? DIVWU : DIVW) : (op == SLJIT_DIV_UW ? D… in sljit_emit_op0()
1305 …return push_inst(compiler, (op == SLJIT_DIV_UW ? DIVWU : DIVW) | D(SLJIT_R0) | A(SLJIT_R0) | B(SLJ… in sljit_emit_op0()
1315 static sljit_s32 emit_prefetch(struct sljit_compiler *compiler, in emit_prefetch() argument
1320 return push_inst(compiler, DCBT | A(0) | B(src & REG_MASK)); in emit_prefetch()
1322 FAIL_IF(load_immediate(compiler, TMP_REG1, srcw)); in emit_prefetch()
1324 return push_inst(compiler, DCBT | A(src & REG_MASK) | B(TMP_REG1)); in emit_prefetch()
1330 return push_inst(compiler, DCBT | A(src & REG_MASK) | B(OFFS_REG(src))); in emit_prefetch()
1332 FAIL_IF(push_inst(compiler, SLWI_W(srcw) | S(OFFS_REG(src)) | A(TMP_REG1))); in emit_prefetch()
1333 return push_inst(compiler, DCBT | A(src & REG_MASK) | B(TMP_REG1)); in emit_prefetch()
1337 …emit_op(compiler, (src & SLJIT_IMM) ? SLJIT_MOV : type, flags | (type_flags), dst, dstw, TMP_REG1,…
1339 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op1() argument
1347 CHECK(check_sljit_emit_op1(compiler, op, dst, dstw, src, srcw)); in sljit_emit_op1()
1354 FAIL_IF(push_inst(compiler, MTXER | S(TMP_ZERO))); in sljit_emit_op1()
1390 return emit_op(compiler, SLJIT_MOV, flags | WORD_DATA, dst, dstw, TMP_REG1, 0, src, srcw); in sljit_emit_op1()
1414 return emit_op(compiler, SLJIT_NOT, flags, dst, dstw, TMP_REG1, 0, src, srcw); in sljit_emit_op1()
1419 …return emit_op(compiler, op, flags | (!(op_flags & SLJIT_32) ? 0 : ALT_FORM1), dst, dstw, TMP_REG1… in sljit_emit_op1()
1421 return emit_op(compiler, op, flags, dst, dstw, TMP_REG1, 0, src, srcw); in sljit_emit_op1()
1482 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op2() argument
1490 CHECK(check_sljit_emit_op2(compiler, op, 0, dst, dstw, src1, src1w, src2, src2w)); in sljit_emit_op2()
1508 FAIL_IF(push_inst(compiler, MTXER | S(TMP_ZERO))); in sljit_emit_op2()
1512 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_ADD; in sljit_emit_op2()
1515 return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM1, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
1519 compiler->imm = (sljit_ins)src2w & 0xffff; in sljit_emit_op2()
1520 return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2, dst, dstw, src1, src1w, TMP_REG2, 0); in sljit_emit_op2()
1523 compiler->imm = (sljit_ins)src1w & 0xffff; in sljit_emit_op2()
1524 return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2, dst, dstw, src2, src2w, TMP_REG2, 0); in sljit_emit_op2()
1527 compiler->imm = (sljit_ins)(src2w >> 16) & 0xffff; in sljit_emit_op2()
1528 …return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2 | ALT_FORM3, dst, dstw, src1, src1w, TMP_REG… in sljit_emit_op2()
1531 compiler->imm = (sljit_ins)(src1w >> 16) & 0xffff; in sljit_emit_op2()
1532 …return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2 | ALT_FORM3, dst, dstw, src2, src2w, TMP_REG… in sljit_emit_op2()
1536 compiler->imm = (sljit_ins)src2w & 0xffffffff; in sljit_emit_op2()
1537 …return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2 | ALT_FORM4, dst, dstw, src1, src1w, TMP_REG… in sljit_emit_op2()
1540 compiler->imm = (sljit_ins)src1w & 0xffffffff; in sljit_emit_op2()
1541 …return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2 | ALT_FORM4, dst, dstw, src2, src2w, TMP_REG… in sljit_emit_op2()
1548 compiler->imm = (sljit_ins)src2w & 0xffff; in sljit_emit_op2()
1549 …return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM4 | ALT_FORM5, dst, dstw, src1, src1w, TMP_REG… in sljit_emit_op2()
1552 compiler->imm = (sljit_ins)src1w & 0xffff; in sljit_emit_op2()
1553 …return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM4 | ALT_FORM5, dst, dstw, src2, src2w, TMP_REG… in sljit_emit_op2()
1555 return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM4, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
1560 compiler->imm = (sljit_ins)src2w & 0xffff; in sljit_emit_op2()
1561 return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM3, dst, dstw, src1, src1w, TMP_REG2, 0); in sljit_emit_op2()
1564 compiler->imm = (sljit_ins)src1w & 0xffff; in sljit_emit_op2()
1565 return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM3, dst, dstw, src2, src2w, TMP_REG2, 0); in sljit_emit_op2()
1568 …return emit_op(compiler, SLJIT_ADD, flags | ((GET_FLAG_TYPE(op) == GET_FLAG_TYPE(SLJIT_SET_CARRY))… in sljit_emit_op2()
1571 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_ADD; in sljit_emit_op2()
1572 return emit_op(compiler, SLJIT_ADDC, flags, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
1575 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_SUB; in sljit_emit_op2()
1580 compiler->imm = (sljit_ins)src2w & 0xffff; in sljit_emit_op2()
1581 …return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM1 | ALT_FORM2, dst, dstw, src1, src1w, TMP_REG… in sljit_emit_op2()
1583 return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM1, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
1587 compiler->imm = (sljit_ins)src2w; in sljit_emit_op2()
1588 …return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM1 | ALT_FORM2 | ALT_FORM3, dst, dstw, src1, sr… in sljit_emit_op2()
1590 …return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM1 | ALT_FORM3, dst, dstw, src1, src1w, src2, s… in sljit_emit_op2()
1595 compiler->imm = (sljit_ins)src2w & 0xffff; in sljit_emit_op2()
1596 …return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM2 | ALT_FORM3, dst, dstw, src1, src1w, TMP_REG… in sljit_emit_op2()
1598 return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM2, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
1603 compiler->imm = (sljit_ins)src2w & 0xffff; in sljit_emit_op2()
1604 …return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM2 | ALT_FORM3 | ALT_FORM4, dst, dstw, src1, sr… in sljit_emit_op2()
1606 …return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM2 | ALT_FORM4, dst, dstw, src1, src1w, src2, s… in sljit_emit_op2()
1610 return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM3, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
1613 compiler->imm = (sljit_ins)(-src2w) & 0xffff; in sljit_emit_op2()
1614 …return emit_op(compiler, SLJIT_ADD, flags | (!HAS_FLAGS(op) ? ALT_FORM2 : ALT_FORM3), dst, dstw, s… in sljit_emit_op2()
1618 compiler->imm = (sljit_ins)src1w & 0xffff; in sljit_emit_op2()
1619 return emit_op(compiler, SLJIT_SUB, flags | ALT_FORM4, dst, dstw, src2, src2w, TMP_REG2, 0); in sljit_emit_op2()
1624 compiler->imm = (sljit_ins)((-src2w) >> 16) & 0xffff; in sljit_emit_op2()
1625 …return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2 | ALT_FORM3, dst, dstw, src1, src1w, TMP_RE… in sljit_emit_op2()
1629 compiler->imm = (sljit_ins)-src2w; in sljit_emit_op2()
1630 …return emit_op(compiler, SLJIT_ADD, flags | ALT_FORM2 | ALT_FORM4, dst, dstw, src1, src1w, TMP_REG… in sljit_emit_op2()
1635 …return emit_op(compiler, SLJIT_SUB, flags | ((GET_FLAG_TYPE(op) == GET_FLAG_TYPE(SLJIT_SET_CARRY))… in sljit_emit_op2()
1638 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_SUB; in sljit_emit_op2()
1639 return emit_op(compiler, SLJIT_SUBC, flags, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
1648 compiler->imm = (sljit_ins)src2w & 0xffff; in sljit_emit_op2()
1649 return emit_op(compiler, SLJIT_MUL, flags | ALT_FORM1, dst, dstw, src1, src1w, TMP_REG2, 0); in sljit_emit_op2()
1652 compiler->imm = (sljit_ins)src1w & 0xffff; in sljit_emit_op2()
1653 return emit_op(compiler, SLJIT_MUL, flags | ALT_FORM1, dst, dstw, src2, src2w, TMP_REG2, 0); in sljit_emit_op2()
1657 FAIL_IF(push_inst(compiler, MTXER | S(TMP_ZERO))); in sljit_emit_op2()
1658 return emit_op(compiler, SLJIT_MUL, flags, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
1666 compiler->imm = (sljit_ins)src2w; in sljit_emit_op2()
1667 … return emit_op(compiler, GET_OPCODE(op), flags | ALT_FORM1, dst, dstw, src1, src1w, TMP_REG2, 0); in sljit_emit_op2()
1670 compiler->imm = (sljit_ins)src1w; in sljit_emit_op2()
1671 … return emit_op(compiler, GET_OPCODE(op), flags | ALT_FORM1, dst, dstw, src2, src2w, TMP_REG2, 0); in sljit_emit_op2()
1674 compiler->imm = (sljit_ins)(src2w >> 16) & 0xffff; in sljit_emit_op2()
1675 … return emit_op(compiler, GET_OPCODE(op), flags | ALT_FORM2, dst, dstw, src1, src1w, TMP_REG2, 0); in sljit_emit_op2()
1678 compiler->imm = (sljit_ins)(src1w >> 16) & 0xffff; in sljit_emit_op2()
1679 … return emit_op(compiler, GET_OPCODE(op), flags | ALT_FORM2, dst, dstw, src2, src2w, TMP_REG2, 0); in sljit_emit_op2()
1685 compiler->imm = (sljit_ins)src2w; in sljit_emit_op2()
1686 … return emit_op(compiler, GET_OPCODE(op), flags | ALT_FORM3, dst, dstw, src1, src1w, TMP_REG2, 0); in sljit_emit_op2()
1689 compiler->imm = (sljit_ins)src1w; in sljit_emit_op2()
1690 … return emit_op(compiler, GET_OPCODE(op), flags | ALT_FORM3, dst, dstw, src2, src2w, TMP_REG2, 0); in sljit_emit_op2()
1693 return emit_op(compiler, GET_OPCODE(op), flags, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
1708 compiler->imm = (sljit_ins)src2w; in sljit_emit_op2()
1709 return emit_op(compiler, GET_OPCODE(op), flags | ALT_FORM1, dst, dstw, src1, src1w, TMP_REG2, 0); in sljit_emit_op2()
1711 return emit_op(compiler, GET_OPCODE(op), flags, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
1717 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2u(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op2u() argument
1722 CHECK(check_sljit_emit_op2(compiler, op, 1, 0, 0, src1, src1w, src2, src2w)); in sljit_emit_op2u()
1724 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_op2u()
1725 return sljit_emit_op2(compiler, op, TMP_REG2, 0, src1, src1w, src2, src2w); in sljit_emit_op2u()
1732 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_shift_into(struct sljit_compiler *compiler, sljit_s32… in sljit_emit_shift_into() argument
1747 CHECK(check_sljit_emit_shift_into(compiler, op, src_dst, src1, src1w, src2, src2w)); in sljit_emit_shift_into()
1752 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_shift_into()
1753 …return sljit_emit_op2(compiler, (is_right ? SLJIT_ROTR : SLJIT_ROTL) | (op & SLJIT_32), src_dst, 0… in sljit_emit_shift_into()
1765 FAIL_IF(emit_op_mem(compiler, inp_flags, TMP_REG2, src2, src2w, TMP_REG2)); in sljit_emit_shift_into()
1770 FAIL_IF(emit_op_mem(compiler, inp_flags, TMP_REG1, src1, src1w, TMP_REG1)); in sljit_emit_shift_into()
1773 FAIL_IF(load_immediate(compiler, TMP_REG1, src1w)); in sljit_emit_shift_into()
1781 FAIL_IF(push_inst(compiler, SRDI(src2w) | S(src_dst) | A(src_dst))); in sljit_emit_shift_into()
1782 return push_inst(compiler, RLDIMI | S(src1) | A(src_dst) | RLDI_SH(64 - src2w) | RLDI_MB(0)); in sljit_emit_shift_into()
1785 FAIL_IF(push_inst(compiler, SLDI(src2w) | S(src_dst) | A(src_dst))); in sljit_emit_shift_into()
1787 …FAIL_IF(push_inst(compiler, RLDICL | S(src1) | A(TMP_REG1) | RLDI_SH(src2w) | RLDI_MB(64 - src2w))… in sljit_emit_shift_into()
1788 return push_inst(compiler, OR | S(src_dst) | A(src_dst) | B(TMP_REG1)); in sljit_emit_shift_into()
1793 FAIL_IF(push_inst(compiler, SRWI(src2w) | S(src_dst) | A(src_dst))); in sljit_emit_shift_into()
1794 …return push_inst(compiler, RLWIMI | S(src1) | A(src_dst) | RLWI_SH(32 - src2w) | RLWI_MBE(0, src2w… in sljit_emit_shift_into()
1797 FAIL_IF(push_inst(compiler, SLWI(src2w) | S(src_dst) | A(src_dst))); in sljit_emit_shift_into()
1798 …return push_inst(compiler, RLWIMI | S(src1) | A(src_dst) | RLWI_SH(src2w) | RLWI_MBE(32 - src2w, 3… in sljit_emit_shift_into()
1804 FAIL_IF(push_inst(compiler, ANDI | S(src2) | A(TMP_REG2) | 0x3f)); in sljit_emit_shift_into()
1808 FAIL_IF(push_inst(compiler, (is_right ? SRD : SLD) | S(src_dst) | A(src_dst) | B(src2))); in sljit_emit_shift_into()
1809 FAIL_IF(push_inst(compiler, (is_right ? SLDI(1) : SRDI(1)) | S(src1) | A(TMP_REG1))); in sljit_emit_shift_into()
1810 FAIL_IF(push_inst(compiler, XORI | S(src2) | A(TMP_REG2) | 0x3f)); in sljit_emit_shift_into()
1811 FAIL_IF(push_inst(compiler, (is_right ? SLD : SRD) | S(TMP_REG1) | A(TMP_REG1) | B(TMP_REG2))); in sljit_emit_shift_into()
1812 return push_inst(compiler, OR | S(src_dst) | A(src_dst) | B(TMP_REG1)); in sljit_emit_shift_into()
1817 FAIL_IF(push_inst(compiler, ANDI | S(src2) | A(TMP_REG2) | 0x1f)); in sljit_emit_shift_into()
1821 FAIL_IF(push_inst(compiler, (is_right ? SRW : SLW) | S(src_dst) | A(src_dst) | B(src2))); in sljit_emit_shift_into()
1822 FAIL_IF(push_inst(compiler, (is_right ? SLWI(1) : SRWI(1)) | S(src1) | A(TMP_REG1))); in sljit_emit_shift_into()
1823 FAIL_IF(push_inst(compiler, XORI | S(src2) | A(TMP_REG2) | 0x1f)); in sljit_emit_shift_into()
1824 FAIL_IF(push_inst(compiler, (is_right ? SLW : SRW) | S(TMP_REG1) | A(TMP_REG1) | B(TMP_REG2))); in sljit_emit_shift_into()
1825 return push_inst(compiler, OR | S(src_dst) | A(src_dst) | B(TMP_REG1)); in sljit_emit_shift_into()
1828 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_src(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op_src() argument
1832 CHECK(check_sljit_emit_op_src(compiler, op, src, srcw)); in sljit_emit_op_src()
1838 FAIL_IF(push_inst(compiler, MTLR | S(src))); in sljit_emit_op_src()
1840 FAIL_IF(emit_op_mem(compiler, WORD_DATA | LOAD_DATA, TMP_REG2, src, srcw, TMP_REG2)); in sljit_emit_op_src()
1841 FAIL_IF(push_inst(compiler, MTLR | S(TMP_REG2))); in sljit_emit_op_src()
1844 return push_inst(compiler, BLR); in sljit_emit_op_src()
1851 return emit_prefetch(compiler, src, srcw); in sljit_emit_op_src()
1869 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_custom(struct sljit_compiler *compiler, in sljit_emit_op_custom() argument
1873 CHECK(check_sljit_emit_op_custom(compiler, instruction, size)); in sljit_emit_op_custom()
1875 return push_inst(compiler, *(sljit_ins*)instruction); in sljit_emit_op_custom()
1900 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
1906 FAIL_IF(emit_op_mem(compiler, FLOAT_DATA(op) | LOAD_DATA, TMP_FREG1, src, srcw, TMP_REG1)); in sljit_emit_fop1_conv_sw_from_f64()
1912 …FAIL_IF(push_inst(compiler, (op == SLJIT_CONV_S32_FROM_F64 ? FCTIWZ : FCTIDZ) | FD(TMP_FREG1) | FB… in sljit_emit_fop1_conv_sw_from_f64()
1916 …FAIL_IF(emit_op_mem(compiler, DOUBLE_DATA, TMP_FREG1, SLJIT_MEM1(SLJIT_SP), FLOAT_TMP_MEM_OFFSET, … in sljit_emit_fop1_conv_sw_from_f64()
1917 …return emit_op_mem(compiler, WORD_DATA | LOAD_DATA, dst, SLJIT_MEM1(SLJIT_SP), FLOAT_TMP_MEM_OFFSE… in sljit_emit_fop1_conv_sw_from_f64()
1919 return emit_op_mem(compiler, DOUBLE_DATA, TMP_FREG1, dst, dstw, TMP_REG1); in sljit_emit_fop1_conv_sw_from_f64()
1922 FAIL_IF(push_inst(compiler, FCTIWZ | FD(TMP_FREG1) | FB(src))); in sljit_emit_fop1_conv_sw_from_f64()
1926 FAIL_IF(load_immediate(compiler, TMP_REG1, FLOAT_TMP_MEM_OFFSET)); in sljit_emit_fop1_conv_sw_from_f64()
1927 FAIL_IF(push_inst(compiler, STFIWX | FS(TMP_FREG1) | A(SLJIT_SP) | B(TMP_REG1))); in sljit_emit_fop1_conv_sw_from_f64()
1928 …return emit_op_mem(compiler, INT_DATA | LOAD_DATA, dst, SLJIT_MEM1(SLJIT_SP), FLOAT_TMP_MEM_OFFSET… in sljit_emit_fop1_conv_sw_from_f64()
1936 FAIL_IF(push_inst(compiler, SLWI_W(dstw) | S(OFFS_REG(dst)) | A(TMP_REG1))); in sljit_emit_fop1_conv_sw_from_f64()
1949 FAIL_IF(load_immediate(compiler, TMP_REG1, dstw)); in sljit_emit_fop1_conv_sw_from_f64()
1954 return push_inst(compiler, STFIWX | FS(TMP_FREG1) | A(dst & REG_MASK) | B(dstw)); in sljit_emit_fop1_conv_sw_from_f64()
1957 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
1969 FAIL_IF(load_immediate(compiler, TMP_REG1, srcw)); in sljit_emit_fop1_conv_f64_from_sw()
1974 FAIL_IF(push_inst(compiler, EXTSW | S(src) | A(TMP_REG1))); in sljit_emit_fop1_conv_f64_from_sw()
1976 … FAIL_IF(emit_op_mem(compiler, INT_DATA | SIGNED_DATA | LOAD_DATA, TMP_REG1, src, srcw, TMP_REG1)); in sljit_emit_fop1_conv_f64_from_sw()
1981 …FAIL_IF(emit_op_mem(compiler, WORD_DATA, src, SLJIT_MEM1(SLJIT_SP), FLOAT_TMP_MEM_OFFSET, TMP_REG1… in sljit_emit_fop1_conv_f64_from_sw()
1982 …FAIL_IF(emit_op_mem(compiler, DOUBLE_DATA | LOAD_DATA, TMP_FREG1, SLJIT_MEM1(SLJIT_SP), FLOAT_TMP_… in sljit_emit_fop1_conv_f64_from_sw()
1985 FAIL_IF(emit_op_mem(compiler, DOUBLE_DATA | LOAD_DATA, TMP_FREG1, src, srcw, TMP_REG1)); in sljit_emit_fop1_conv_f64_from_sw()
1987 FAIL_IF(push_inst(compiler, FCFID | FD(dst_r) | FB(TMP_FREG1))); in sljit_emit_fop1_conv_f64_from_sw()
1990 return emit_op_mem(compiler, FLOAT_DATA(op), TMP_FREG1, dst, dstw, TMP_REG1); in sljit_emit_fop1_conv_f64_from_sw()
1992 return push_inst(compiler, FRSP | FD(dst_r) | FB(dst_r)); in sljit_emit_fop1_conv_f64_from_sw()
2001 FAIL_IF(load_immediate(compiler, TMP_REG1, srcw ^ (sljit_sw)0x80000000)); in sljit_emit_fop1_conv_f64_from_sw()
2006 …FAIL_IF(emit_op_mem(compiler, WORD_DATA | SIGNED_DATA | LOAD_DATA, TMP_REG1, src, srcw, TMP_REG1)); in sljit_emit_fop1_conv_f64_from_sw()
2015 FAIL_IF(push_inst(compiler, ADDIS | D(TMP_REG2) | A(0) | 0x4330)); in sljit_emit_fop1_conv_f64_from_sw()
2017 FAIL_IF(push_inst(compiler, XORIS | S(src) | A(TMP_REG1) | 0x8000)); in sljit_emit_fop1_conv_f64_from_sw()
2018 …FAIL_IF(emit_op_mem(compiler, WORD_DATA, TMP_REG2, SLJIT_MEM1(SLJIT_SP), FLOAT_TMP_MEM_OFFSET_HI, … in sljit_emit_fop1_conv_f64_from_sw()
2019 …FAIL_IF(emit_op_mem(compiler, WORD_DATA, TMP_REG1, SLJIT_MEM1(SLJIT_SP), FLOAT_TMP_MEM_OFFSET_LOW,… in sljit_emit_fop1_conv_f64_from_sw()
2020 FAIL_IF(push_inst(compiler, ADDIS | D(TMP_REG1) | A(0) | 0x8000)); in sljit_emit_fop1_conv_f64_from_sw()
2021 …FAIL_IF(emit_op_mem(compiler, DOUBLE_DATA | LOAD_DATA, TMP_FREG1, SLJIT_MEM1(SLJIT_SP), FLOAT_TMP_… in sljit_emit_fop1_conv_f64_from_sw()
2022 …FAIL_IF(emit_op_mem(compiler, WORD_DATA, TMP_REG1, SLJIT_MEM1(SLJIT_SP), FLOAT_TMP_MEM_OFFSET_LOW,… in sljit_emit_fop1_conv_f64_from_sw()
2023 …FAIL_IF(emit_op_mem(compiler, DOUBLE_DATA | LOAD_DATA, TMP_FREG2, SLJIT_MEM1(SLJIT_SP), FLOAT_TMP_… in sljit_emit_fop1_conv_f64_from_sw()
2025 FAIL_IF(push_inst(compiler, FSUB | FD(dst_r) | FA(TMP_FREG1) | FB(TMP_FREG2))); in sljit_emit_fop1_conv_f64_from_sw()
2028 return emit_op_mem(compiler, FLOAT_DATA(op), TMP_FREG1, dst, dstw, TMP_REG1); in sljit_emit_fop1_conv_f64_from_sw()
2030 return push_inst(compiler, FRSP | FD(dst_r) | FB(dst_r)); in sljit_emit_fop1_conv_f64_from_sw()
2036 static SLJIT_INLINE sljit_s32 sljit_emit_fop1_cmp(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop1_cmp() argument
2041 FAIL_IF(emit_op_mem(compiler, FLOAT_DATA(op) | LOAD_DATA, TMP_FREG1, src1, src1w, TMP_REG1)); in sljit_emit_fop1_cmp()
2046 FAIL_IF(emit_op_mem(compiler, FLOAT_DATA(op) | LOAD_DATA, TMP_FREG2, src2, src2w, TMP_REG2)); in sljit_emit_fop1_cmp()
2050 FAIL_IF(push_inst(compiler, FCMPU | CRD(4) | FA(src1) | FB(src2))); in sljit_emit_fop1_cmp()
2055 return push_inst(compiler, CROR | ((4 + 2) << 21) | ((4 + 2) << 16) | ((4 + 3) << 11)); in sljit_emit_fop1_cmp()
2058 return push_inst(compiler, CROR | ((4 + 0) << 21) | ((4 + 0) << 16) | ((4 + 3) << 11)); in sljit_emit_fop1_cmp()
2061 return push_inst(compiler, CROR | ((4 + 1) << 21) | ((4 + 1) << 16) | ((4 + 3) << 11)); in sljit_emit_fop1_cmp()
2067 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop1() argument
2076 SELECT_FOP1_OPERATION_WITH_CHECKS(compiler, op, dst, dstw, src, srcw); in sljit_emit_fop1()
2084 FAIL_IF(emit_op_mem(compiler, FLOAT_DATA(op) | LOAD_DATA, dst_r, src, srcw, TMP_REG1)); in sljit_emit_fop1()
2092 FAIL_IF(push_inst(compiler, FRSP | FD(dst_r) | FB(src))); in sljit_emit_fop1()
2099 FAIL_IF(push_inst(compiler, FMR | FD(dst_r) | FB(src))); in sljit_emit_fop1()
2105 FAIL_IF(push_inst(compiler, FNEG | FD(dst_r) | FB(src))); in sljit_emit_fop1()
2108 FAIL_IF(push_inst(compiler, FABS | FD(dst_r) | FB(src))); in sljit_emit_fop1()
2113 FAIL_IF(emit_op_mem(compiler, FLOAT_DATA(op), dst_r, dst, dstw, TMP_REG1)); in sljit_emit_fop1()
2117 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop2(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop2() argument
2125 CHECK(check_sljit_emit_fop2(compiler, op, dst, dstw, src1, src1w, src2, src2w)); in sljit_emit_fop2()
2133 FAIL_IF(emit_op_mem(compiler, FLOAT_DATA(op) | LOAD_DATA, TMP_FREG1, src1, src1w, TMP_REG1)); in sljit_emit_fop2()
2138 FAIL_IF(emit_op_mem(compiler, FLOAT_DATA(op) | LOAD_DATA, TMP_FREG2, src2, src2w, TMP_REG2)); in sljit_emit_fop2()
2144 FAIL_IF(push_inst(compiler, SELECT_FOP(op, FADDS, FADD) | FD(dst_r) | FA(src1) | FB(src2))); in sljit_emit_fop2()
2148 FAIL_IF(push_inst(compiler, SELECT_FOP(op, FSUBS, FSUB) | FD(dst_r) | FA(src1) | FB(src2))); in sljit_emit_fop2()
2152 …FAIL_IF(push_inst(compiler, SELECT_FOP(op, FMULS, FMUL) | FD(dst_r) | FA(src1) | FC(src2) /* FMUL … in sljit_emit_fop2()
2156 FAIL_IF(push_inst(compiler, SELECT_FOP(op, FDIVS, FDIV) | FD(dst_r) | FA(src1) | FB(src2))); in sljit_emit_fop2()
2161 FAIL_IF(emit_op_mem(compiler, FLOAT_DATA(op), TMP_FREG2, dst, dstw, TMP_REG1)); in sljit_emit_fop2()
2172 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_enter(struct sljit_compiler *compiler, sljit_s32… in sljit_emit_fast_enter() argument
2175 CHECK(check_sljit_emit_fast_enter(compiler, dst, dstw)); in sljit_emit_fast_enter()
2179 return push_inst(compiler, MFLR | D(dst)); in sljit_emit_fast_enter()
2182 FAIL_IF(push_inst(compiler, MFLR | D(TMP_REG2))); in sljit_emit_fast_enter()
2183 return emit_op(compiler, SLJIT_MOV, WORD_DATA, dst, dstw, TMP_REG1, 0, TMP_REG2, 0); in sljit_emit_fast_enter()
2190 SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compiler *compiler) in sljit_emit_label() argument
2195 CHECK_PTR(check_sljit_emit_label(compiler)); in sljit_emit_label()
2197 if (compiler->last_label && compiler->last_label->size == compiler->size) in sljit_emit_label()
2198 return compiler->last_label; in sljit_emit_label()
2200 label = (struct sljit_label*)ensure_abuf(compiler, sizeof(struct sljit_label)); in sljit_emit_label()
2202 set_label(label, compiler); in sljit_emit_label()
2206 static sljit_ins get_bo_bi_flags(struct sljit_compiler *compiler, sljit_s32 type) in get_bo_bi_flags() argument
2210 if (compiler->status_flags_state & SLJIT_CURRENT_FLAGS_SUB) in get_bo_bi_flags()
2218 if (compiler->status_flags_state & SLJIT_CURRENT_FLAGS_SUB) in get_bo_bi_flags()
2289 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compiler *compiler, sljit_… in sljit_emit_jump() argument
2295 CHECK_PTR(check_sljit_emit_jump(compiler, type)); in sljit_emit_jump()
2297 bo_bi_flags = get_bo_bi_flags(compiler, type & 0xff); in sljit_emit_jump()
2301 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_jump()
2303 set_jump(jump, compiler, (sljit_u32)type & SLJIT_REWRITABLE_JUMP); in sljit_emit_jump()
2307 …PTR_FAIL_IF(push_inst(compiler, ADDE | RC(ALT_SET_FLAGS) | D(TMP_REG1) | A(TMP_ZERO) | B(TMP_ZERO)… in sljit_emit_jump()
2317 PTR_FAIL_IF(emit_const(compiler, TMP_CALL_REG, 0)); in sljit_emit_jump()
2318 PTR_FAIL_IF(push_inst(compiler, MTCTR | S(TMP_CALL_REG))); in sljit_emit_jump()
2319 jump->addr = compiler->size; in sljit_emit_jump()
2320 PTR_FAIL_IF(push_inst(compiler, BCCTR | bo_bi_flags | (type >= SLJIT_FAST_CALL ? 1 : 0))); in sljit_emit_jump()
2324 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_call(struct sljit_compiler *compiler, sljit_… in sljit_emit_call() argument
2328 CHECK_PTR(check_sljit_emit_call(compiler, type, arg_types)); in sljit_emit_call()
2332 PTR_FAIL_IF(call_with_args(compiler, arg_types, NULL)); in sljit_emit_call()
2336 PTR_FAIL_IF(emit_stack_frame_release(compiler, 0)); in sljit_emit_call()
2340 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_call()
2341 return sljit_emit_jump(compiler, type); in sljit_emit_call()
2344 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compiler, sljit_s32 type… in sljit_emit_ijump() argument
2350 CHECK(check_sljit_emit_ijump(compiler, type, src, srcw)); in sljit_emit_ijump()
2355 FAIL_IF(push_inst(compiler, OR | S(src) | A(TMP_CALL_REG) | B(src))); in sljit_emit_ijump()
2365 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_ijump()
2367 set_jump(jump, compiler, JUMP_ADDR); in sljit_emit_ijump()
2375 FAIL_IF(emit_const(compiler, TMP_CALL_REG, 0)); in sljit_emit_ijump()
2379 FAIL_IF(emit_op_mem(compiler, WORD_DATA | LOAD_DATA, TMP_CALL_REG, src, srcw, TMP_CALL_REG)); in sljit_emit_ijump()
2383 FAIL_IF(push_inst(compiler, MTCTR | S(src_r))); in sljit_emit_ijump()
2385 jump->addr = compiler->size; in sljit_emit_ijump()
2386 return push_inst(compiler, BCCTR | (20 << 21) | (type >= SLJIT_FAST_CALL ? 1 : 0)); in sljit_emit_ijump()
2389 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_icall(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_icall() argument
2394 CHECK(check_sljit_emit_icall(compiler, type, arg_types, src, srcw)); in sljit_emit_icall()
2398 FAIL_IF(emit_op_mem(compiler, WORD_DATA | LOAD_DATA, TMP_CALL_REG, src, srcw, TMP_CALL_REG)); in sljit_emit_icall()
2403 …if (src >= SLJIT_FIRST_SAVED_REG && src <= (SLJIT_S0 - SLJIT_KEPT_SAVEDS_COUNT(compiler->options))… in sljit_emit_icall()
2404 FAIL_IF(push_inst(compiler, OR | S(src) | A(TMP_CALL_REG) | B(src))); in sljit_emit_icall()
2408 FAIL_IF(emit_stack_frame_release(compiler, 0)); in sljit_emit_icall()
2414 FAIL_IF(call_with_args(compiler, arg_types, &src)); in sljit_emit_icall()
2417 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_icall()
2418 return sljit_emit_ijump(compiler, type, src, srcw); in sljit_emit_icall()
2421 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_s32 o… in sljit_emit_op_flags() argument
2436 CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, type)); in sljit_emit_op_flags()
2443 FAIL_IF(emit_op_mem(compiler, input_flags | LOAD_DATA, TMP_REG1, dst, dstw, TMP_REG1)); in sljit_emit_op_flags()
2493 invert = (compiler->status_flags_state & SLJIT_CURRENT_FLAGS_SUB) != 0; in sljit_emit_op_flags()
2499 invert = (compiler->status_flags_state & SLJIT_CURRENT_FLAGS_ADD) != 0; in sljit_emit_op_flags()
2555 FAIL_IF(push_inst(compiler, (from_xer ? MFXER : MFCR) | D(reg))); in sljit_emit_op_flags()
2557 FAIL_IF(push_inst(compiler, RLWINM | S(reg) | A(reg) | RLWI_SH(1 + bit) | RLWI_MBE(31, 31))); in sljit_emit_op_flags()
2560 FAIL_IF(push_inst(compiler, XORI | S(reg) | A(reg) | 0x1)); in sljit_emit_op_flags()
2565 return emit_op_mem(compiler, input_flags, reg, dst, dstw, TMP_REG1); in sljit_emit_op_flags()
2568 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_op_flags()
2571 return sljit_emit_op2(compiler, saved_op, dst, saved_dstw, TMP_REG1, 0, TMP_REG2, 0); in sljit_emit_op_flags()
2572 return sljit_emit_op2(compiler, saved_op, dst, 0, dst, 0, TMP_REG2, 0); in sljit_emit_op_flags()
2575 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_cmov() argument
2580 CHECK(check_sljit_emit_cmov(compiler, type, dst_reg, src, srcw)); in sljit_emit_cmov()
2582 return sljit_emit_cmov_generic(compiler, type, dst_reg, src, srcw);; in sljit_emit_cmov()
2599 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_mem(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_mem() argument
2606 CHECK(check_sljit_emit_mem(compiler, type, reg, mem, memw)); in sljit_emit_mem()
2609 return sljit_emit_mem_unaligned(compiler, type, reg, mem, memw); in sljit_emit_mem()
2619 FAIL_IF(push_inst(compiler, SLWI_W(memw) | S(OFFS_REG(mem)) | A(TMP_REG1))); in sljit_emit_mem()
2620 FAIL_IF(push_inst(compiler, ADD | D(TMP_REG1) | A(TMP_REG1) | B(mem & REG_MASK))); in sljit_emit_mem()
2622 FAIL_IF(push_inst(compiler, ADD | D(TMP_REG1) | A(mem & REG_MASK) | B(OFFS_REG(mem)))); in sljit_emit_mem()
2629 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_mem()
2630 FAIL_IF(sljit_emit_op2(compiler, SLJIT_ADD, TMP_REG1, 0, mem & REG_MASK, 0, SLJIT_IMM, memw)); in sljit_emit_mem()
2632 FAIL_IF(load_immediate(compiler, TMP_REG1, memw)); in sljit_emit_mem()
2637 …FAIL_IF(push_inst(compiler, ADDIS | D(TMP_REG1) | A(mem & REG_MASK) | IMM((memw + 0x8000) >> 16))); in sljit_emit_mem()
2654 FAIL_IF(push_inst(compiler, inst | D(REG_PAIR_SECOND(reg)) | A(mem) | IMM(memw + SSIZE_OF(sw)))); in sljit_emit_mem()
2655 return push_inst(compiler, inst | D(REG_PAIR_FIRST(reg)) | A(mem) | IMM(memw)); in sljit_emit_mem()
2658 FAIL_IF(push_inst(compiler, inst | D(REG_PAIR_FIRST(reg)) | A(mem) | IMM(memw))); in sljit_emit_mem()
2659 return push_inst(compiler, inst | D(REG_PAIR_SECOND(reg)) | A(mem) | IMM(memw + SSIZE_OF(sw))); in sljit_emit_mem()
2664 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_mem_update(struct sljit_compiler *compiler, sljit_s32… in sljit_emit_mem_update() argument
2672 CHECK(check_sljit_emit_mem_update(compiler, type, reg, mem, memw)); in sljit_emit_mem_update()
2736 …FAIL_IF(push_inst(compiler, INST_CODE_AND_DST(inst, 0, reg) | A(mem & REG_MASK) | B(OFFS_REG(mem))… in sljit_emit_mem_update()
2752 FAIL_IF(push_inst(compiler, INST_CODE_AND_DST(inst, 0, reg) | A(mem & REG_MASK) | IMM(memw))); in sljit_emit_mem_update()
2756 return push_inst(compiler, EXTSB | S(reg) | A(reg)); in sljit_emit_mem_update()
2760 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fmem_update(struct sljit_compiler *compiler, sljit_s3… in sljit_emit_fmem_update() argument
2768 CHECK(check_sljit_emit_fmem_update(compiler, type, freg, mem, memw)); in sljit_emit_fmem_update()
2792 …return push_inst(compiler, INST_CODE_AND_DST(inst, DOUBLE_DATA, freg) | A(mem & REG_MASK) | B(OFFS… in sljit_emit_fmem_update()
2796 …return push_inst(compiler, INST_CODE_AND_DST(inst, DOUBLE_DATA, freg) | A(mem & REG_MASK) | IMM(me… in sljit_emit_fmem_update()
2799 SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, slji… in sljit_emit_const() argument
2805 CHECK_PTR(check_sljit_emit_const(compiler, dst, dstw, init_value)); in sljit_emit_const()
2808 const_ = (struct sljit_const*)ensure_abuf(compiler, sizeof(struct sljit_const)); in sljit_emit_const()
2810 set_const(const_, compiler); in sljit_emit_const()
2813 PTR_FAIL_IF(emit_const(compiler, dst_r, init_value)); in sljit_emit_const()
2816 PTR_FAIL_IF(emit_op(compiler, SLJIT_MOV, WORD_DATA, dst, dstw, TMP_REG1, 0, TMP_REG2, 0)); in sljit_emit_const()
2821 …UTE struct sljit_put_label* sljit_emit_put_label(struct sljit_compiler *compiler, sljit_s32 dst, s… in sljit_emit_put_label() argument
2827 CHECK_PTR(check_sljit_emit_put_label(compiler, dst, dstw)); in sljit_emit_put_label()
2830 put_label = (struct sljit_put_label*)ensure_abuf(compiler, sizeof(struct sljit_put_label)); in sljit_emit_put_label()
2832 set_put_label(put_label, compiler, 0); in sljit_emit_put_label()
2836 PTR_FAIL_IF(emit_const(compiler, dst_r, 0)); in sljit_emit_put_label()
2838 PTR_FAIL_IF(push_inst(compiler, (sljit_ins)dst_r)); in sljit_emit_put_label()
2839 compiler->size += 4; in sljit_emit_put_label()
2843 PTR_FAIL_IF(emit_op(compiler, SLJIT_MOV, WORD_DATA, dst, dstw, TMP_REG1, 0, TMP_REG2, 0)); in sljit_emit_put_label()