Lines Matching refs:compiler

327 static sljit_s32 push_inst(struct sljit_compiler *compiler, sljit_ins ins, sljit_s32 delay_slot)  in push_inst()  argument
329 sljit_ins *ptr = (sljit_ins*)ensure_buf(compiler, sizeof(sljit_ins)); in push_inst()
335 compiler->size++; in push_inst()
336 compiler->delay_slot = delay_slot; in push_inst()
570 SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compiler) in sljit_generate_code() argument
588 CHECK_PTR(check_sljit_generate_code(compiler)); in sljit_generate_code()
589 reverse_buf(compiler); in sljit_generate_code()
591 …code = (sljit_ins*)SLJIT_MALLOC_EXEC(compiler->size * sizeof(sljit_ins), compiler->exec_allocator_… in sljit_generate_code()
593 buf = compiler->buf; in sljit_generate_code()
600 label = compiler->labels; in sljit_generate_code()
601 jump = compiler->jumps; in sljit_generate_code()
602 const_ = compiler->consts; in sljit_generate_code()
603 put_label = compiler->put_labels; in sljit_generate_code()
667 SLJIT_ASSERT(code_ptr - code <= (sljit_sw)compiler->size); in sljit_generate_code()
669 jump = compiler->jumps; in sljit_generate_code()
693 put_label = compiler->put_labels; in sljit_generate_code()
699 compiler->error = SLJIT_ERR_COMPILED; in sljit_generate_code()
700 compiler->executable_offset = executable_offset; in sljit_generate_code()
701 compiler->executable_size = (sljit_uw)(code_ptr - code) * sizeof(sljit_ins); in sljit_generate_code()
791 static sljit_s32 emit_op_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg_ar, sl…
792 static sljit_s32 emit_stack_frame_release(struct sljit_compiler *compiler, sljit_s32 frame_size, sl…
800 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compiler, in sljit_emit_enter() argument
810 …CHECK(check_sljit_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds,… in sljit_emit_enter()
811 set_emit_enter(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); in sljit_emit_enter()
826 compiler->local_size = local_size; in sljit_emit_enter()
846 compiler->args_size = (sljit_uw)arg_count << 2; in sljit_emit_enter()
853 …FAIL_IF(push_inst(compiler, ADDIU_W | S(SLJIT_SP) | T(SLJIT_SP) | IMM(-local_size), DR(SLJIT_SP))); in sljit_emit_enter()
857 FAIL_IF(load_immediate(compiler, OTHER_FLAG, local_size)); in sljit_emit_enter()
858 FAIL_IF(push_inst(compiler, ADDU_W | S(SLJIT_SP) | TA(0) | D(TMP_REG2), DR(TMP_REG2))); in sljit_emit_enter()
859 FAIL_IF(push_inst(compiler, SUBU_W | S(SLJIT_SP) | TA(OTHER_FLAG) | D(SLJIT_SP), DR(SLJIT_SP))); in sljit_emit_enter()
867 FAIL_IF(push_inst(compiler, STORE_W | base | TA(RETURN_ADDR_REG) | IMM(offset), UNMOVABLE_INS)); in sljit_emit_enter()
872 FAIL_IF(push_inst(compiler, STORE_W | base | T(i) | IMM(offset), MOVABLE_INS)); in sljit_emit_enter()
877 FAIL_IF(push_inst(compiler, STORE_W | base | T(i) | IMM(offset), MOVABLE_INS)); in sljit_emit_enter()
889 FAIL_IF(push_inst(compiler, SDC1 | base | FT(i) | IMM(offset), MOVABLE_INS)); in sljit_emit_enter()
894 FAIL_IF(push_inst(compiler, SDC1 | base | FT(i) | IMM(offset), MOVABLE_INS)); in sljit_emit_enter()
921 FAIL_IF(push_inst(compiler, MOV_S | FMT_D | FS(TMP_FREG1) | FD(SLJIT_FR0), MOVABLE_INS)); in sljit_emit_enter()
923 FAIL_IF(push_inst(compiler, MTC1 | TA(4 + arg_count) | FS(float_arg_count), MOVABLE_INS)); in sljit_emit_enter()
924 …FAIL_IF(push_inst(compiler, MTC1 | TA(5 + arg_count) | FS(float_arg_count) | (1 << 11), MOVABLE_IN… in sljit_emit_enter()
926 …FAIL_IF(push_inst(compiler, LDC1 | base | FT(float_arg_count) | IMM(local_size + (arg_count << 2))… in sljit_emit_enter()
934 FAIL_IF(push_inst(compiler, MOV_S | FMT_S | FS(TMP_FREG1) | FD(SLJIT_FR0), MOVABLE_INS)); in sljit_emit_enter()
936 FAIL_IF(push_inst(compiler, MTC1 | TA(4 + arg_count) | FS(float_arg_count), MOVABLE_INS)); in sljit_emit_enter()
938 …FAIL_IF(push_inst(compiler, LWC1 | base | FT(float_arg_count) | IMM(local_size + (arg_count << 2))… in sljit_emit_enter()
952 FAIL_IF(push_inst(compiler, ADDU_W | SA(4 + arg_count) | TA(0) | D(tmp), DR(tmp))); in sljit_emit_enter()
954 FAIL_IF(push_inst(compiler, LW | base | T(tmp) | IMM(local_size + (arg_count << 2)), DR(tmp))); in sljit_emit_enter()
961 SLJIT_ASSERT(compiler->args_size == (sljit_uw)arg_count << 2); in sljit_emit_enter()
969 FAIL_IF(push_inst(compiler, MOV_S | FMT_D | FS(arg_count) | FD(float_arg_count), MOVABLE_INS)); in sljit_emit_enter()
971 FAIL_IF(push_inst(compiler, MOV_S | FMT_D | FS(TMP_FREG1) | FD(SLJIT_FR0), MOVABLE_INS)); in sljit_emit_enter()
976 FAIL_IF(push_inst(compiler, MOV_S | FMT_S | FS(arg_count) | FD(float_arg_count), MOVABLE_INS)); in sljit_emit_enter()
978 FAIL_IF(push_inst(compiler, MOV_S | FMT_S | FS(TMP_FREG1) | FD(SLJIT_FR0), MOVABLE_INS)); in sljit_emit_enter()
991 FAIL_IF(push_inst(compiler, ADDU_W | SA(3 + arg_count) | TA(0) | D(tmp), DR(tmp))); in sljit_emit_enter()
1001 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *compiler, in sljit_set_context() argument
1006 …CHECK(check_sljit_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds… in sljit_set_context()
1007 set_set_context(compiler, options, arg_types, scratches, saveds, fscratches, fsaveds, local_size); in sljit_set_context()
1017 compiler->local_size = (local_size + SLJIT_LOCALS_OFFSET + 15) & ~0xf; in sljit_set_context()
1020 compiler->local_size = (local_size + SLJIT_LOCALS_OFFSET + 31) & ~0x1f; in sljit_set_context()
1025 static sljit_s32 emit_stack_frame_release(struct sljit_compiler *compiler, sljit_s32 frame_size, sl… in emit_stack_frame_release() argument
1029 sljit_s32 scratches = compiler->scratches; in emit_stack_frame_release()
1030 sljit_s32 saveds = compiler->saveds; in emit_stack_frame_release()
1031 sljit_s32 fsaveds = compiler->fsaveds; in emit_stack_frame_release()
1032 sljit_s32 fscratches = compiler->fscratches; in emit_stack_frame_release()
1033 sljit_s32 kept_saveds_count = SLJIT_KEPT_SAVEDS_COUNT(compiler->options); in emit_stack_frame_release()
1038 local_size = compiler->local_size; in emit_stack_frame_release()
1053 …FAIL_IF(push_inst(compiler, ADDIU_W | S(SLJIT_SP) | T(SLJIT_SP) | IMM(local_size - frame_size), DR… in emit_stack_frame_release()
1060 FAIL_IF(load_immediate(compiler, DR(TMP_REG1), local_size - tmp)); in emit_stack_frame_release()
1061 FAIL_IF(push_inst(compiler, ADDU_W | S(SLJIT_SP) | T(TMP_REG1) | D(SLJIT_SP), DR(SLJIT_SP))); in emit_stack_frame_release()
1069 …FAIL_IF(push_inst(compiler, LOAD_W | S(SLJIT_SP) | TA(RETURN_ADDR_REG) | IMM(offset), RETURN_ADDR_… in emit_stack_frame_release()
1074 FAIL_IF(push_inst(compiler, LOAD_W | S(SLJIT_SP) | T(i) | IMM(offset), MOVABLE_INS)); in emit_stack_frame_release()
1079 FAIL_IF(push_inst(compiler, LOAD_W | S(SLJIT_SP) | T(i) | IMM(offset), MOVABLE_INS)); in emit_stack_frame_release()
1091 FAIL_IF(push_inst(compiler, LDC1 | S(SLJIT_SP) | FT(i) | IMM(offset), MOVABLE_INS)); in emit_stack_frame_release()
1096 FAIL_IF(push_inst(compiler, LDC1 | S(SLJIT_SP) | FT(i) | IMM(offset), MOVABLE_INS)); in emit_stack_frame_release()
1107 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return_void(struct sljit_compiler *compiler) in sljit_emit_return_void() argument
1112 CHECK(check_sljit_emit_return_void(compiler)); in sljit_emit_return_void()
1114 emit_stack_frame_release(compiler, 0, &ins); in sljit_emit_return_void()
1116 FAIL_IF(push_inst(compiler, JR | SA(RETURN_ADDR_REG), UNMOVABLE_INS)); in sljit_emit_return_void()
1117 return push_inst(compiler, ins, UNMOVABLE_INS); in sljit_emit_return_void()
1120 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return_to(struct sljit_compiler *compiler, in sljit_emit_return_to() argument
1126 CHECK(check_sljit_emit_return_to(compiler, src, srcw)); in sljit_emit_return_to()
1130 FAIL_IF(emit_op_mem(compiler, WORD_DATA | LOAD_DATA, DR(PIC_ADDR_REG), src, srcw)); in sljit_emit_return_to()
1133 …} else if (src >= SLJIT_FIRST_SAVED_REG && src <= (SLJIT_S0 - SLJIT_KEPT_SAVEDS_COUNT(compiler->op… in sljit_emit_return_to()
1134 FAIL_IF(push_inst(compiler, ADDU_W | S(src) | TA(0) | D(PIC_ADDR_REG), DR(PIC_ADDR_REG))); in sljit_emit_return_to()
1139 FAIL_IF(emit_stack_frame_release(compiler, 1, &ins)); in sljit_emit_return_to()
1142 FAIL_IF(push_inst(compiler, JR | S(src), UNMOVABLE_INS)); in sljit_emit_return_to()
1143 return push_inst(compiler, ins, UNMOVABLE_INS); in sljit_emit_return_to()
1147 FAIL_IF(push_inst(compiler, ins, MOVABLE_INS)); in sljit_emit_return_to()
1149 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_return_to()
1150 return sljit_emit_ijump(compiler, SLJIT_JUMP, src, srcw); in sljit_emit_return_to()
1193 static sljit_s32 getput_arg_fast(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg_ar… in getput_arg_fast() argument
1201 FAIL_IF(push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(arg & REG_MASK) in getput_arg_fast()
1236 static sljit_s32 getput_arg(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg_ar, slj… in getput_arg() argument
1263 if (argw == compiler->cache_argw) { in getput_arg()
1264 if (arg == compiler->cache_arg) in getput_arg()
1265 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(TMP_REG3) | TA(reg_ar), delay… in getput_arg()
1267 if ((SLJIT_MEM | (arg & OFFS_REG_MASK)) == compiler->cache_arg) { in getput_arg()
1269 compiler->cache_arg = arg; in getput_arg()
1270 compiler->cache_argw = argw; in getput_arg()
1271 FAIL_IF(push_inst(compiler, ADDU_W | S(base) | T(TMP_REG3) | D(TMP_REG3), DR(TMP_REG3))); in getput_arg()
1272 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(TMP_REG3) | TA(reg_ar), delay… in getput_arg()
1274 FAIL_IF(push_inst(compiler, ADDU_W | S(base) | T(TMP_REG3) | DA(tmp_ar), tmp_ar)); in getput_arg()
1275 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | SA(tmp_ar) | TA(reg_ar), delay_… in getput_arg()
1280 compiler->cache_arg = SLJIT_MEM | (arg & OFFS_REG_MASK); in getput_arg()
1281 compiler->cache_argw = argw; in getput_arg()
1282 … FAIL_IF(push_inst(compiler, SLL_W | T(OFFS_REG(arg)) | D(TMP_REG3) | SH_IMM(argw), DR(TMP_REG3))); in getput_arg()
1286 compiler->cache_arg = arg; in getput_arg()
1287 compiler->cache_argw = argw; in getput_arg()
1288 …FAIL_IF(push_inst(compiler, ADDU_W | S(base) | T(!argw ? OFFS_REG(arg) : TMP_REG3) | D(TMP_REG3), … in getput_arg()
1292 …FAIL_IF(push_inst(compiler, ADDU_W | S(base) | T(!argw ? OFFS_REG(arg) : TMP_REG3) | DA(tmp_ar), t… in getput_arg()
1293 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | SA(tmp_ar) | TA(reg_ar), delay_… in getput_arg()
1296 …if (compiler->cache_arg == arg && argw - compiler->cache_argw <= SIMM_MAX && argw - compiler->cach… in getput_arg()
1297 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(TMP_REG3) | TA(reg_ar) | IMM(… in getput_arg()
1299 …if (compiler->cache_arg == SLJIT_MEM && (argw - compiler->cache_argw) <= SIMM_MAX && (argw - compi… in getput_arg()
1300 offset = argw - compiler->cache_argw; in getput_arg()
1302 compiler->cache_arg = SLJIT_MEM; in getput_arg()
1307 FAIL_IF(load_immediate(compiler, DR(TMP_REG3), argw)); in getput_arg()
1308 compiler->cache_argw = argw; in getput_arg()
1311 FAIL_IF(load_immediate(compiler, DR(TMP_REG3), argw_hi)); in getput_arg()
1312 compiler->cache_argw = argw_hi; in getput_arg()
1319 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(TMP_REG3) | TA(reg_ar) | IMM(… in getput_arg()
1322 compiler->cache_arg = arg; in getput_arg()
1323 FAIL_IF(push_inst(compiler, ADDU_W | S(TMP_REG3) | T(base) | D(TMP_REG3), DR(TMP_REG3))); in getput_arg()
1324 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(TMP_REG3) | TA(reg_ar) | IMM(… in getput_arg()
1327 FAIL_IF(push_inst(compiler, ADDU_W | S(TMP_REG3) | T(base) | DA(tmp_ar), tmp_ar)); in getput_arg()
1328 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | SA(tmp_ar) | TA(reg_ar) | IMM(o… in getput_arg()
1331 static sljit_s32 emit_op_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg_ar, sl… in emit_op_mem() argument
1335 if (getput_arg_fast(compiler, flags, reg_ar, arg, argw)) in emit_op_mem()
1336 return compiler->error; in emit_op_mem()
1352 FAIL_IF(push_inst(compiler, SLL_W | T(OFFS_REG(arg)) | DA(tmp_ar) | SH_IMM(argw), tmp_ar)); in emit_op_mem()
1353 FAIL_IF(push_inst(compiler, ADDU_W | SA(tmp_ar) | T(base) | DA(tmp_ar), tmp_ar)); in emit_op_mem()
1356 FAIL_IF(push_inst(compiler, ADDU_W | S(base) | T(OFFS_REG(arg)) | DA(tmp_ar), tmp_ar)); in emit_op_mem()
1357 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | SA(tmp_ar) | TA(reg_ar), delay_… in emit_op_mem()
1360 FAIL_IF(load_immediate(compiler, tmp_ar, TO_ARGW_HI(argw))); in emit_op_mem()
1363 FAIL_IF(push_inst(compiler, ADDU_W | SA(tmp_ar) | T(base) | DA(tmp_ar), tmp_ar)); in emit_op_mem()
1365 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | SA(tmp_ar) | TA(reg_ar) | IMM(a… in emit_op_mem()
1368 static SLJIT_INLINE sljit_s32 emit_op_mem2(struct sljit_compiler *compiler, sljit_s32 flags, sljit_… in emit_op_mem2() argument
1370 if (getput_arg_fast(compiler, flags, reg, arg1, arg1w)) in emit_op_mem2()
1371 return compiler->error; in emit_op_mem2()
1372 return getput_arg(compiler, flags, reg, arg1, arg1w, arg2, arg2w); in emit_op_mem2()
1378 FAIL_IF(push_inst(compiler, op_imm | S(src1) | TA(EQUAL_FLAG) | IMM(src2), EQUAL_FLAG)); \
1380 FAIL_IF(push_inst(compiler, op_imm | S(src1) | T(dst) | IMM(src2), DR(dst))); \
1384 FAIL_IF(push_inst(compiler, op_reg | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG)); \
1386 FAIL_IF(push_inst(compiler, op_reg | S(src1) | T(src2) | D(dst), DR(dst))); \
1413 static sljit_s32 emit_clz_ctz(struct sljit_compiler *compiler, sljit_s32 op, sljit_s32 dst, sljit_s… in emit_clz_ctz() argument
1424 FAIL_IF(push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(src) | TA(0) | D(TMP_REG2), DR(TMP_REG2))); in emit_clz_ctz()
1426 FAIL_IF(push_inst(compiler, BEQ | S(TMP_REG2) | TA(0) | IMM(is_clz ? 13 : 14), UNMOVABLE_INS)); in emit_clz_ctz()
1428 …FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | SA(0) | TA(OTHER_FLAG) | IMM(max), OTHER_FL… in emit_clz_ctz()
1431 FAIL_IF(push_inst(compiler, ANDI | S(TMP_REG2) | T(TMP_REG1) | IMM(1), DR(TMP_REG1))); in emit_clz_ctz()
1432 FAIL_IF(push_inst(compiler, BNE | S(TMP_REG1) | TA(0) | IMM(11), UNMOVABLE_INS)); in emit_clz_ctz()
1434 FAIL_IF(push_inst(compiler, BLTZ | S(TMP_REG2) | TA(0) | IMM(11), UNMOVABLE_INS)); in emit_clz_ctz()
1437 …FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | SA(0) | TA(OTHER_FLAG) | IMM(0), OTHER_FLAG… in emit_clz_ctz()
1440 …FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | SA(0) | T(TMP_REG1) | IMM(max), DR(TMP_REG1… in emit_clz_ctz()
1442 …FAIL_IF(push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(TMP_REG2) | TA(0) | DA(EQUAL_FLAG), EQUAL_F… in emit_clz_ctz()
1443 …FAIL_IF(push_inst(compiler, SELECT_OP(DSRL, SRL) | T(TMP_REG1) | D(TMP_REG1) | SH_IMM(1), DR(TMP_R… in emit_clz_ctz()
1445 …FAIL_IF(push_inst(compiler, (is_clz ? SELECT_OP(DSRLV, SRLV) : SELECT_OP(DSLLV, SLLV)) | S(TMP_REG… in emit_clz_ctz()
1446 FAIL_IF(push_inst(compiler, BNE | S(TMP_REG2) | TA(0) | IMM(-4), UNMOVABLE_INS)); in emit_clz_ctz()
1448 FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); in emit_clz_ctz()
1450 …FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(TMP_REG1) | T(TMP_REG2) | IMM(-1), DR(TMP… in emit_clz_ctz()
1451 …FAIL_IF(push_inst(compiler, (is_clz ? SELECT_OP(DSRLV, SRLV) : SELECT_OP(DSLLV, SLLV)) | S(TMP_REG… in emit_clz_ctz()
1453 FAIL_IF(push_inst(compiler, BEQ | S(TMP_REG2) | TA(0) | IMM(-7), UNMOVABLE_INS)); in emit_clz_ctz()
1455 FAIL_IF(push_inst(compiler, OR | SA(OTHER_FLAG) | T(TMP_REG1) | DA(OTHER_FLAG), OTHER_FLAG)); in emit_clz_ctz()
1457 return push_inst(compiler, SELECT_OP(DADDU, ADDU) | SA(OTHER_FLAG) | TA(0) | D(dst), DR(dst)); in emit_clz_ctz()
1462 static SLJIT_INLINE sljit_s32 emit_single_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_s… in emit_single_op() argument
1475 return push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(src2) | TA(0) | D(dst), DR(dst)); in emit_single_op()
1481 return push_inst(compiler, ANDI | S(src2) | T(dst) | IMM(0xff), DR(dst)); in emit_single_op()
1490 return push_inst(compiler, SEB | T(src2) | D(dst), DR(dst)); in emit_single_op()
1492 FAIL_IF(push_inst(compiler, SLL | T(src2) | D(dst) | SH_IMM(24), DR(dst))); in emit_single_op()
1493 return push_inst(compiler, SRA | T(dst) | D(dst) | SH_IMM(24), DR(dst)); in emit_single_op()
1498 return push_inst(compiler, SEB | T(src2) | D(dst), DR(dst)); in emit_single_op()
1500 FAIL_IF(push_inst(compiler, DSLL32 | T(src2) | D(dst) | SH_IMM(24), DR(dst))); in emit_single_op()
1501 return push_inst(compiler, DSRA32 | T(dst) | D(dst) | SH_IMM(24), DR(dst)); in emit_single_op()
1510 return push_inst(compiler, ANDI | S(src2) | T(dst) | IMM(0xffff), DR(dst)); in emit_single_op()
1519 return push_inst(compiler, SEH | T(src2) | D(dst), DR(dst)); in emit_single_op()
1521 FAIL_IF(push_inst(compiler, SLL | T(src2) | D(dst) | SH_IMM(16), DR(dst))); in emit_single_op()
1522 return push_inst(compiler, SRA | T(dst) | D(dst) | SH_IMM(16), DR(dst)); in emit_single_op()
1527 return push_inst(compiler, SEH | T(src2) | D(dst), DR(dst)); in emit_single_op()
1529 FAIL_IF(push_inst(compiler, DSLL32 | T(src2) | D(dst) | SH_IMM(16), DR(dst))); in emit_single_op()
1530 return push_inst(compiler, DSRA32 | T(dst) | D(dst) | SH_IMM(16), DR(dst)); in emit_single_op()
1542 return push_inst(compiler, DINSU | T(src2) | SA(0) | (31 << 11) | (0 << 11), DR(dst)); in emit_single_op()
1544 FAIL_IF(push_inst(compiler, DSLL32 | T(src2) | D(dst) | SH_IMM(0), DR(dst))); in emit_single_op()
1545 return push_inst(compiler, DSRL32 | T(dst) | D(dst) | SH_IMM(0), DR(dst)); in emit_single_op()
1553 return push_inst(compiler, SLL | T(src2) | D(dst) | SH_IMM(0), DR(dst)); in emit_single_op()
1562 FAIL_IF(push_inst(compiler, NOR | S(src2) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG)); in emit_single_op()
1564 FAIL_IF(push_inst(compiler, NOR | S(src2) | T(src2) | D(dst), DR(dst))); in emit_single_op()
1571 return push_inst(compiler, SELECT_OP(DCLZ, CLZ) | S(src2) | D(dst), DR(dst)); in emit_single_op()
1573 return push_inst(compiler, SELECT_OP(DCLZ, CLZ) | S(src2) | T(dst) | D(dst), DR(dst)); in emit_single_op()
1577 …FAIL_IF(push_inst(compiler, SELECT_OP(DSUBU, SUBU) | SA(0) | T(src2) | D(TMP_REG1), DR(TMP_REG1))); in emit_single_op()
1578 FAIL_IF(push_inst(compiler, AND | S(src2) | T(TMP_REG1) | D(dst), DR(dst))); in emit_single_op()
1580 FAIL_IF(push_inst(compiler, SELECT_OP(DCLZ, CLZ) | S(dst) | D(dst), DR(dst))); in emit_single_op()
1582 FAIL_IF(push_inst(compiler, SELECT_OP(DCLZ, CLZ) | S(dst) | T(dst) | D(dst), DR(dst))); in emit_single_op()
1584 …FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(dst) | T(TMP_REG1) | IMM(SELECT_OP(-64, -… in emit_single_op()
1585 …FAIL_IF(push_inst(compiler, SELECT_OP(DSRL32, SRL) | T(TMP_REG1) | D(TMP_REG1) | SH_IMM(SELECT_OP(… in emit_single_op()
1586 return push_inst(compiler, XOR | S(dst) | T(TMP_REG1) | D(dst), DR(dst)); in emit_single_op()
1591 return emit_clz_ctz(compiler, op, dst, src2); in emit_single_op()
1602 FAIL_IF(push_inst(compiler, OR | S(src1) | T(src1) | DA(EQUAL_FLAG), EQUAL_FLAG)); in emit_single_op()
1604 FAIL_IF(push_inst(compiler, NOR | S(src1) | T(src1) | DA(EQUAL_FLAG), EQUAL_FLAG)); in emit_single_op()
1607 …FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(src1) | TA(EQUAL_FLAG) | IMM(src2), EQUAL… in emit_single_op()
1611 FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(src1) | T(dst) | IMM(src2), DR(dst))); in emit_single_op()
1615 FAIL_IF(push_inst(compiler, XOR | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG)); in emit_single_op()
1617 …FAIL_IF(push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLA… in emit_single_op()
1625 …FAIL_IF(push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(src1) | TA(0) | DA(OTHER_FLAG), OTHER_FLAG)… in emit_single_op()
1632 FAIL_IF(push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(src1) | T(src2) | D(dst), DR(dst))); in emit_single_op()
1638 FAIL_IF(push_inst(compiler, SLTIU | S(dst) | TA(OTHER_FLAG) | IMM(src2), OTHER_FLAG)); in emit_single_op()
1640 FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(carry_src_ar) | DA(OTHER_FLAG), OTHER_FLAG)); in emit_single_op()
1646 FAIL_IF(push_inst(compiler, XOR | S(dst) | TA(EQUAL_FLAG) | D(TMP_REG1), DR(TMP_REG1))); in emit_single_op()
1648 …FAIL_IF(push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(dst) | TA(0) | DA(EQUAL_FLAG), EQUAL_FLAG)); in emit_single_op()
1649 …FAIL_IF(push_inst(compiler, SELECT_OP(DSRL32, SRL) | T(TMP_REG1) | D(TMP_REG1) | SH_IMM(31), DR(TM… in emit_single_op()
1650 return push_inst(compiler, XOR | S(TMP_REG1) | TA(OTHER_FLAG) | DA(OTHER_FLAG), OTHER_FLAG); in emit_single_op()
1656 FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(src1) | T(dst) | IMM(src2), DR(dst))); in emit_single_op()
1664 …FAIL_IF(push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(src1) | TA(0) | DA(EQUAL_FLAG), EQUAL_FLAG)… in emit_single_op()
1669 FAIL_IF(push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(src1) | T(src2) | D(dst), DR(dst))); in emit_single_op()
1675 FAIL_IF(push_inst(compiler, SLTIU | S(dst) | TA(EQUAL_FLAG) | IMM(src2), EQUAL_FLAG)); in emit_single_op()
1677 FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(carry_src_ar) | DA(EQUAL_FLAG), EQUAL_FLAG)); in emit_single_op()
1680 FAIL_IF(push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(dst) | TA(OTHER_FLAG) | D(dst), DR(dst))); in emit_single_op()
1686 FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(OTHER_FLAG) | DA(OTHER_FLAG), OTHER_FLAG)); in emit_single_op()
1688 return push_inst(compiler, OR | SA(OTHER_FLAG) | TA(EQUAL_FLAG) | DA(OTHER_FLAG), OTHER_FLAG); in emit_single_op()
1692 FAIL_IF(push_inst(compiler, ADDIU | SA(0) | T(TMP_REG2) | IMM(src2), DR(TMP_REG2))); in emit_single_op()
1701 FAIL_IF(push_inst(compiler, SLTIU | S(src1) | TA(OTHER_FLAG) | IMM(src2), OTHER_FLAG)); in emit_single_op()
1705 FAIL_IF(push_inst(compiler, SLTI | S(src1) | TA(OTHER_FLAG) | IMM(src2), OTHER_FLAG)); in emit_single_op()
1714 FAIL_IF(push_inst(compiler, ADDIU | SA(0) | T(TMP_REG2) | IMM(src2), DR(TMP_REG2))); in emit_single_op()
1722 FAIL_IF(push_inst(compiler, SLTU | S(src1) | T(src2) | DA(OTHER_FLAG), OTHER_FLAG)); in emit_single_op()
1726 FAIL_IF(push_inst(compiler, SLTU | S(src2) | T(src1) | DA(OTHER_FLAG), OTHER_FLAG)); in emit_single_op()
1730 FAIL_IF(push_inst(compiler, SLT | S(src1) | T(src2) | DA(OTHER_FLAG), OTHER_FLAG)); in emit_single_op()
1734 FAIL_IF(push_inst(compiler, SLT | S(src2) | T(src1) | DA(OTHER_FLAG), OTHER_FLAG)); in emit_single_op()
1742 …FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(src1) | TA(EQUAL_FLAG) | IMM(-src2), EQUA… in emit_single_op()
1744 return push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(src1) | T(dst) | IMM(-src2), DR(dst)); in emit_single_op()
1748 …FAIL_IF(push_inst(compiler, SELECT_OP(DSUBU, SUBU) | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLA… in emit_single_op()
1750 return push_inst(compiler, SELECT_OP(DSUBU, SUBU) | S(src1) | T(src2) | D(dst), DR(dst)); in emit_single_op()
1761 FAIL_IF(push_inst(compiler, OR | S(src1) | T(src1) | DA(EQUAL_FLAG), EQUAL_FLAG)); in emit_single_op()
1763 FAIL_IF(push_inst(compiler, NOR | S(src1) | T(src1) | DA(EQUAL_FLAG), EQUAL_FLAG)); in emit_single_op()
1766 …FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(src1) | TA(EQUAL_FLAG) | IMM(-src2), EQUA… in emit_single_op()
1769 FAIL_IF(push_inst(compiler, SLTIU | S(src1) | TA(OTHER_FLAG) | IMM(src2), OTHER_FLAG)); in emit_single_op()
1773 FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(src1) | T(dst) | IMM(-src2), DR(dst))); in emit_single_op()
1777 FAIL_IF(push_inst(compiler, XOR | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG)); in emit_single_op()
1779 …FAIL_IF(push_inst(compiler, SELECT_OP(DSUBU, SUBU) | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLA… in emit_single_op()
1782 FAIL_IF(push_inst(compiler, SLTU | S(src1) | T(src2) | DA(OTHER_FLAG), OTHER_FLAG)); in emit_single_op()
1786 FAIL_IF(push_inst(compiler, SELECT_OP(DSUBU, SUBU) | S(src1) | T(src2) | D(dst), DR(dst))); in emit_single_op()
1792 FAIL_IF(push_inst(compiler, XOR | S(dst) | TA(EQUAL_FLAG) | D(TMP_REG1), DR(TMP_REG1))); in emit_single_op()
1794 …FAIL_IF(push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(dst) | TA(0) | DA(EQUAL_FLAG), EQUAL_FLAG)); in emit_single_op()
1795 …FAIL_IF(push_inst(compiler, SELECT_OP(DSRL32, SRL) | T(TMP_REG1) | D(TMP_REG1) | SH_IMM(31), DR(TM… in emit_single_op()
1796 return push_inst(compiler, XOR | S(TMP_REG1) | TA(OTHER_FLAG) | DA(OTHER_FLAG), OTHER_FLAG); in emit_single_op()
1800 FAIL_IF(push_inst(compiler, ADDIU | SA(0) | T(TMP_REG2) | IMM(src2), DR(TMP_REG2))); in emit_single_op()
1809 FAIL_IF(push_inst(compiler, SLTIU | S(src1) | TA(EQUAL_FLAG) | IMM(src2), EQUAL_FLAG)); in emit_single_op()
1811 FAIL_IF(push_inst(compiler, SELECT_OP(DADDIU, ADDIU) | S(src1) | T(dst) | IMM(-src2), DR(dst))); in emit_single_op()
1815 FAIL_IF(push_inst(compiler, SLTU | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG)); in emit_single_op()
1817 FAIL_IF(push_inst(compiler, SELECT_OP(DSUBU, SUBU) | S(src1) | T(src2) | D(dst), DR(dst))); in emit_single_op()
1821 FAIL_IF(push_inst(compiler, SLTU | S(dst) | TA(OTHER_FLAG) | D(TMP_REG1), DR(TMP_REG1))); in emit_single_op()
1823 FAIL_IF(push_inst(compiler, SELECT_OP(DSUBU, SUBU) | S(dst) | TA(OTHER_FLAG) | D(dst), DR(dst))); in emit_single_op()
1828 return push_inst(compiler, OR | SA(EQUAL_FLAG) | T(TMP_REG1) | DA(OTHER_FLAG), OTHER_FLAG); in emit_single_op()
1835 return push_inst(compiler, SELECT_OP(DMUL, MUL) | S(src1) | T(src2) | D(dst), DR(dst)); in emit_single_op()
1838 return push_inst(compiler, MUL | S(src1) | T(src2) | D(dst), DR(dst)); in emit_single_op()
1841 return push_inst(compiler, MUL | S(src1) | T(src2) | D(dst), DR(dst)); in emit_single_op()
1842 FAIL_IF(push_inst(compiler, DMULT | S(src1) | T(src2), MOVABLE_INS)); in emit_single_op()
1843 return push_inst(compiler, MFLO | D(dst), DR(dst)); in emit_single_op()
1846 FAIL_IF(push_inst(compiler, SELECT_OP(DMULT, MULT) | S(src1) | T(src2), MOVABLE_INS)); in emit_single_op()
1847 return push_inst(compiler, MFLO | D(dst), DR(dst)); in emit_single_op()
1852 FAIL_IF(push_inst(compiler, SELECT_OP(DMUL, MUL) | S(src1) | T(src2) | D(dst), DR(dst))); in emit_single_op()
1853 …FAIL_IF(push_inst(compiler, SELECT_OP(DMUH, MUH) | S(src1) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG)… in emit_single_op()
1855 FAIL_IF(push_inst(compiler, SELECT_OP(DMULT, MULT) | S(src1) | T(src2), MOVABLE_INS)); in emit_single_op()
1856 FAIL_IF(push_inst(compiler, MFHI | DA(EQUAL_FLAG), EQUAL_FLAG)); in emit_single_op()
1857 FAIL_IF(push_inst(compiler, MFLO | D(dst), DR(dst))); in emit_single_op()
1859 …FAIL_IF(push_inst(compiler, SELECT_OP(DSRA32, SRA) | T(dst) | DA(OTHER_FLAG) | SH_IMM(31), OTHER_F… in emit_single_op()
1860 …return push_inst(compiler, SELECT_OP(DSUBU, SUBU) | SA(EQUAL_FLAG) | TA(OTHER_FLAG) | DA(OTHER_FLA… in emit_single_op()
1898 …FAIL_IF(push_inst(compiler, SELECT_OP(DSUBU, SUBU) | SA(0) | T(src2) | D(TMP_REG2), DR(TMP_REG2))); in emit_single_op()
1918 …FAIL_IF(push_inst(compiler, op_imm | T(src1) | DA(OTHER_FLAG) | (((sljit_ins)src2 & 0x1f) << 6), O… in emit_single_op()
1926 …FAIL_IF(push_inst(compiler, op_imm | T(src1) | D(dst) | (((sljit_ins)src2 & 0x1f) << 6), DR(dst))); in emit_single_op()
1927 return push_inst(compiler, OR | S(dst) | TA(OTHER_FLAG) | D(dst), DR(dst)); in emit_single_op()
1932 …FAIL_IF(push_inst(compiler, op_imm | T(src1) | DA(OTHER_FLAG) | ((sljit_ins)src2 << 6), OTHER_FLAG… in emit_single_op()
1936 …FAIL_IF(push_inst(compiler, op_imm | T(src1) | D(dst) | (((sljit_ins)src2 & 0x1f) << 6), DR(dst))); in emit_single_op()
1937 return push_inst(compiler, OR | S(dst) | TA(OTHER_FLAG) | D(dst), DR(dst)); in emit_single_op()
1942 return push_inst(compiler, SELECT_OP(DADDU, ADDU) | S(src1) | TA(0) | D(dst), DR(dst)); in emit_single_op()
1946 …FAIL_IF(push_inst(compiler, SELECT_OP(DSUBU, SUBU) | SA(0) | T(src2) | DA(EQUAL_FLAG), EQUAL_FLAG)… in emit_single_op()
1951 FAIL_IF(push_inst(compiler, op_v | S(src2) | T(src1) | DA(OTHER_FLAG), OTHER_FLAG)); in emit_single_op()
1953 FAIL_IF(push_inst(compiler, op_v | SA(EQUAL_FLAG) | T(src1) | D(dst), DR(dst))); in emit_single_op()
1954 return push_inst(compiler, OR | S(dst) | TA(OTHER_FLAG) | D(dst), DR(dst)); in emit_single_op()
1959 FAIL_IF(push_inst(compiler, op_v | S(src2) | T(src1) | DA(OTHER_FLAG), OTHER_FLAG)); in emit_single_op()
1961 FAIL_IF(push_inst(compiler, op_v | SA(EQUAL_FLAG) | T(src1) | D(dst), DR(dst))); in emit_single_op()
1962 return push_inst(compiler, OR | S(dst) | TA(OTHER_FLAG) | D(dst), DR(dst)); in emit_single_op()
1973 FAIL_IF(push_inst(compiler, op_imm | T(src1) | DA(EQUAL_FLAG) | SH_IMM(src2), EQUAL_FLAG)); in emit_single_op()
1977 return push_inst(compiler, op_imm | T(src1) | D(dst) | SH_IMM(src2), DR(dst)); in emit_single_op()
1981 FAIL_IF(push_inst(compiler, op_v | S(src2) | T(src1) | DA(EQUAL_FLAG), EQUAL_FLAG)); in emit_single_op()
1985 return push_inst(compiler, op_v | S(src2) | T(src1) | D(dst), DR(dst)); in emit_single_op()
1997 FAIL_IF(push_inst(compiler, ins | T(src1) | DA(EQUAL_FLAG) | SH_IMM(src2), EQUAL_FLAG)); in emit_single_op()
2001 return push_inst(compiler, ins | T(src1) | D(dst) | SH_IMM(src2), DR(dst)); in emit_single_op()
2006 FAIL_IF(push_inst(compiler, ins | S(src2) | T(src1) | DA(EQUAL_FLAG), EQUAL_FLAG)); in emit_single_op()
2010 return push_inst(compiler, ins | S(src2) | T(src1) | D(dst), DR(dst)); in emit_single_op()
2018 static sljit_s32 emit_op(struct sljit_compiler *compiler, sljit_s32 op, sljit_s32 flags, in emit_op() argument
2033 compiler->cache_arg = 0; in emit_op()
2034 compiler->cache_argw = 0; in emit_op()
2047 …else if ((dst & SLJIT_MEM) && !getput_arg_fast(compiler, flags | ARG_TEST, DR(TMP_REG1), dst, dstw… in emit_op()
2073 FAIL_IF(load_immediate(compiler, DR(TMP_REG1), src1w)); in emit_op()
2080 if (getput_arg_fast(compiler, flags | LOAD_DATA, DR(TMP_REG1), src1, src1w)) in emit_op()
2081 FAIL_IF(compiler->error); in emit_op()
2097 FAIL_IF(load_immediate(compiler, DR(sugg_src2_r), src2w)); in emit_op()
2112 if (getput_arg_fast(compiler, flags | LOAD_DATA, DR(sugg_src2_r), src2, src2w)) in emit_op()
2113 FAIL_IF(compiler->error); in emit_op()
2122 FAIL_IF(getput_arg(compiler, flags | LOAD_DATA, DR(TMP_REG2), src2, src2w, src1, src1w)); in emit_op()
2123 FAIL_IF(getput_arg(compiler, flags | LOAD_DATA, DR(TMP_REG1), src1, src1w, dst, dstw)); in emit_op()
2126 FAIL_IF(getput_arg(compiler, flags | LOAD_DATA, DR(TMP_REG1), src1, src1w, src2, src2w)); in emit_op()
2127 FAIL_IF(getput_arg(compiler, flags | LOAD_DATA, DR(TMP_REG2), src2, src2w, dst, dstw)); in emit_op()
2131 FAIL_IF(getput_arg(compiler, flags | LOAD_DATA, DR(TMP_REG1), src1, src1w, dst, dstw)); in emit_op()
2133 FAIL_IF(getput_arg(compiler, flags | LOAD_DATA, DR(sugg_src2_r), src2, src2w, dst, dstw)); in emit_op()
2135 FAIL_IF(emit_single_op(compiler, op, flags, dst_r, src1_r, src2_r)); in emit_op()
2139 getput_arg_fast(compiler, flags, DR(dst_r), dst, dstw); in emit_op()
2140 return compiler->error; in emit_op()
2142 return getput_arg(compiler, flags, DR(dst_r), dst, dstw, 0, 0); in emit_op()
2150 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op0(struct sljit_compiler *compiler, sljit_s32 op) in sljit_emit_op0() argument
2157 CHECK(check_sljit_emit_op0(compiler, op)); in sljit_emit_op0()
2162 return push_inst(compiler, BREAK, UNMOVABLE_INS); in sljit_emit_op0()
2164 return push_inst(compiler, NOP, UNMOVABLE_INS); in sljit_emit_op0()
2169 …FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? DMULU : DMUL) | S(SLJIT_R0) | T(SLJIT_R1) | D(T… in sljit_emit_op0()
2170 …FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? DMUHU : DMUH) | S(SLJIT_R0) | T(SLJIT_R1) | D(T… in sljit_emit_op0()
2172 …FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? MULU : MUL) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP… in sljit_emit_op0()
2173 …FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? MUHU : MUH) | S(SLJIT_R0) | T(SLJIT_R1) | D(TMP… in sljit_emit_op0()
2175 FAIL_IF(push_inst(compiler, ADDU_W | S(TMP_REG3) | TA(0) | D(SLJIT_R0), DR(SLJIT_R0))); in sljit_emit_op0()
2176 return push_inst(compiler, ADDU_W | S(TMP_REG1) | TA(0) | D(SLJIT_R1), DR(SLJIT_R1)); in sljit_emit_op0()
2179 …FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? DMULTU : DMULT) | S(SLJIT_R0) | T(SLJIT_R1), MO… in sljit_emit_op0()
2181 …FAIL_IF(push_inst(compiler, (op == SLJIT_LMUL_UW ? MULTU : MULT) | S(SLJIT_R0) | T(SLJIT_R1), MOVA… in sljit_emit_op0()
2183 FAIL_IF(push_inst(compiler, MFLO | D(SLJIT_R0), DR(SLJIT_R0))); in sljit_emit_op0()
2184 return push_inst(compiler, MFHI | D(SLJIT_R1), DR(SLJIT_R1)); in sljit_emit_op0()
2194 …FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DIVU : DIV) | S(SLJIT_R0) | T(SLJIT_R1) … in sljit_emit_op0()
2195 …FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? MODU : MOD) | S(SLJIT_R0) | T(SLJIT_R1) … in sljit_emit_op0()
2198 …FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DDIVU : DDIV) | S(SLJIT_R0) | T(SLJIT_R1… in sljit_emit_op0()
2199 …FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DMODU : DMOD) | S(SLJIT_R0) | T(SLJIT_R1… in sljit_emit_op0()
2202 …FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DIVU : DIV) | S(SLJIT_R0) | T(SLJIT_R1) … in sljit_emit_op0()
2203 …FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? MODU : MOD) | S(SLJIT_R0) | T(SLJIT_R1) … in sljit_emit_op0()
2205 FAIL_IF(push_inst(compiler, ADDU_W | S(TMP_REG3) | TA(0) | D(SLJIT_R0), DR(SLJIT_R0))); in sljit_emit_op0()
2206 …return (op >= SLJIT_DIV_UW) ? SLJIT_SUCCESS : push_inst(compiler, ADDU_W | S(TMP_REG1) | TA(0) | D… in sljit_emit_op0()
2209 FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); in sljit_emit_op0()
2210 FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); in sljit_emit_op0()
2214 …FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DIVU : DIV) | S(SLJIT_R0) | T(SLJIT_R1),… in sljit_emit_op0()
2216 …FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DDIVU : DDIV) | S(SLJIT_R0) | T(SLJIT_R1… in sljit_emit_op0()
2218 …FAIL_IF(push_inst(compiler, ((op | 0x2) == SLJIT_DIV_UW ? DIVU : DIV) | S(SLJIT_R0) | T(SLJIT_R1),… in sljit_emit_op0()
2220 FAIL_IF(push_inst(compiler, MFLO | D(SLJIT_R0), DR(SLJIT_R0))); in sljit_emit_op0()
2221 …return (op >= SLJIT_DIV_UW) ? SLJIT_SUCCESS : push_inst(compiler, MFHI | D(SLJIT_R1), DR(SLJIT_R1)… in sljit_emit_op0()
2232 static sljit_s32 emit_prefetch(struct sljit_compiler *compiler, in emit_prefetch() argument
2237 return push_inst(compiler, PREF | S(src & REG_MASK) | IMM(srcw), MOVABLE_INS); in emit_prefetch()
2239 FAIL_IF(load_immediate(compiler, DR(TMP_REG1), srcw)); in emit_prefetch()
2240 return push_inst(compiler, PREFX | S(src & REG_MASK) | T(TMP_REG1), MOVABLE_INS); in emit_prefetch()
2246 FAIL_IF(push_inst(compiler, SLL_W | T(OFFS_REG(src)) | D(TMP_REG1) | SH_IMM(srcw), DR(TMP_REG1))); in emit_prefetch()
2247 return push_inst(compiler, PREFX | S(src & REG_MASK) | T(TMP_REG1), MOVABLE_INS); in emit_prefetch()
2250 return push_inst(compiler, PREFX | S(src & REG_MASK) | T(OFFS_REG(src)), MOVABLE_INS); in emit_prefetch()
2254 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op1(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op1() argument
2261 CHECK(check_sljit_emit_op1(compiler, op, dst, dstw, src, srcw)); in sljit_emit_op1()
2278 return emit_op(compiler, SLJIT_MOV, WORD_DATA | MOVE_OP, dst, dstw, TMP_REG1, 0, src, srcw); in sljit_emit_op1()
2282 …return emit_op(compiler, SLJIT_MOV_U32, INT_DATA | MOVE_OP, dst, dstw, TMP_REG1, 0, src, (src & SL… in sljit_emit_op1()
2286 …return emit_op(compiler, SLJIT_MOV_S32, INT_DATA | SIGNED_DATA | MOVE_OP, dst, dstw, TMP_REG1, 0, … in sljit_emit_op1()
2290 …return emit_op(compiler, op, BYTE_DATA | MOVE_OP, dst, dstw, TMP_REG1, 0, src, (src & SLJIT_IMM) ?… in sljit_emit_op1()
2293 …return emit_op(compiler, op, BYTE_DATA | SIGNED_DATA | MOVE_OP, dst, dstw, TMP_REG1, 0, src, (src … in sljit_emit_op1()
2296 …return emit_op(compiler, op, HALF_DATA | MOVE_OP, dst, dstw, TMP_REG1, 0, src, (src & SLJIT_IMM) ?… in sljit_emit_op1()
2299 …return emit_op(compiler, op, HALF_DATA | SIGNED_DATA | MOVE_OP, dst, dstw, TMP_REG1, 0, src, (src … in sljit_emit_op1()
2302 return emit_op(compiler, op, flags, dst, dstw, TMP_REG1, 0, src, srcw); in sljit_emit_op1()
2306 return emit_op(compiler, op, flags, dst, dstw, TMP_REG1, 0, src, srcw); in sljit_emit_op1()
2313 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op2() argument
2321 CHECK(check_sljit_emit_op2(compiler, op, 0, dst, dstw, src1, src1w, src2, src2w)); in sljit_emit_op2()
2339 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_ADD; in sljit_emit_op2()
2340 return emit_op(compiler, op, flags | CUMULATIVE_OP | IMM_OP, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
2344 compiler->status_flags_state = SLJIT_CURRENT_FLAGS_SUB; in sljit_emit_op2()
2345 return emit_op(compiler, op, flags | IMM_OP, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
2348 compiler->status_flags_state = 0; in sljit_emit_op2()
2349 return emit_op(compiler, op, flags | CUMULATIVE_OP, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
2354 …return emit_op(compiler, op, flags | CUMULATIVE_OP | LOGICAL_OP | IMM_OP, dst, dstw, src1, src1w, … in sljit_emit_op2()
2375 return emit_op(compiler, op, flags | IMM_OP, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
2382 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op2u(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op2u() argument
2387 CHECK(check_sljit_emit_op2(compiler, op, 1, 0, 0, src1, src1w, src2, src2w)); in sljit_emit_op2u()
2389 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_op2u()
2390 return sljit_emit_op2(compiler, op, TMP_REG2, 0, src1, src1w, src2, src2w); in sljit_emit_op2u()
2401 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_shift_into(struct sljit_compiler *compiler, sljit_s32… in sljit_emit_shift_into() argument
2417 CHECK(check_sljit_emit_shift_into(compiler, op, src_dst, src1, src1w, src2, src2w)); in sljit_emit_shift_into()
2422 SLJIT_SKIP_CHECKS(compiler); in sljit_emit_shift_into()
2423 …return sljit_emit_op2(compiler, (is_left ? SLJIT_ROTL : SLJIT_ROTR) | (op & SLJIT_32), src_dst, 0,… in sljit_emit_shift_into()
2435 FAIL_IF(emit_op_mem(compiler, inp_flags, DR(TMP_REG2), src2, src2w)); in sljit_emit_shift_into()
2440 FAIL_IF(emit_op_mem(compiler, inp_flags, DR(TMP_REG1), src1, src1w)); in sljit_emit_shift_into()
2443 FAIL_IF(load_immediate(compiler, DR(TMP_REG1), src1w)); in sljit_emit_shift_into()
2458 FAIL_IF(push_inst(compiler, ins1 | T(src_dst) | D(src_dst), DR(src_dst))); in sljit_emit_shift_into()
2459 FAIL_IF(push_inst(compiler, ins2 | T(src1) | D(TMP_REG1), DR(TMP_REG1))); in sljit_emit_shift_into()
2460 return push_inst(compiler, OR | S(src_dst) | T(TMP_REG1) | D(src_dst), DR(src_dst)); in sljit_emit_shift_into()
2473 FAIL_IF(push_inst(compiler, ins2 | S(src2) | T(src_dst) | D(src_dst), DR(src_dst))); in sljit_emit_shift_into()
2476 FAIL_IF(push_inst(compiler, ins1 | T(src1) | D(TMP_REG1) | (1 << 6), DR(TMP_REG1))); in sljit_emit_shift_into()
2477 …FAIL_IF(push_inst(compiler, XORI | S(src2) | T(TMP_REG2) | ((sljit_ins)bit_length - 1), DR(TMP_REG… in sljit_emit_shift_into()
2480 …FAIL_IF(push_inst(compiler, SELECT_OP2(op, DSUBU, SUBU) | SA(0) | T(src2) | D(TMP_REG2), DR(TMP_RE… in sljit_emit_shift_into()
2482 FAIL_IF(push_inst(compiler, ins3 | S(TMP_REG2) | T(src1) | D(TMP_REG1), DR(TMP_REG1))); in sljit_emit_shift_into()
2483 return push_inst(compiler, OR | S(src_dst) | T(TMP_REG1) | D(src_dst), DR(src_dst)); in sljit_emit_shift_into()
2489 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_src(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_op_src() argument
2493 CHECK(check_sljit_emit_op_src(compiler, op, src, srcw)); in sljit_emit_op_src()
2499 FAIL_IF(push_inst(compiler, ADDU_W | S(src) | TA(0) | DA(RETURN_ADDR_REG), RETURN_ADDR_REG)); in sljit_emit_op_src()
2501 FAIL_IF(emit_op_mem(compiler, WORD_DATA | LOAD_DATA, RETURN_ADDR_REG, src, srcw)); in sljit_emit_op_src()
2503 FAIL_IF(push_inst(compiler, JR | SA(RETURN_ADDR_REG), UNMOVABLE_INS)); in sljit_emit_op_src()
2504 return push_inst(compiler, NOP, UNMOVABLE_INS); in sljit_emit_op_src()
2512 return emit_prefetch(compiler, src, srcw); in sljit_emit_op_src()
2533 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_custom(struct sljit_compiler *compiler, in sljit_emit_op_custom() argument
2537 CHECK(check_sljit_emit_op_custom(compiler, instruction, size)); in sljit_emit_op_custom()
2539 return push_inst(compiler, *(sljit_ins*)instruction, UNMOVABLE_INS); in sljit_emit_op_custom()
2549 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
2560 FAIL_IF(emit_op_mem2(compiler, FLOAT_DATA(op) | LOAD_DATA, FR(TMP_FREG1), src, srcw, dst, dstw)); in sljit_emit_fop1_conv_sw_from_f64()
2564 …FAIL_IF(push_inst(compiler, (TRUNC_W_S ^ (flags >> 19)) | FMT(op) | FS(src) | FD(TMP_FREG1), MOVAB… in sljit_emit_fop1_conv_sw_from_f64()
2567 FAIL_IF(push_inst(compiler, MFC1 | flags | T(dst) | FS(TMP_FREG1), MOVABLE_INS)); in sljit_emit_fop1_conv_sw_from_f64()
2569 FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); in sljit_emit_fop1_conv_sw_from_f64()
2575 return emit_op_mem2(compiler, flags ? DOUBLE_DATA : SINGLE_DATA, FR(TMP_FREG1), dst, dstw, 0, 0); in sljit_emit_fop1_conv_sw_from_f64()
2582 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
2595 FAIL_IF(push_inst(compiler, MTC1 | flags | T(src) | FS(TMP_FREG1), MOVABLE_INS)); in sljit_emit_fop1_conv_f64_from_sw()
2597 FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); in sljit_emit_fop1_conv_f64_from_sw()
2601 …FAIL_IF(emit_op_mem2(compiler, (flags ? DOUBLE_DATA : SINGLE_DATA) | LOAD_DATA, FR(TMP_FREG1), src… in sljit_emit_fop1_conv_f64_from_sw()
2608 FAIL_IF(load_immediate(compiler, DR(TMP_REG1), srcw)); in sljit_emit_fop1_conv_f64_from_sw()
2609 FAIL_IF(push_inst(compiler, MTC1 | flags | T(TMP_REG1) | FS(TMP_FREG1), MOVABLE_INS)); in sljit_emit_fop1_conv_f64_from_sw()
2611 FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); in sljit_emit_fop1_conv_f64_from_sw()
2615 …FAIL_IF(push_inst(compiler, CVT_S_S | flags | (4 << 21) | ((((sljit_ins)op & SLJIT_32) ^ SLJIT_32)… in sljit_emit_fop1_conv_f64_from_sw()
2618 return emit_op_mem2(compiler, FLOAT_DATA(op), FR(TMP_FREG1), dst, dstw, 0, 0); in sljit_emit_fop1_conv_f64_from_sw()
2626 static SLJIT_INLINE sljit_s32 sljit_emit_fop1_cmp(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop1_cmp() argument
2633 …FAIL_IF(emit_op_mem2(compiler, FLOAT_DATA(op) | LOAD_DATA, FR(TMP_FREG1), src1, src1w, src2, src2w… in sljit_emit_fop1_cmp()
2638 FAIL_IF(emit_op_mem2(compiler, FLOAT_DATA(op) | LOAD_DATA, FR(TMP_FREG2), src2, src2w, 0, 0)); in sljit_emit_fop1_cmp()
2678 return push_inst(compiler, inst | FMT(op) | FT(src2) | FS(src1) | C_FD, UNMOVABLE_INS); in sljit_emit_fop1_cmp()
2681 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop1(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop1() argument
2688 compiler->cache_arg = 0; in sljit_emit_fop1()
2689 compiler->cache_argw = 0; in sljit_emit_fop1()
2692 SELECT_FOP1_OPERATION_WITH_CHECKS(compiler, op, dst, dstw, src, srcw); in sljit_emit_fop1()
2700 FAIL_IF(emit_op_mem2(compiler, FLOAT_DATA(op) | LOAD_DATA, FR(dst_r), src, srcw, dst, dstw)); in sljit_emit_fop1()
2708 FAIL_IF(push_inst(compiler, MOV_S | FMT(op) | FS(src) | FD(dst_r), MOVABLE_INS)); in sljit_emit_fop1()
2714 FAIL_IF(push_inst(compiler, NEG_S | FMT(op) | FS(src) | FD(dst_r), MOVABLE_INS)); in sljit_emit_fop1()
2717 FAIL_IF(push_inst(compiler, ABS_S | FMT(op) | FS(src) | FD(dst_r), MOVABLE_INS)); in sljit_emit_fop1()
2721 …FAIL_IF(push_inst(compiler, CVT_S_S | (sljit_ins)((op & SLJIT_32) ? 1 : (1 << 21)) | FS(src) | FD(… in sljit_emit_fop1()
2727 return emit_op_mem2(compiler, FLOAT_DATA(op), FR(dst_r), dst, dstw, 0, 0); in sljit_emit_fop1()
2731 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fop2(struct sljit_compiler *compiler, sljit_s32 op, in sljit_emit_fop2() argument
2739 CHECK(check_sljit_emit_fop2(compiler, op, dst, dstw, src1, src1w, src2, src2w)); in sljit_emit_fop2()
2744 compiler->cache_arg = 0; in sljit_emit_fop2()
2745 compiler->cache_argw = 0; in sljit_emit_fop2()
2750 if (getput_arg_fast(compiler, FLOAT_DATA(op) | LOAD_DATA, FR(TMP_FREG1), src1, src1w)) { in sljit_emit_fop2()
2751 FAIL_IF(compiler->error); in sljit_emit_fop2()
2758 if (getput_arg_fast(compiler, FLOAT_DATA(op) | LOAD_DATA, FR(TMP_FREG2), src2, src2w)) { in sljit_emit_fop2()
2759 FAIL_IF(compiler->error); in sljit_emit_fop2()
2767 …FAIL_IF(getput_arg(compiler, FLOAT_DATA(op) | LOAD_DATA, FR(TMP_FREG2), src2, src2w, src1, src1w)); in sljit_emit_fop2()
2768 FAIL_IF(getput_arg(compiler, FLOAT_DATA(op) | LOAD_DATA, FR(TMP_FREG1), src1, src1w, dst, dstw)); in sljit_emit_fop2()
2771 …FAIL_IF(getput_arg(compiler, FLOAT_DATA(op) | LOAD_DATA, FR(TMP_FREG1), src1, src1w, src2, src2w)); in sljit_emit_fop2()
2772 FAIL_IF(getput_arg(compiler, FLOAT_DATA(op) | LOAD_DATA, FR(TMP_FREG2), src2, src2w, dst, dstw)); in sljit_emit_fop2()
2776 FAIL_IF(getput_arg(compiler, FLOAT_DATA(op) | LOAD_DATA, FR(TMP_FREG1), src1, src1w, dst, dstw)); in sljit_emit_fop2()
2778 FAIL_IF(getput_arg(compiler, FLOAT_DATA(op) | LOAD_DATA, FR(TMP_FREG2), src2, src2w, dst, dstw)); in sljit_emit_fop2()
2787 FAIL_IF(push_inst(compiler, ADD_S | FMT(op) | FT(src2) | FS(src1) | FD(dst_r), MOVABLE_INS)); in sljit_emit_fop2()
2791 FAIL_IF(push_inst(compiler, SUB_S | FMT(op) | FT(src2) | FS(src1) | FD(dst_r), MOVABLE_INS)); in sljit_emit_fop2()
2795 FAIL_IF(push_inst(compiler, MUL_S | FMT(op) | FT(src2) | FS(src1) | FD(dst_r), MOVABLE_INS)); in sljit_emit_fop2()
2799 FAIL_IF(push_inst(compiler, DIV_S | FMT(op) | FT(src2) | FS(src1) | FD(dst_r), MOVABLE_INS)); in sljit_emit_fop2()
2804 FAIL_IF(emit_op_mem2(compiler, FLOAT_DATA(op), FR(TMP_FREG2), dst, dstw, 0, 0)); in sljit_emit_fop2()
2816 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_enter(struct sljit_compiler *compiler, sljit_s32… in sljit_emit_fast_enter() argument
2819 CHECK(check_sljit_emit_fast_enter(compiler, dst, dstw)); in sljit_emit_fast_enter()
2823 return push_inst(compiler, ADDU_W | SA(RETURN_ADDR_REG) | TA(0) | D(dst), UNMOVABLE_INS); in sljit_emit_fast_enter()
2826 FAIL_IF(emit_op_mem(compiler, WORD_DATA, RETURN_ADDR_REG, dst, dstw)); in sljit_emit_fast_enter()
2827 compiler->delay_slot = UNMOVABLE_INS; in sljit_emit_fast_enter()
2835 SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compiler *compiler) in sljit_emit_label() argument
2840 CHECK_PTR(check_sljit_emit_label(compiler)); in sljit_emit_label()
2842 if (compiler->last_label && compiler->last_label->size == compiler->size) in sljit_emit_label()
2843 return compiler->last_label; in sljit_emit_label()
2845 label = (struct sljit_label*)ensure_abuf(compiler, sizeof(struct sljit_label)); in sljit_emit_label()
2847 set_label(label, compiler); in sljit_emit_label()
2848 compiler->delay_slot = UNMOVABLE_INS; in sljit_emit_label()
2892 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compiler *compiler, sljit_… in sljit_emit_jump() argument
2900 CHECK_PTR(check_sljit_emit_jump(compiler, type)); in sljit_emit_jump()
2902 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_jump()
2904 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_jump()
2961 …if (compiler->delay_slot == MOVABLE_INS || (compiler->delay_slot != UNMOVABLE_INS && compiler->del… in sljit_emit_jump()
2965 PTR_FAIL_IF(push_inst(compiler, inst, UNMOVABLE_INS)); in sljit_emit_jump()
2968 PTR_FAIL_IF(push_inst(compiler, JR | S(TMP_REG2), UNMOVABLE_INS)); in sljit_emit_jump()
2971 PTR_FAIL_IF(push_inst(compiler, JALR | S(TMP_REG2) | DA(RETURN_ADDR_REG), UNMOVABLE_INS)); in sljit_emit_jump()
2974 jump->addr = compiler->size; in sljit_emit_jump()
2975 PTR_FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); in sljit_emit_jump()
2979 compiler->size += 2; in sljit_emit_jump()
2981 compiler->size += 6; in sljit_emit_jump()
2989 PTR_FAIL_IF(load_immediate(compiler, DR(TMP_REG1), src1w)); \
2999 PTR_FAIL_IF(load_immediate(compiler, DR(TMP_REG2), src2w)); \
3006 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_cmp(struct sljit_compiler *compiler, sljit_s… in sljit_emit_cmp() argument
3015 CHECK_PTR(check_sljit_emit_cmp(compiler, type, src1, src1w, src2, src2w)); in sljit_emit_cmp()
3019 compiler->cache_arg = 0; in sljit_emit_cmp()
3020 compiler->cache_argw = 0; in sljit_emit_cmp()
3028 PTR_FAIL_IF(emit_op_mem2(compiler, flags, DR(TMP_REG1), src1, src1w, src2, src2w)); in sljit_emit_cmp()
3033 PTR_FAIL_IF(emit_op_mem2(compiler, flags, DR(TMP_REG2), src2, src2w, 0, 0)); in sljit_emit_cmp()
3037 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_cmp()
3039 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_cmp()
3046 …if (compiler->delay_slot == MOVABLE_INS || (compiler->delay_slot != UNMOVABLE_INS && compiler->del… in sljit_emit_cmp()
3048 …PTR_FAIL_IF(push_inst(compiler, (type == SLJIT_EQUAL ? BNE : BEQ) | S(src1) | T(src2) | BRANCH_LEN… in sljit_emit_cmp()
3095 PTR_FAIL_IF(push_inst(compiler, inst | S(src1) | BRANCH_LENGTH, UNMOVABLE_INS)); in sljit_emit_cmp()
3101 …PTR_FAIL_IF(push_inst(compiler, (type <= SLJIT_LESS_EQUAL ? SLTIU : SLTI) | S(src1) | T(TMP_REG1) … in sljit_emit_cmp()
3104 …PTR_FAIL_IF(push_inst(compiler, (type <= SLJIT_LESS_EQUAL ? SLTU : SLT) | S(src1) | T(src2) | D(TM… in sljit_emit_cmp()
3111 …PTR_FAIL_IF(push_inst(compiler, (type <= SLJIT_LESS_EQUAL ? SLTIU : SLTI) | S(src2) | T(TMP_REG1) … in sljit_emit_cmp()
3114 …PTR_FAIL_IF(push_inst(compiler, (type <= SLJIT_LESS_EQUAL ? SLTU : SLT) | S(src2) | T(src1) | D(TM… in sljit_emit_cmp()
3120 …PTR_FAIL_IF(push_inst(compiler, (type == SLJIT_EQUAL ? BNE : BEQ) | S(TMP_REG1) | TA(0) | BRANCH_L… in sljit_emit_cmp()
3123 PTR_FAIL_IF(push_inst(compiler, JR | S(TMP_REG2), UNMOVABLE_INS)); in sljit_emit_cmp()
3124 jump->addr = compiler->size; in sljit_emit_cmp()
3125 PTR_FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); in sljit_emit_cmp()
3129 compiler->size += 2; in sljit_emit_cmp()
3131 compiler->size += 6; in sljit_emit_cmp()
3148 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compiler, sljit_s32 type… in sljit_emit_ijump() argument
3153 CHECK(check_sljit_emit_ijump(compiler, type, src, srcw)); in sljit_emit_ijump()
3156 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_ijump()
3158 set_jump(jump, compiler, JUMP_ADDR | ((type >= SLJIT_FAST_CALL) ? IS_JAL : 0)); in sljit_emit_ijump()
3161 if (compiler->delay_slot != UNMOVABLE_INS) in sljit_emit_ijump()
3167 FAIL_IF(emit_op_mem(compiler, WORD_DATA | LOAD_DATA, DR(TMP_REG2), src, srcw)); in sljit_emit_ijump()
3172 FAIL_IF(push_inst(compiler, JR | S(src), UNMOVABLE_INS)); in sljit_emit_ijump()
3174 FAIL_IF(push_inst(compiler, JALR | S(src) | DA(RETURN_ADDR_REG), UNMOVABLE_INS)); in sljit_emit_ijump()
3177 jump->addr = compiler->size; in sljit_emit_ijump()
3181 compiler->size += 2; in sljit_emit_ijump()
3183 compiler->size += 6; in sljit_emit_ijump()
3187 FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); in sljit_emit_ijump()
3191 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_op_flags(struct sljit_compiler *compiler, sljit_s32 o… in sljit_emit_op_flags() argument
3204 CHECK(check_sljit_emit_op_flags(compiler, op, dst, dstw, type)); in sljit_emit_op_flags()
3210 compiler->cache_arg = 0; in sljit_emit_op_flags()
3211 compiler->cache_argw = 0; in sljit_emit_op_flags()
3214 FAIL_IF(emit_op_mem2(compiler, mem_type | LOAD_DATA, DR(TMP_REG1), dst, dstw, dst, dstw)); in sljit_emit_op_flags()
3223 FAIL_IF(push_inst(compiler, SLTIU | SA(EQUAL_FLAG) | TA(dst_ar) | IMM(1), dst_ar)); in sljit_emit_op_flags()
3228 if (compiler->status_flags_state & (SLJIT_CURRENT_FLAGS_ADD | SLJIT_CURRENT_FLAGS_SUB)) { in sljit_emit_op_flags()
3232 FAIL_IF(push_inst(compiler, SLTIU | SA(OTHER_FLAG) | TA(dst_ar) | IMM(1), dst_ar)); in sljit_emit_op_flags()
3256 FAIL_IF(push_inst(compiler, MFC1 | TA(dst_ar) | FS(TMP_FREG3), dst_ar)); in sljit_emit_op_flags()
3258 FAIL_IF(push_inst(compiler, CFC1 | TA(dst_ar) | DA(FCSR_REG), dst_ar)); in sljit_emit_op_flags()
3260 FAIL_IF(push_inst(compiler, SRL | TA(dst_ar) | DA(dst_ar) | SH_IMM(23), dst_ar)); in sljit_emit_op_flags()
3261 FAIL_IF(push_inst(compiler, ANDI | SA(dst_ar) | TA(dst_ar) | IMM(1), dst_ar)); in sljit_emit_op_flags()
3266 FAIL_IF(push_inst(compiler, XORI | SA(src_ar) | TA(dst_ar) | IMM(1), dst_ar)); in sljit_emit_op_flags()
3272 return emit_op_mem(compiler, mem_type, src_ar, dst, dstw); in sljit_emit_op_flags()
3275 return push_inst(compiler, ADDU_W | SA(src_ar) | TA(0) | DA(dst_ar), dst_ar); in sljit_emit_op_flags()
3281 FAIL_IF(push_inst(compiler, ADDU_W | SA(src_ar) | TA(0) | D(TMP_REG2), DR(TMP_REG2))); in sljit_emit_op_flags()
3286 return emit_op(compiler, saved_op, mem_type, dst, dstw, TMP_REG1, 0, TMP_REG2, 0); in sljit_emit_op_flags()
3287 return emit_op(compiler, saved_op, mem_type, dst, dstw, dst, dstw, TMP_REG2, 0); in sljit_emit_op_flags()
3290 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_cmov(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_cmov() argument
3299 CHECK(check_sljit_emit_cmov(compiler, type, dst_reg, src, srcw)); in sljit_emit_cmov()
3308 FAIL_IF(load_immediate(compiler, DR(TMP_REG1), srcw)); in sljit_emit_cmov()
3364 return push_inst(compiler, ins | S(src) | D(dst_reg), DR(dst_reg)); in sljit_emit_cmov()
3367 return sljit_emit_cmov_generic(compiler, type, dst_reg, src, srcw); in sljit_emit_cmov()
3371 static sljit_s32 update_mem_addr(struct sljit_compiler *compiler, sljit_s32 *mem, sljit_sw *memw, s… in update_mem_addr() argument
3380 … FAIL_IF(push_inst(compiler, SLL_W | T(OFFS_REG(arg)) | D(TMP_REG1) | SH_IMM(argw), DR(TMP_REG1))); in update_mem_addr()
3381 …FAIL_IF(push_inst(compiler, ADDU_W | S(TMP_REG1) | T(arg & REG_MASK) | D(TMP_REG1), DR(TMP_REG1))); in update_mem_addr()
3383 …FAIL_IF(push_inst(compiler, ADDU_W | S(arg & REG_MASK) | T(OFFS_REG(arg)) | D(TMP_REG1), DR(TMP_RE… in update_mem_addr()
3399 FAIL_IF(load_immediate(compiler, DR(TMP_REG1), argw)); in update_mem_addr()
3402 FAIL_IF(load_immediate(compiler, DR(TMP_REG1), TO_ARGW_HI(argw))); in update_mem_addr()
3409 return push_inst(compiler, ADDU_W | S(TMP_REG1) | T(arg & REG_MASK) | D(TMP_REG1), DR(TMP_REG1)); in update_mem_addr()
3430 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_mem(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_mem() argument
3442 CHECK(check_sljit_emit_mem(compiler, type, reg, mem, memw)); in sljit_emit_mem()
3449 FAIL_IF(update_mem_addr(compiler, &mem, &memw, SIMM_MAX - (2 * SSIZE_OF(sw) - 1))); in sljit_emit_mem()
3452 FAIL_IF(push_inst(compiler, ADDU_W | S(mem) | TA(0) | D(TMP_REG1), DR(TMP_REG1))); in sljit_emit_mem()
3464 FAIL_IF(push_inst(compiler, ins | T(REG_PAIR_FIRST(reg)) | IMM(memw), DR(REG_PAIR_FIRST(reg)))); in sljit_emit_mem()
3465 …FAIL_IF(push_inst(compiler, ins_right | T(REG_PAIR_FIRST(reg)) | IMM(memw + (SSIZE_OF(sw) - 1)), D… in sljit_emit_mem()
3466 …FAIL_IF(push_inst(compiler, ins | T(REG_PAIR_SECOND(reg)) | IMM(memw + SSIZE_OF(sw)), DR(REG_PAIR_… in sljit_emit_mem()
3467 …return push_inst(compiler, ins_right | T(REG_PAIR_SECOND(reg)) | IMM((memw + 2 * SSIZE_OF(sw) - 1)… in sljit_emit_mem()
3471 FAIL_IF(update_mem_addr(compiler, &mem, &memw, SIMM_MAX - SSIZE_OF(sw))); in sljit_emit_mem()
3476 …FAIL_IF(push_inst(compiler, ins | T(REG_PAIR_SECOND(reg)) | IMM(memw + SSIZE_OF(sw)), DR(REG_PAIR_… in sljit_emit_mem()
3477 return push_inst(compiler, ins | T(REG_PAIR_FIRST(reg)) | IMM(memw), DR(REG_PAIR_FIRST(reg))); in sljit_emit_mem()
3480 FAIL_IF(push_inst(compiler, ins | T(REG_PAIR_FIRST(reg)) | IMM(memw), DR(REG_PAIR_FIRST(reg)))); in sljit_emit_mem()
3481 …return push_inst(compiler, ins | T(REG_PAIR_SECOND(reg)) | IMM(memw + SSIZE_OF(sw)), DR(REG_PAIR_S… in sljit_emit_mem()
3485 return sljit_emit_mem_unaligned(compiler, type, reg, mem, memw); in sljit_emit_mem()
3499 return emit_op_mem(compiler, flags, DR(reg), mem, memw); in sljit_emit_mem()
3503 FAIL_IF(update_mem_addr(compiler, &mem, &memw, SIMM_MAX - 1)); in sljit_emit_mem()
3507 FAIL_IF(push_inst(compiler, SRA_W | T(reg) | D(TMP_REG2) | SH_IMM(8), DR(TMP_REG2))); in sljit_emit_mem()
3508 …FAIL_IF(push_inst(compiler, data_transfer_insts[BYTE_DATA] | S(mem) | T(TMP_REG2) | MEM16_IMM_FIRS… in sljit_emit_mem()
3509 …return push_inst(compiler, data_transfer_insts[BYTE_DATA] | S(mem) | T(reg) | MEM16_IMM_SECOND(mem… in sljit_emit_mem()
3517 …FAIL_IF(push_inst(compiler, data_transfer_insts[flags] | S(mem) | T(TMP_REG2) | MEM16_IMM_FIRST(me… in sljit_emit_mem()
3518 …FAIL_IF(push_inst(compiler, data_transfer_insts[BYTE_DATA | LOAD_DATA] | S(mem) | T(reg) | MEM16_I… in sljit_emit_mem()
3519 FAIL_IF(push_inst(compiler, SLL_W | T(TMP_REG2) | D(TMP_REG2) | SH_IMM(8), DR(TMP_REG2))); in sljit_emit_mem()
3520 return push_inst(compiler, OR | S(reg) | T(TMP_REG2) | D(reg), DR(reg)); in sljit_emit_mem()
3530 return emit_op_mem(compiler, flags, DR(reg), mem, memw); in sljit_emit_mem()
3533 FAIL_IF(update_mem_addr(compiler, &mem, &memw, SIMM_MAX - 7)); in sljit_emit_mem()
3537 FAIL_IF(push_inst(compiler, SDL | S(mem) | T(reg) | IMM(memw), MOVABLE_INS)); in sljit_emit_mem()
3538 return push_inst(compiler, SDR | S(mem) | T(reg) | IMM(memw + 7), MOVABLE_INS); in sljit_emit_mem()
3542 FAIL_IF(push_inst(compiler, ADDU_W | S(mem) | TA(0) | D(TMP_REG1), DR(TMP_REG1))); in sljit_emit_mem()
3546 FAIL_IF(push_inst(compiler, LDL | S(mem) | T(reg) | IMM(memw), DR(reg))); in sljit_emit_mem()
3547 return push_inst(compiler, LDR | S(mem) | T(reg) | IMM(memw + 7), DR(reg)); in sljit_emit_mem()
3551 FAIL_IF(update_mem_addr(compiler, &mem, &memw, SIMM_MAX - 3)); in sljit_emit_mem()
3555 FAIL_IF(push_inst(compiler, SWL | S(mem) | T(reg) | IMM(memw), MOVABLE_INS)); in sljit_emit_mem()
3556 return push_inst(compiler, SWR | S(mem) | T(reg) | IMM(memw + 3), MOVABLE_INS); in sljit_emit_mem()
3560 FAIL_IF(push_inst(compiler, ADDU_W | S(mem) | TA(0) | D(TMP_REG1), DR(TMP_REG1))); in sljit_emit_mem()
3564 FAIL_IF(push_inst(compiler, LWL | S(mem) | T(reg) | IMM(memw), DR(reg))); in sljit_emit_mem()
3566 return push_inst(compiler, LWR | S(mem) | T(reg) | IMM(memw + 3), DR(reg)); in sljit_emit_mem()
3568 FAIL_IF(push_inst(compiler, LWR | S(mem) | T(reg) | IMM(memw + 3), DR(reg))); in sljit_emit_mem()
3574 return push_inst(compiler, DINSU | T(reg) | SA(0) | (31 << 11) | (0 << 11), DR(reg)); in sljit_emit_mem()
3576 FAIL_IF(push_inst(compiler, DSLL32 | T(reg) | D(reg) | SH_IMM(0), DR(reg))); in sljit_emit_mem()
3577 return push_inst(compiler, DSRL32 | T(reg) | D(reg) | SH_IMM(0), DR(reg)); in sljit_emit_mem()
3585 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fmem(struct sljit_compiler *compiler, sljit_s32 type, in sljit_emit_fmem() argument
3590 CHECK(check_sljit_emit_fmem(compiler, type, freg, mem, memw)); in sljit_emit_fmem()
3592 FAIL_IF(update_mem_addr(compiler, &mem, &memw, SIMM_MAX - (type & SLJIT_32) ? 3 : 7)); in sljit_emit_fmem()
3597 FAIL_IF(push_inst(compiler, MFC1 | T(TMP_REG2) | FS(freg), DR(TMP_REG2))); in sljit_emit_fmem()
3599 FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); in sljit_emit_fmem()
3601 FAIL_IF(push_inst(compiler, SWL | S(mem) | T(TMP_REG2) | IMM(memw), MOVABLE_INS)); in sljit_emit_fmem()
3602 return push_inst(compiler, SWR | S(mem) | T(TMP_REG2) | IMM(memw + 3), MOVABLE_INS); in sljit_emit_fmem()
3606 FAIL_IF(push_inst(compiler, MFC1 | T(TMP_REG2) | MEMF64_FS_FIRST(freg), DR(TMP_REG2))); in sljit_emit_fmem()
3608 FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); in sljit_emit_fmem()
3610 FAIL_IF(push_inst(compiler, SWL | S(mem) | T(TMP_REG2) | IMM(memw), MOVABLE_INS)); in sljit_emit_fmem()
3611 FAIL_IF(push_inst(compiler, SWR | S(mem) | T(TMP_REG2) | IMM(memw + 3), MOVABLE_INS)); in sljit_emit_fmem()
3613 FAIL_IF(push_inst(compiler, MFC1 | T(TMP_REG2) | MEMF64_FS_SECOND(freg), DR(TMP_REG2))); in sljit_emit_fmem()
3615 FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); in sljit_emit_fmem()
3617 FAIL_IF(push_inst(compiler, SWL | S(mem) | T(TMP_REG2) | IMM(memw + 4), MOVABLE_INS)); in sljit_emit_fmem()
3618 return push_inst(compiler, SWR | S(mem) | T(TMP_REG2) | IMM(memw + 7), MOVABLE_INS); in sljit_emit_fmem()
3620 FAIL_IF(push_inst(compiler, MFC1 | (1 << 21) | T(TMP_REG2) | FS(freg), DR(TMP_REG2))); in sljit_emit_fmem()
3622 FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); in sljit_emit_fmem()
3624 FAIL_IF(push_inst(compiler, SDL | S(mem) | T(TMP_REG2) | IMM(memw), MOVABLE_INS)); in sljit_emit_fmem()
3625 return push_inst(compiler, SDR | S(mem) | T(TMP_REG2) | IMM(memw + 7), MOVABLE_INS); in sljit_emit_fmem()
3630 FAIL_IF(push_inst(compiler, LWL | S(mem) | T(TMP_REG2) | IMM(memw), DR(TMP_REG2))); in sljit_emit_fmem()
3631 FAIL_IF(push_inst(compiler, LWR | S(mem) | T(TMP_REG2) | IMM(memw + 3), DR(TMP_REG2))); in sljit_emit_fmem()
3633 FAIL_IF(push_inst(compiler, MTC1 | T(TMP_REG2) | FS(freg), MOVABLE_INS)); in sljit_emit_fmem()
3635 FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); in sljit_emit_fmem()
3641 FAIL_IF(push_inst(compiler, LWL | S(mem) | T(TMP_REG2) | IMM(memw), DR(TMP_REG2))); in sljit_emit_fmem()
3642 FAIL_IF(push_inst(compiler, LWR | S(mem) | T(TMP_REG2) | IMM(memw + 3), DR(TMP_REG2))); in sljit_emit_fmem()
3643 FAIL_IF(push_inst(compiler, MTC1 | T(TMP_REG2) | MEMF64_FS_FIRST(freg), MOVABLE_INS)); in sljit_emit_fmem()
3645 FAIL_IF(push_inst(compiler, LWL | S(mem) | T(TMP_REG2) | IMM(memw + 4), DR(TMP_REG2))); in sljit_emit_fmem()
3646 FAIL_IF(push_inst(compiler, LWR | S(mem) | T(TMP_REG2) | IMM(memw + 7), DR(TMP_REG2))); in sljit_emit_fmem()
3647 FAIL_IF(push_inst(compiler, MTC1 | T(TMP_REG2) | MEMF64_FS_SECOND(freg), MOVABLE_INS)); in sljit_emit_fmem()
3649 FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); in sljit_emit_fmem()
3652 FAIL_IF(push_inst(compiler, LDL | S(mem) | T(TMP_REG2) | IMM(memw), DR(TMP_REG2))); in sljit_emit_fmem()
3653 FAIL_IF(push_inst(compiler, LDR | S(mem) | T(TMP_REG2) | IMM(memw + 7), DR(TMP_REG2))); in sljit_emit_fmem()
3655 FAIL_IF(push_inst(compiler, MTC1 | (1 << 21) | T(TMP_REG2) | FS(freg), MOVABLE_INS)); in sljit_emit_fmem()
3657 FAIL_IF(push_inst(compiler, NOP, UNMOVABLE_INS)); in sljit_emit_fmem()
3673 SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, slji… in sljit_emit_const() argument
3679 CHECK_PTR(check_sljit_emit_const(compiler, dst, dstw, init_value)); in sljit_emit_const()
3682 const_ = (struct sljit_const*)ensure_abuf(compiler, sizeof(struct sljit_const)); in sljit_emit_const()
3684 set_const(const_, compiler); in sljit_emit_const()
3687 PTR_FAIL_IF(emit_const(compiler, dst_r, init_value)); in sljit_emit_const()
3690 PTR_FAIL_IF(emit_op_mem(compiler, WORD_DATA, DR(TMP_REG2), dst, dstw)); in sljit_emit_const()
3695 …UTE struct sljit_put_label* sljit_emit_put_label(struct sljit_compiler *compiler, sljit_s32 dst, s… in sljit_emit_put_label() argument
3701 CHECK_PTR(check_sljit_emit_put_label(compiler, dst, dstw)); in sljit_emit_put_label()
3704 put_label = (struct sljit_put_label*)ensure_abuf(compiler, sizeof(struct sljit_put_label)); in sljit_emit_put_label()
3706 set_put_label(put_label, compiler, 0); in sljit_emit_put_label()
3709 PTR_FAIL_IF(push_inst(compiler, (sljit_ins)dst_r, UNMOVABLE_INS)); in sljit_emit_put_label()
3711 compiler->size += 1; in sljit_emit_put_label()
3713 compiler->size += 5; in sljit_emit_put_label()
3717 PTR_FAIL_IF(emit_op_mem(compiler, WORD_DATA, DR(TMP_REG2), dst, dstw)); in sljit_emit_put_label()