39#if !defined(SLJIT_MIPS_REV) || SLJIT_MIPS_REV <= 1
41 return push_inst(compiler,
NOP, UNMOVABLE_INS);
55 return push_inst(compiler,
ORI |
SA(0) |
TA(dst_ar) |
IMM(imm), dst_ar);
58 return push_inst(compiler,
ADDIU |
SA(0) |
TA(dst_ar) |
IMM(imm), dst_ar);
60 if (imm <= 0x7fffffffl && imm >= -0x80000000l) {
61 FAIL_IF(push_inst(compiler,
LUI |
TA(dst_ar) |
IMM(imm >> 16), dst_ar));
72 while (!(uimm & 0xff00000000000000l)) {
77 if (!(uimm & 0xf000000000000000l)) {
82 if (!(uimm & 0xc000000000000000l)) {
91 SLJIT_ASSERT(((uimm & 0xc000000000000000l) == 0x4000000000000000l) && (shift > 0) && (shift <= 32));
96 FAIL_IF(push_inst(compiler,
LUI |
TA(dst_ar) |
IMM(uimm >> 48), dst_ar));
97 if (uimm & 0x0000ffff00000000l)
98 FAIL_IF(push_inst(compiler,
ORI |
SA(dst_ar) |
TA(dst_ar) |
IMM(uimm >> 32), dst_ar));
100 imm &= (1l << shift) - 1;
101 if (!(imm & ~0xffff)) {
105 FAIL_IF(push_inst(compiler, ins |
TA(dst_ar) |
DA(dst_ar), dst_ar));
106 return !(imm & 0xffff) ?
SLJIT_SUCCESS : push_inst(compiler,
ORI |
SA(dst_ar) |
TA(dst_ar) |
IMM(imm), dst_ar);
113 while (!(uimm & 0xf000000000000000l)) {
118 if (!(uimm & 0xc000000000000000l)) {
123 if (!(uimm & 0x8000000000000000l)) {
128 SLJIT_ASSERT((uimm & 0x8000000000000000l) && (shift2 > 0) && (shift2 <= 16));
131 FAIL_IF(push_inst(compiler,
ORI |
SA(dst_ar) |
TA(dst_ar) |
IMM(uimm >> 48), dst_ar));
134 imm &= (1l << shift2) - 1;
135 return !(imm & 0xffff) ?
SLJIT_SUCCESS : push_inst(compiler,
ORI |
SA(dst_ar) |
TA(dst_ar) |
IMM(imm), dst_ar);
140 FAIL_IF(push_inst(compiler,
LUI |
T(dst) |
IMM(init_value >> 48),
DR(dst)));
141 FAIL_IF(push_inst(compiler,
ORI |
S(dst) |
T(dst) |
IMM(init_value >> 32),
DR(dst)));
143 FAIL_IF(push_inst(compiler,
ORI |
S(dst) |
T(dst) |
IMM(init_value >> 16),
DR(dst)));
145 return push_inst(compiler,
ORI |
S(dst) |
T(dst) |
IMM(init_value),
DR(dst));
157 CHECK(check_sljit_emit_fset64(compiler, freg,
value));
163#if !defined(SLJIT_MIPS_REV) || SLJIT_MIPS_REV <= 1
164 FAIL_IF(push_inst(compiler,
NOP, UNMOVABLE_INS));
171#if !defined(SLJIT_MIPS_REV) || SLJIT_MIPS_REV <= 1
172 FAIL_IF(push_inst(compiler,
NOP, UNMOVABLE_INS));
183 CHECK(check_sljit_emit_fcopy(compiler, op, freg, reg));
185 inst =
T(reg) |
FS(freg);
192#if !defined(SLJIT_MIPS_REV) || SLJIT_MIPS_REV <= 1
194 return push_inst(compiler,
NOP, UNMOVABLE_INS);
205 inst[0] = (inst[0] & 0xffff0000) | ((
sljit_ins)(new_target >> 48) & 0xffff);
206 inst[1] = (inst[1] & 0xffff0000) | ((
sljit_ins)(new_target >> 32) & 0xffff);
207 inst[3] = (inst[3] & 0xffff0000) | ((
sljit_ins)(new_target >> 16) & 0xffff);
208 inst[5] = (inst[5] & 0xffff0000) | ((
sljit_ins)new_target & 0xffff);
210 inst = (
sljit_ins *)SLJIT_ADD_EXEC_OFFSET(inst, executable_offset);
235 switch (arg_types & SLJIT_ARG_MASK) {
251 switch (
types & SLJIT_ARG_MASK) {
253 if (arg_count != float_arg_count)
255 else if (arg_count == 1)
261 if (arg_count != float_arg_count)
263 else if (arg_count == 1)
269 if (arg_count != word_arg_count)
270 ins =
DADDU |
S(word_arg_count) |
TA(0) |
D(arg_count);
271 else if (arg_count == 1)
280 FAIL_IF(push_inst(compiler, prev_ins, MOVABLE_INS));
300 CHECK_PTR(check_sljit_emit_call(compiler,
type, arg_types));
307 PTR_FAIL_IF(emit_stack_frame_release(compiler, 0, &ins));
310 PTR_FAIL_IF(call_with_args(compiler, arg_types, &ins));
314 if (ins ==
NOP && compiler->delay_slot != UNMOVABLE_INS)
315 jump->flags |= IS_MOVABLE;
318 jump->flags |= IS_JAL;
321 jump->flags |= IS_CALL;
327 jump->addr = compiler->
size;
328 PTR_FAIL_IF(push_inst(compiler, ins, UNMOVABLE_INS));
342 CHECK(check_sljit_emit_icall(compiler,
type, arg_types, src, srcw));
345 ADJUST_LOCAL_OFFSET(src, srcw);
359 FAIL_IF(emit_stack_frame_release(compiler, 0, &ins));
362 FAIL_IF(push_inst(compiler, ins, MOVABLE_INS));
365 SLJIT_SKIP_CHECKS(compiler);
377 FAIL_IF(emit_stack_frame_release(compiler, 0, &ins));
379 FAIL_IF(call_with_args(compiler, arg_types, &ins));
386 return push_inst(compiler, ins, UNMOVABLE_INS);
#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)