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()
1916 struct sljit_jump *jump; in sljit_emit_jump() local
1922 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_jump()
1923 PTR_FAIL_IF(!jump); in sljit_emit_jump()
1924 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_jump()
1930 jump->flags |= IS_COND; in sljit_emit_jump()
1932 jump->flags |= cc << 8; in sljit_emit_jump()
1936 jump->addr = compiler->size; in sljit_emit_jump()
1940 jump->flags |= IS_BL; in sljit_emit_jump()
1944 return jump; in sljit_emit_jump()
1949 struct sljit_jump *jump; in sljit_emit_ijump() local
1965 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_ijump()
1966 FAIL_IF(!jump); in sljit_emit_ijump()
1967 set_jump(jump, compiler, JUMP_ADDR | ((type >= SLJIT_FAST_CALL) ? IS_BL : 0)); in sljit_emit_ijump()
1968 jump->u.target = srcw; in sljit_emit_ijump()
1971 jump->addr = compiler->size; in sljit_emit_ijump()