Lines Matching refs:jump

351 static SLJIT_INLINE sljit_ins* detect_jump_type(struct sljit_jump *jump, sljit_ins *code, sljit_sw …  in detect_jump_type()  argument
358 inst = (sljit_ins *)jump->addr; in detect_jump_type()
361 if (jump->flags & (SLJIT_REWRITABLE_JUMP | IS_CALL)) in detect_jump_type()
364 if (jump->flags & SLJIT_REWRITABLE_JUMP) in detect_jump_type()
368 if (jump->flags & JUMP_ADDR) in detect_jump_type()
369 target_addr = jump->u.target; in detect_jump_type()
371 SLJIT_ASSERT(jump->flags & JUMP_LABEL); in detect_jump_type()
372 target_addr = (sljit_uw)(code + jump->u.label->size) + (sljit_uw)executable_offset; in detect_jump_type()
375 if (jump->flags & IS_COND) in detect_jump_type()
379 if (jump->flags & IS_CALL) in detect_jump_type()
384 if (jump->flags & IS_MOVABLE) { in detect_jump_type()
387 jump->flags |= PATCH_B; in detect_jump_type()
389 if (!(jump->flags & IS_COND)) { in detect_jump_type()
391 inst[-1] = (jump->flags & IS_JAL) ? BAL : B; in detect_jump_type()
392 jump->addr -= sizeof(sljit_ins); in detect_jump_type()
397 inst[-1] = saved_inst ^ invert_branch(jump->flags); in detect_jump_type()
398 jump->addr -= 2 * sizeof(sljit_ins); in detect_jump_type()
404 jump->flags |= PATCH_B; in detect_jump_type()
406 if (!(jump->flags & IS_COND)) { in detect_jump_type()
407 inst[0] = (jump->flags & IS_JAL) ? BAL : B; in detect_jump_type()
411 inst[0] ^= invert_branch(jump->flags); in detect_jump_type()
413 jump->addr -= sizeof(sljit_ins); in detect_jump_type()
418 if (jump->flags & IS_COND) { in detect_jump_type()
419 …if ((jump->flags & IS_MOVABLE) && (target_addr & ~(sljit_uw)0xfffffff) == ((jump->addr + 2 * sizeo… in detect_jump_type()
420 jump->flags |= PATCH_J; in detect_jump_type()
428 …else if ((target_addr & ~(sljit_uw)0xfffffff) == ((jump->addr + 3 * sizeof(sljit_ins)) & ~(sljit_u… in detect_jump_type()
429 jump->flags |= PATCH_J; in detect_jump_type()
434 jump->addr += sizeof(sljit_ins); in detect_jump_type()
440 …if ((jump->flags & IS_MOVABLE) && (target_addr & ~(sljit_uw)0xfffffff) == (jump->addr & ~(sljit_uw… in detect_jump_type()
441 jump->flags |= PATCH_J; in detect_jump_type()
443 inst[-1] = (jump->flags & IS_JAL) ? JAL : J; in detect_jump_type()
444 jump->addr -= sizeof(sljit_ins); in detect_jump_type()
448 …if ((target_addr & ~(sljit_uw)0xfffffff) == ((jump->addr + sizeof(sljit_ins)) & ~(sljit_uw)0xfffff… in detect_jump_type()
449 jump->flags |= PATCH_J; in detect_jump_type()
450 inst[0] = (jump->flags & IS_JAL) ? JAL : J; in detect_jump_type()
456 if (jump->flags & IS_COND) in detect_jump_type()
462 jump->flags |= PATCH_ABS32; in detect_jump_type()
463 if (jump->flags & IS_COND) in detect_jump_type()
471 jump->flags |= PATCH_ABS48; in detect_jump_type()
472 if (jump->flags & IS_COND) in detect_jump_type()
522 struct sljit_jump *jump; in load_addr_to_reg() local
529 jump = (struct sljit_jump*)dst; in load_addr_to_reg()
530 flags = jump->flags; in load_addr_to_reg()
531 inst = (sljit_ins*)jump->addr; in load_addr_to_reg()
532 addr = (flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target; in load_addr_to_reg()
583 struct sljit_jump *jump; in sljit_generate_code() local
601 jump = compiler->jumps; in sljit_generate_code()
612 SLJIT_ASSERT(!jump || jump->addr >= word_count); in sljit_generate_code()
622 if (jump && jump->addr == word_count) { in sljit_generate_code()
628 jump->addr = (sljit_uw)(code_ptr - 1); in sljit_generate_code()
629 code_ptr = detect_jump_type(jump, code, executable_offset); in sljit_generate_code()
630 jump = jump->next; in sljit_generate_code()
648 next_addr = compute_next_addr(label, jump, const_, put_label); in sljit_generate_code()
664 SLJIT_ASSERT(!jump); in sljit_generate_code()
669 jump = compiler->jumps; in sljit_generate_code()
670 while (jump) { in sljit_generate_code()
672 addr = (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target; in sljit_generate_code()
673 buf_ptr = (sljit_ins *)jump->addr; in sljit_generate_code()
675 if (jump->flags & PATCH_B) { in sljit_generate_code()
681 if (jump->flags & PATCH_J) { in sljit_generate_code()
688 load_addr_to_reg(jump, PIC_ADDR_REG); in sljit_generate_code()
690 jump = jump->next; in sljit_generate_code()
2894 struct sljit_jump *jump; in sljit_emit_jump() local
2902 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_jump()
2903 PTR_FAIL_IF(!jump); in sljit_emit_jump()
2904 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_jump()
2960 jump->flags |= flags; in sljit_emit_jump()
2962 jump->flags |= IS_MOVABLE; in sljit_emit_jump()
2970 jump->flags |= IS_JAL; in sljit_emit_jump()
2974 jump->addr = compiler->size; in sljit_emit_jump()
2983 return jump; in sljit_emit_jump()
3010 struct sljit_jump *jump; in sljit_emit_cmp() local
3037 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_cmp()
3038 PTR_FAIL_IF(!jump); in sljit_emit_cmp()
3039 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_cmp()
3045 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
3047 jump->flags |= IS_MOVABLE; in sljit_emit_cmp()
3057 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
3061 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
3065 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
3069 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
3079 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
3083 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
3087 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
3091 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
3119 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
3124 jump->addr = compiler->size; in sljit_emit_cmp()
3133 return jump; in sljit_emit_cmp()
3150 struct sljit_jump *jump = NULL; in sljit_emit_ijump() local
3156 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_ijump()
3157 FAIL_IF(!jump); in sljit_emit_ijump()
3158 set_jump(jump, compiler, JUMP_ADDR | ((type >= SLJIT_FAST_CALL) ? IS_JAL : 0)); in sljit_emit_ijump()
3159 jump->u.target = (sljit_uw)srcw; in sljit_emit_ijump()
3162 jump->flags |= IS_MOVABLE; in sljit_emit_ijump()
3176 if (jump != NULL) { in sljit_emit_ijump()
3177 jump->addr = compiler->size; in sljit_emit_ijump()