Lines Matching refs:jump

240 static SLJIT_INLINE sljit_s32 detect_jump_type(struct sljit_jump *jump, sljit_u16 *code_ptr, sljit_…  in detect_jump_type()  argument
244 if (jump->flags & SLJIT_REWRITABLE_JUMP) in detect_jump_type()
247 if (jump->flags & JUMP_ADDR) { in detect_jump_type()
249 if (!(jump->u.target & 0x1)) in detect_jump_type()
251 diff = ((sljit_sw)jump->u.target - (sljit_sw)(code_ptr + 2) - executable_offset) >> 1; in detect_jump_type()
254 SLJIT_ASSERT(jump->flags & JUMP_LABEL); in detect_jump_type()
255 diff = ((sljit_sw)(code + jump->u.label->size) - (sljit_sw)(code_ptr + 2)) >> 1; in detect_jump_type()
258 if (jump->flags & IS_COND) { in detect_jump_type()
259 SLJIT_ASSERT(!(jump->flags & IS_BL)); in detect_jump_type()
261 jump->flags |= PATCH_TYPE1; in detect_jump_type()
265 jump->flags |= PATCH_TYPE2; in detect_jump_type()
271 jump->flags |= PATCH_TYPE3; in detect_jump_type()
275 else if (jump->flags & IS_BL) { in detect_jump_type()
277 jump->flags |= PATCH_BL; in detect_jump_type()
283 jump->flags |= PATCH_TYPE4; in detect_jump_type()
287 jump->flags |= PATCH_TYPE5; in detect_jump_type()
295 static SLJIT_INLINE void set_jump_instruction(struct sljit_jump *jump, sljit_sw executable_offset) in set_jump_instruction() argument
297 sljit_s32 type = (jump->flags >> 4) & 0xf; in set_jump_instruction()
303 …modify_imm32_const((sljit_u16*)jump->addr, (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump in set_jump_instruction()
307 if (jump->flags & JUMP_ADDR) { in set_jump_instruction()
308 SLJIT_ASSERT(jump->u.target & 0x1); in set_jump_instruction()
309 …diff = ((sljit_sw)jump->u.target - (sljit_sw)(jump->addr + sizeof(sljit_u32)) - executable_offset)… in set_jump_instruction()
312 SLJIT_ASSERT(jump->u.label->addr & 0x1); in set_jump_instruction()
313 …diff = ((sljit_sw)(jump->u.label->addr) - (sljit_sw)(jump->addr + sizeof(sljit_u32)) - executable_… in set_jump_instruction()
315 jump_inst = (sljit_u16*)jump->addr; in set_jump_instruction()
320 SLJIT_ASSERT(diff <= 127 && diff >= -128 && (jump->flags & IS_COND)); in set_jump_instruction()
321 jump_inst[0] = 0xd000 | (jump->flags & 0xf00) | (diff & 0xff); in set_jump_instruction()
325 SLJIT_ASSERT(diff <= 524287 && diff >= -524288 && (jump->flags & IS_COND)); in set_jump_instruction()
326 …jump_inst[0] = 0xf000 | COPY_BITS(jump->flags, 8, 6, 4) | COPY_BITS(diff, 11, 0, 6) | COPY_BITS(di… in set_jump_instruction()
330 SLJIT_ASSERT(jump->flags & IS_COND); in set_jump_instruction()
331 *jump_inst++ = IT | ((jump->flags >> 4) & 0xf0) | 0x8; in set_jump_instruction()
337 SLJIT_ASSERT(diff <= 1023 && diff >= -1024 && !(jump->flags & IS_COND)); in set_jump_instruction()
372 struct sljit_jump *jump; in sljit_generate_code() local
390 jump = compiler->jumps; in sljit_generate_code()
401 SLJIT_ASSERT(!jump || jump->addr >= half_count); in sljit_generate_code()
411 if (jump && jump->addr == half_count) { in sljit_generate_code()
412 jump->addr = (sljit_uw)code_ptr - ((jump->flags & IS_COND) ? 10 : 8); in sljit_generate_code()
413 code_ptr -= detect_jump_type(jump, code_ptr, code, executable_offset); in sljit_generate_code()
414 jump = jump->next; in sljit_generate_code()
425 next_addr = compute_next_addr(label, jump, const_, put_label); in sljit_generate_code()
441 SLJIT_ASSERT(!jump); in sljit_generate_code()
446 jump = compiler->jumps; in sljit_generate_code()
447 while (jump) { in sljit_generate_code()
448 set_jump_instruction(jump, executable_offset); in sljit_generate_code()
449 jump = jump->next; in sljit_generate_code()
1845 struct sljit_jump *jump; in sljit_emit_jump() local
1851 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_jump()
1852 PTR_FAIL_IF(!jump); in sljit_emit_jump()
1853 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_jump()
1858 jump->flags |= IS_COND; in sljit_emit_jump()
1860 jump->flags |= cc << 8; in sljit_emit_jump()
1864 jump->addr = compiler->size; in sljit_emit_jump()
1868 jump->flags |= IS_BL; in sljit_emit_jump()
1872 return jump; in sljit_emit_jump()
2079 struct sljit_jump *jump; in sljit_emit_call() local
2093 jump = sljit_emit_jump(compiler, type); in sljit_emit_call()
2094 PTR_FAIL_IF(jump == NULL); in sljit_emit_call()
2097 return jump; in sljit_emit_call()
2112 struct sljit_jump *jump; in sljit_emit_ijump() local
2132 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_ijump()
2133 FAIL_IF(!jump); in sljit_emit_ijump()
2134 set_jump(jump, compiler, JUMP_ADDR | ((type >= SLJIT_FAST_CALL) ? IS_BL : 0)); in sljit_emit_ijump()
2135 jump->u.target = srcw; in sljit_emit_ijump()
2138 jump->addr = compiler->size; in sljit_emit_ijump()