Lines Matching refs:jump

250 static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_u16 *code_ptr, sljit_…  in detect_jump_type()  argument
254 if (jump->flags & SLJIT_REWRITABLE_JUMP) in detect_jump_type()
257 if (jump->flags & JUMP_ADDR) { in detect_jump_type()
259 if (!(jump->u.target & 0x1)) in detect_jump_type()
261 diff = ((sljit_sw)jump->u.target - (sljit_sw)(code_ptr + 2) - executable_offset) >> 1; in detect_jump_type()
264 SLJIT_ASSERT(jump->flags & JUMP_LABEL); in detect_jump_type()
265 diff = ((sljit_sw)(code + jump->u.label->size) - (sljit_sw)(code_ptr + 2)) >> 1; in detect_jump_type()
268 if (jump->flags & IS_COND) { in detect_jump_type()
269 SLJIT_ASSERT(!(jump->flags & IS_BL)); in detect_jump_type()
271 jump->flags |= PATCH_TYPE1; in detect_jump_type()
275 jump->flags |= PATCH_TYPE2; in detect_jump_type()
281 jump->flags |= PATCH_TYPE3; in detect_jump_type()
285 else if (jump->flags & IS_BL) { in detect_jump_type()
287 jump->flags |= PATCH_BL; in detect_jump_type()
293 jump->flags |= PATCH_TYPE4; in detect_jump_type()
297 jump->flags |= PATCH_TYPE5; in detect_jump_type()
305 static SLJIT_INLINE void set_jump_instruction(struct sljit_jump *jump, sljit_sw executable_offset) in set_jump_instruction() argument
307 sljit_s32 type = (jump->flags >> 4) & 0xf; in set_jump_instruction()
313 …modify_imm32_const((sljit_u16*)jump->addr, (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump in set_jump_instruction()
317 if (jump->flags & JUMP_ADDR) { in set_jump_instruction()
318 SLJIT_ASSERT(jump->u.target & 0x1); in set_jump_instruction()
319 …diff = ((sljit_sw)jump->u.target - (sljit_sw)(jump->addr + sizeof(sljit_u32)) - executable_offset)… in set_jump_instruction()
322 SLJIT_ASSERT(jump->u.label->addr & 0x1); in set_jump_instruction()
323 …diff = ((sljit_sw)(jump->u.label->addr) - (sljit_sw)(jump->addr + sizeof(sljit_u32)) - executable_… in set_jump_instruction()
325 jump_inst = (sljit_u16*)jump->addr; in set_jump_instruction()
330 SLJIT_ASSERT(diff <= 127 && diff >= -128 && (jump->flags & IS_COND)); in set_jump_instruction()
331 jump_inst[0] = (sljit_u16)(0xd000 | (jump->flags & 0xf00) | ((sljit_ins)diff & 0xff)); in set_jump_instruction()
335 SLJIT_ASSERT(diff <= 524287 && diff >= -524288 && (jump->flags & IS_COND)); in set_jump_instruction()
336 …jump_inst[0] = (sljit_u16)(0xf000 | COPY_BITS(jump->flags, 8, 6, 4) | COPY_BITS(diff, 11, 0, 6) | … in set_jump_instruction()
340 SLJIT_ASSERT(jump->flags & IS_COND); in set_jump_instruction()
341 *jump_inst++ = (sljit_u16)(IT | ((jump->flags >> 4) & 0xf0) | 0x8); in set_jump_instruction()
347 SLJIT_ASSERT(diff <= 1023 && diff >= -1024 && !(jump->flags & IS_COND)); in set_jump_instruction()
382 struct sljit_jump *jump; in sljit_generate_code() local
400 jump = compiler->jumps; in sljit_generate_code()
411 SLJIT_ASSERT(!jump || jump->addr >= half_count); in sljit_generate_code()
421 if (jump && jump->addr == half_count) { in sljit_generate_code()
422 jump->addr = (sljit_uw)code_ptr - ((jump->flags & IS_COND) ? 10 : 8); in sljit_generate_code()
423 code_ptr -= detect_jump_type(jump, code_ptr, code, executable_offset); in sljit_generate_code()
424 jump = jump->next; in sljit_generate_code()
435 next_addr = compute_next_addr(label, jump, const_, put_label); in sljit_generate_code()
451 SLJIT_ASSERT(!jump); in sljit_generate_code()
456 jump = compiler->jumps; in sljit_generate_code()
457 while (jump) { in sljit_generate_code()
458 set_jump_instruction(jump, executable_offset); in sljit_generate_code()
459 jump = jump->next; in sljit_generate_code()
2072 struct sljit_jump *jump; in sljit_emit_jump() local
2078 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_jump()
2079 PTR_FAIL_IF(!jump); in sljit_emit_jump()
2080 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_jump()
2085 jump->flags |= IS_COND; in sljit_emit_jump()
2087 jump->flags |= cc << 8; in sljit_emit_jump()
2091 jump->addr = compiler->size; in sljit_emit_jump()
2095 jump->flags |= IS_BL; in sljit_emit_jump()
2099 return jump; in sljit_emit_jump()
2284 struct sljit_jump *jump; in sljit_emit_call() local
2303 jump = sljit_emit_jump(compiler, type); in sljit_emit_call()
2304 PTR_FAIL_IF(jump == NULL); in sljit_emit_call()
2315 return jump; in sljit_emit_call()
2321 return jump; in sljit_emit_call()
2342 struct sljit_jump *jump; in sljit_emit_ijump() local
2362 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_ijump()
2363 FAIL_IF(!jump); in sljit_emit_ijump()
2364 set_jump(jump, compiler, JUMP_ADDR | ((type >= SLJIT_FAST_CALL) ? IS_BL : 0)); in sljit_emit_ijump()
2365 jump->u.target = (sljit_uw)srcw; in sljit_emit_ijump()
2368 jump->addr = compiler->size; in sljit_emit_ijump()