Lines Matching refs:jump

255 static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_u16 *code_ptr, sljit_…  in detect_jump_type()  argument
259 if (jump->flags & SLJIT_REWRITABLE_JUMP) in detect_jump_type()
262 if (jump->flags & JUMP_ADDR) { in detect_jump_type()
264 if (!(jump->u.target & 0x1)) in detect_jump_type()
266 diff = ((sljit_sw)jump->u.target - (sljit_sw)(code_ptr + 2) - executable_offset) >> 1; in detect_jump_type()
269 SLJIT_ASSERT(jump->flags & JUMP_LABEL); in detect_jump_type()
270 diff = ((sljit_sw)(code + jump->u.label->size) - (sljit_sw)(code_ptr + 2)) >> 1; in detect_jump_type()
273 if (jump->flags & IS_COND) { in detect_jump_type()
274 SLJIT_ASSERT(!(jump->flags & IS_BL)); in detect_jump_type()
276 jump->flags |= PATCH_TYPE1; in detect_jump_type()
280 jump->flags |= PATCH_TYPE2; in detect_jump_type()
286 jump->flags |= PATCH_TYPE3; in detect_jump_type()
290 else if (jump->flags & IS_BL) { in detect_jump_type()
292 jump->flags |= PATCH_BL; in detect_jump_type()
298 jump->flags |= PATCH_TYPE4; in detect_jump_type()
302 jump->flags |= PATCH_TYPE5; in detect_jump_type()
310 static SLJIT_INLINE void set_jump_instruction(struct sljit_jump *jump, sljit_sw executable_offset) in set_jump_instruction() argument
312 sljit_s32 type = (jump->flags >> 4) & 0xf; in set_jump_instruction()
318 …modify_imm32_const((sljit_u16*)jump->addr, (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump in set_jump_instruction()
322 if (jump->flags & JUMP_ADDR) { in set_jump_instruction()
323 SLJIT_ASSERT(jump->u.target & 0x1); in set_jump_instruction()
324 …diff = ((sljit_sw)jump->u.target - (sljit_sw)(jump->addr + sizeof(sljit_u32)) - executable_offset)… in set_jump_instruction()
327 SLJIT_ASSERT(jump->u.label->addr & 0x1); in set_jump_instruction()
328 …diff = ((sljit_sw)(jump->u.label->addr) - (sljit_sw)(jump->addr + sizeof(sljit_u32)) - executable_… in set_jump_instruction()
330 jump_inst = (sljit_u16*)jump->addr; in set_jump_instruction()
335 SLJIT_ASSERT(diff <= 127 && diff >= -128 && (jump->flags & IS_COND)); in set_jump_instruction()
336 jump_inst[0] = (sljit_u16)(0xd000 | (jump->flags & 0xf00) | ((sljit_ins)diff & 0xff)); in set_jump_instruction()
340 SLJIT_ASSERT(diff <= 524287 && diff >= -524288 && (jump->flags & IS_COND)); in set_jump_instruction()
341 …jump_inst[0] = (sljit_u16)(0xf000 | COPY_BITS(jump->flags, 8, 6, 4) | COPY_BITS(diff, 11, 0, 6) | … in set_jump_instruction()
345 SLJIT_ASSERT(jump->flags & IS_COND); in set_jump_instruction()
346 *jump_inst++ = (sljit_u16)(IT | ((jump->flags >> 4) & 0xf0) | 0x8); in set_jump_instruction()
352 SLJIT_ASSERT(diff <= 1023 && diff >= -1024 && !(jump->flags & IS_COND)); in set_jump_instruction()
387 struct sljit_jump *jump; in sljit_generate_code() local
405 jump = compiler->jumps; in sljit_generate_code()
416 SLJIT_ASSERT(!jump || jump->addr >= half_count); in sljit_generate_code()
426 if (jump && jump->addr == half_count) { in sljit_generate_code()
427 jump->addr = (sljit_uw)code_ptr - ((jump->flags & IS_COND) ? 10 : 8); in sljit_generate_code()
428 code_ptr -= detect_jump_type(jump, code_ptr, code, executable_offset); in sljit_generate_code()
429 jump = jump->next; in sljit_generate_code()
440 next_addr = compute_next_addr(label, jump, const_, put_label); in sljit_generate_code()
456 SLJIT_ASSERT(!jump); in sljit_generate_code()
461 jump = compiler->jumps; in sljit_generate_code()
462 while (jump) { in sljit_generate_code()
463 set_jump_instruction(jump, executable_offset); in sljit_generate_code()
464 jump = jump->next; in sljit_generate_code()
2274 struct sljit_jump *jump; in sljit_emit_jump() local
2280 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_jump()
2281 PTR_FAIL_IF(!jump); in sljit_emit_jump()
2282 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_jump()
2287 jump->flags |= IS_COND; in sljit_emit_jump()
2289 jump->flags |= cc << 8; in sljit_emit_jump()
2293 jump->addr = compiler->size; in sljit_emit_jump()
2297 jump->flags |= IS_BL; in sljit_emit_jump()
2301 return jump; in sljit_emit_jump()
2486 struct sljit_jump *jump; in sljit_emit_call() local
2502 jump = sljit_emit_jump(compiler, type); in sljit_emit_call()
2503 PTR_FAIL_IF(jump == NULL); in sljit_emit_call()
2514 return jump; in sljit_emit_call()
2520 return jump; in sljit_emit_call()
2541 struct sljit_jump *jump; in sljit_emit_ijump() local
2561 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_ijump()
2562 FAIL_IF(!jump); in sljit_emit_ijump()
2563 set_jump(jump, compiler, JUMP_ADDR | ((type >= SLJIT_FAST_CALL) ? IS_BL : 0)); in sljit_emit_ijump()
2564 jump->u.target = (sljit_uw)srcw; in sljit_emit_ijump()
2567 jump->addr = compiler->size; in sljit_emit_ijump()