38#if defined(SLJIT_MIPS_REV) && SLJIT_MIPS_REV >= 2
54 if (!is_32 && src1 != dst)
56#if !defined(SLJIT_MIPS_REV) || SLJIT_MIPS_REV <= 1
58 FAIL_IF(push_inst(compiler,
NOP, UNMOVABLE_INS));
65#if !defined(SLJIT_MIPS_REV) || SLJIT_MIPS_REV <= 1
67 return push_inst(compiler,
NOP, UNMOVABLE_INS);
75 return push_inst(compiler,
ORI |
SA(0) |
TA(dst_ar) |
IMM(imm), dst_ar);
78 return push_inst(compiler,
ADDIU |
SA(0) |
TA(dst_ar) |
IMM(imm), dst_ar);
80 FAIL_IF(push_inst(compiler,
LUI |
TA(dst_ar) |
IMM(imm >> 16), dst_ar));
87 return push_inst(compiler,
ORI |
S(dst) |
T(dst) |
IMM(init_value),
DR(dst));
95#if defined(SLJIT_LITTLE_ENDIAN) && SLJIT_LITTLE_ENDIAN
107 CHECK(check_sljit_emit_fset64(compiler, freg,
value));
118#if defined(SLJIT_MIPS_REV) && SLJIT_MIPS_REV >= 2
120 return push_inst(compiler, MTHC1 | (
u.bin.hi != 0 ?
T(
TMP_REG2) :
TA(0)) |
FS(freg), MOVABLE_INS);
126#if !defined(SLJIT_MIPS_REV) || SLJIT_MIPS_REV <= 1
127 FAIL_IF(push_inst(compiler,
NOP, UNMOVABLE_INS));
141 CHECK(check_sljit_emit_fcopy(compiler, op, freg, reg));
144 if (reg & REG_PAIR_MASK) {
145 reg2 = REG_PAIR_SECOND(reg);
146 reg = REG_PAIR_FIRST(reg);
151 FAIL_IF(push_inst(compiler,
MTC1 | inst, MOVABLE_INS));
155 inst =
FS(freg) | (1 << 11);
156#if defined(SLJIT_MIPS_REV) && SLJIT_MIPS_REV >= 2
166 if (!is_32 && !reg2) {
168#if defined(SLJIT_MIPS_REV) && SLJIT_MIPS_REV >= 2
181 FAIL_IF(push_inst(compiler, mthc | inst, MOVABLE_INS));
183 FAIL_IF(push_inst(compiler, mfhc | inst,
DR(reg)));
185#if !defined(SLJIT_MIPS_REV) || SLJIT_MIPS_REV <= 1
187 return push_inst(compiler,
NOP, UNMOVABLE_INS);
199 inst[0] = (inst[0] & 0xffff0000) | ((new_target >> 16) & 0xffff);
200 inst[1] = (inst[1] & 0xffff0000) | (new_target & 0xffff);
202 inst = (
sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
222#if defined(SLJIT_LITTLE_ENDIAN) && SLJIT_LITTLE_ENDIAN
238 switch (arg_types & SLJIT_ARG_MASK) {
245 if (word_arg_count == 0 && float_arg_count <= 1)
246 *offsets_ptr = (
sljit_u8)(254 + float_arg_count);
252 if (word_arg_count == 0 && float_arg_count <= 1)
253 *offsets_ptr = (
sljit_u8)(254 + float_arg_count);
282 FAIL_IF(emit_stack_frame_release(compiler, 0, &prev_ins));
289 switch (
types & SLJIT_ARG_MASK) {
291 if (*offsets_ptr < 4 *
sizeof(
sljit_sw)) {
293 FAIL_IF(push_inst(compiler, prev_ins, MOVABLE_INS));
299#if defined(SLJIT_MIPS_REV) && SLJIT_MIPS_REV >= 2
301 prev_ins = MFHC1 | f64_hi |
FS(float_arg_count);
305 prev_ins =
MFC1 | f64_hi |
FS(float_arg_count) | (1 << 11);
308 ins =
MFC1 | f64_lo |
FS(float_arg_count);
309 }
else if (*offsets_ptr < 254)
311 else if (*offsets_ptr == 254)
317 if (*offsets_ptr < 4 *
sizeof (
sljit_sw))
318 ins =
MFC1 |
TA(4 + (*offsets_ptr >> 2)) |
FS(float_arg_count);
319 else if (*offsets_ptr < 254)
321 else if (*offsets_ptr == 254)
327 if (*offsets_ptr >= 4 *
sizeof (
sljit_sw))
329 else if ((*offsets_ptr >> 2) != word_arg_count - 1)
330 ins =
ADDU |
S(word_arg_count) |
TA(0) |
DA(4 + (*offsets_ptr >> 2));
331 else if (*offsets_ptr == 0)
340 FAIL_IF(push_inst(compiler, prev_ins, MOVABLE_INS));
361 CHECK_PTR(check_sljit_emit_call(compiler,
type, arg_types));
369 PTR_FAIL_IF(call_with_args(compiler, arg_types, &ins, &extra_space));
371 PTR_FAIL_IF(emit_stack_frame_release(compiler, 0, &ins));
375 if (ins ==
NOP && compiler->delay_slot != UNMOVABLE_INS)
376 jump->flags |= IS_MOVABLE;
379 jump->flags |= IS_JAL;
382 jump->flags |= IS_CALL;
388 jump->addr = compiler->
size;
389 PTR_FAIL_IF(push_inst(compiler, ins, UNMOVABLE_INS));
394 if (extra_space == 0)
417 CHECK(check_sljit_emit_icall(compiler,
type, arg_types, src, srcw));
420 ADJUST_LOCAL_OFFSET(src, srcw);
434 FAIL_IF(emit_stack_frame_release(compiler, 0, &ins));
437 FAIL_IF(push_inst(compiler, ins, MOVABLE_INS));
440 SLJIT_SKIP_CHECKS(compiler);
451 FAIL_IF(call_with_args(compiler, arg_types, &ins, &extra_space));
458 FAIL_IF(push_inst(compiler, ins, UNMOVABLE_INS));
460 if (extra_space == 0)
#define SLJIT_API_FUNC_ATTRIBUTE
#define SLJIT_UNUSED_ARG(arg)
#define SLJIT_CACHE_FLUSH(from, to)
#define SLJIT_UPDATE_WX_FLAGS(from, to, enable_exec)
#define PTR_FAIL_IF(expr)
#define CHECK_ERROR_PTR()
#define SLJIT_CALL_REG_ARG
#define SLJIT_FIRST_SAVED_REG
#define SLJIT_ARG_TYPE_F32
#define SLJIT_ARG_TYPE_F64
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_ijump(struct sljit_compiler *compiler, sljit_s32 type, sljit_s32 src, sljit_sw srcw)
#define SLJIT_CALL_RETURN
#define SLJIT_REWRITABLE_JUMP
#define SLJIT_COPY_TO_F64
SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump * sljit_emit_call(struct sljit_compiler *compiler, sljit_s32 type, sljit_s32 arg_types)
SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_constant, sljit_sw executable_offset)
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fcopy(struct sljit_compiler *compiler, sljit_s32 op, sljit_s32 freg, sljit_s32 reg)
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fset64(struct sljit_compiler *compiler, sljit_s32 freg, sljit_f64 value)
SLJIT_API_FUNC_ATTRIBUTE void sljit_set_jump_addr(sljit_uw addr, sljit_uw new_target, sljit_sw executable_offset)
SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_icall(struct sljit_compiler *compiler, sljit_s32 type, sljit_s32 arg_types, sljit_s32 src, sljit_sw srcw)