Lines Matching refs:jump

224 static SLJIT_INLINE sljit_si detect_jump_type(struct sljit_jump *jump, sljit_uh *code_ptr, sljit_uh…  in detect_jump_type()  argument
228 if (jump->flags & SLJIT_REWRITABLE_JUMP) in detect_jump_type()
231 if (jump->flags & JUMP_ADDR) { in detect_jump_type()
233 if (!(jump->u.target & 0x1)) in detect_jump_type()
235 diff = ((sljit_sw)jump->u.target - (sljit_sw)(code_ptr + 2)) >> 1; in detect_jump_type()
238 SLJIT_ASSERT(jump->flags & JUMP_LABEL); in detect_jump_type()
239 diff = ((sljit_sw)(code + jump->u.label->size) - (sljit_sw)(code_ptr + 2)) >> 1; in detect_jump_type()
242 if (jump->flags & IS_COND) { in detect_jump_type()
243 SLJIT_ASSERT(!(jump->flags & IS_BL)); in detect_jump_type()
245 jump->flags |= PATCH_TYPE1; in detect_jump_type()
249 jump->flags |= PATCH_TYPE2; in detect_jump_type()
255 jump->flags |= PATCH_TYPE3; in detect_jump_type()
259 else if (jump->flags & IS_BL) { in detect_jump_type()
261 jump->flags |= PATCH_BL; in detect_jump_type()
267 jump->flags |= PATCH_TYPE4; in detect_jump_type()
271 jump->flags |= PATCH_TYPE5; in detect_jump_type()
279 static SLJIT_INLINE void set_jump_instruction(struct sljit_jump *jump) in set_jump_instruction() argument
281 sljit_si type = (jump->flags >> 4) & 0xf; in set_jump_instruction()
287 …modify_imm32_const((sljit_uh*)jump->addr, (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump-… in set_jump_instruction()
291 if (jump->flags & JUMP_ADDR) { in set_jump_instruction()
292 SLJIT_ASSERT(jump->u.target & 0x1); in set_jump_instruction()
293 diff = ((sljit_sw)jump->u.target - (sljit_sw)(jump->addr + 4)) >> 1; in set_jump_instruction()
296 diff = ((sljit_sw)(jump->u.label->addr) - (sljit_sw)(jump->addr + 4)) >> 1; in set_jump_instruction()
297 jump_inst = (sljit_uh*)jump->addr; in set_jump_instruction()
302 SLJIT_ASSERT(diff <= 127 && diff >= -128 && (jump->flags & IS_COND)); in set_jump_instruction()
303 jump_inst[0] = 0xd000 | (jump->flags & 0xf00) | (diff & 0xff); in set_jump_instruction()
307 SLJIT_ASSERT(diff <= 524287 && diff >= -524288 && (jump->flags & IS_COND)); in set_jump_instruction()
308 …jump_inst[0] = 0xf000 | COPY_BITS(jump->flags, 8, 6, 4) | COPY_BITS(diff, 11, 0, 6) | COPY_BITS(di… in set_jump_instruction()
312 SLJIT_ASSERT(jump->flags & IS_COND); in set_jump_instruction()
313 *jump_inst++ = IT | ((jump->flags >> 4) & 0xf0) | 0x8; in set_jump_instruction()
319 SLJIT_ASSERT(diff <= 1023 && diff >= -1024 && !(jump->flags & IS_COND)); in set_jump_instruction()
352 struct sljit_jump *jump; in sljit_generate_code() local
366 jump = compiler->jumps; in sljit_generate_code()
376 SLJIT_ASSERT(!jump || jump->addr >= half_count); in sljit_generate_code()
383 if (jump && jump->addr == half_count) { in sljit_generate_code()
384 jump->addr = (sljit_uw)code_ptr - ((jump->flags & IS_COND) ? 10 : 8); in sljit_generate_code()
385 code_ptr -= detect_jump_type(jump, code_ptr, code); in sljit_generate_code()
386 jump = jump->next; in sljit_generate_code()
406 SLJIT_ASSERT(!jump); in sljit_generate_code()
410 jump = compiler->jumps; in sljit_generate_code()
411 while (jump) { in sljit_generate_code()
412 set_jump_instruction(jump); in sljit_generate_code()
413 jump = jump->next; in sljit_generate_code()
1884 struct sljit_jump *jump; in sljit_emit_jump() local
1890 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_jump()
1891 PTR_FAIL_IF(!jump); in sljit_emit_jump()
1892 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_jump()
1898 jump->flags |= IS_COND; in sljit_emit_jump()
1900 jump->flags |= cc << 8; in sljit_emit_jump()
1904 jump->addr = compiler->size; in sljit_emit_jump()
1908 jump->flags |= IS_BL; in sljit_emit_jump()
1912 return jump; in sljit_emit_jump()
1917 struct sljit_jump *jump; in sljit_emit_ijump() local
1933 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_ijump()
1934 FAIL_IF(!jump); in sljit_emit_ijump()
1935 set_jump(jump, compiler, JUMP_ADDR | ((type >= SLJIT_FAST_CALL) ? IS_BL : 0)); in sljit_emit_ijump()
1936 jump->u.target = srcw; in sljit_emit_ijump()
1939 jump->addr = compiler->size; in sljit_emit_ijump()