Lines Matching refs:jump

487 static SLJIT_INLINE sljit_ins* detect_jump_type(struct sljit_jump *jump, sljit_ins *code, sljit_sw …  in detect_jump_type()  argument
494 inst = (sljit_ins *)jump->addr; in detect_jump_type()
497 if (jump->flags & (SLJIT_REWRITABLE_JUMP | IS_CALL)) in detect_jump_type()
500 if (jump->flags & SLJIT_REWRITABLE_JUMP) in detect_jump_type()
504 if (jump->flags & JUMP_ADDR) in detect_jump_type()
505 target_addr = jump->u.target; in detect_jump_type()
507 SLJIT_ASSERT(jump->u.label != NULL); in detect_jump_type()
508 target_addr = (sljit_uw)(code + jump->u.label->size) + (sljit_uw)executable_offset; in detect_jump_type()
511 if (jump->flags & IS_COND) in detect_jump_type()
515 if (jump->flags & IS_CALL) in detect_jump_type()
520 if (jump->flags & IS_MOVABLE) { in detect_jump_type()
523 jump->flags |= PATCH_B; in detect_jump_type()
525 if (!(jump->flags & IS_COND)) { in detect_jump_type()
527 inst[-1] = (jump->flags & IS_JAL) ? BAL : B; in detect_jump_type()
528 jump->addr -= sizeof(sljit_ins); in detect_jump_type()
533 inst[-1] = saved_inst ^ invert_branch(jump->flags); in detect_jump_type()
534 jump->addr -= 2 * sizeof(sljit_ins); in detect_jump_type()
540 jump->flags |= PATCH_B; in detect_jump_type()
542 if (!(jump->flags & IS_COND)) { in detect_jump_type()
543 inst[0] = (jump->flags & IS_JAL) ? BAL : B; in detect_jump_type()
547 inst[0] ^= invert_branch(jump->flags); in detect_jump_type()
549 jump->addr -= sizeof(sljit_ins); in detect_jump_type()
554 if (jump->flags & IS_COND) { in detect_jump_type()
555 …if ((jump->flags & IS_MOVABLE) && (target_addr & ~(sljit_uw)0xfffffff) == ((jump->addr + 2 * sizeo… in detect_jump_type()
556 jump->flags |= PATCH_J; in detect_jump_type()
564 …else if ((target_addr & ~(sljit_uw)0xfffffff) == ((jump->addr + 3 * sizeof(sljit_ins)) & ~(sljit_u… in detect_jump_type()
565 jump->flags |= PATCH_J; in detect_jump_type()
570 jump->addr += sizeof(sljit_ins); in detect_jump_type()
576 …if ((jump->flags & IS_MOVABLE) && (target_addr & ~(sljit_uw)0xfffffff) == (jump->addr & ~(sljit_uw… in detect_jump_type()
577 jump->flags |= PATCH_J; in detect_jump_type()
579 inst[-1] = (jump->flags & IS_JAL) ? JAL : J; in detect_jump_type()
580 jump->addr -= sizeof(sljit_ins); in detect_jump_type()
584 …if ((target_addr & ~(sljit_uw)0xfffffff) == ((jump->addr + sizeof(sljit_ins)) & ~(sljit_uw)0xfffff… in detect_jump_type()
585 jump->flags |= PATCH_J; in detect_jump_type()
586 inst[0] = (jump->flags & IS_JAL) ? JAL : J; in detect_jump_type()
592 if (jump->flags & IS_COND) in detect_jump_type()
598 jump->flags |= PATCH_ABS32; in detect_jump_type()
599 if (jump->flags & IS_COND) in detect_jump_type()
607 jump->flags |= PATCH_ABS48; in detect_jump_type()
608 if (jump->flags & IS_COND) in detect_jump_type()
638 static SLJIT_INLINE sljit_sw mov_addr_get_length(struct sljit_jump *jump, sljit_ins *code, sljit_sw… in mov_addr_get_length() argument
643 if (jump->flags & JUMP_ADDR) in mov_addr_get_length()
644 addr = jump->u.target; in mov_addr_get_length()
646 addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code + jump->u.label->size, executable_offset); in mov_addr_get_length()
649 jump->flags |= PATCH_ABS32; in mov_addr_get_length()
654 jump->flags |= PATCH_ABS48; in mov_addr_get_length()
663 static SLJIT_INLINE void load_addr_to_reg(struct sljit_jump *jump) in load_addr_to_reg() argument
665 sljit_uw flags = jump->flags; in load_addr_to_reg()
666 sljit_ins *ins = (sljit_ins*)jump->addr; in load_addr_to_reg()
667 sljit_uw addr = (flags & JUMP_ADDR) ? jump->u.target : jump->u.label->u.addr; in load_addr_to_reg()
709 struct sljit_jump *jump; in sljit_generate_code() local
723 jump = compiler->jumps; in sljit_generate_code()
735 SLJIT_ASSERT(!jump || jump->addr >= word_count); in sljit_generate_code()
747 if (!(jump->flags & JUMP_MOV_ADDR)) { in sljit_generate_code()
753 jump->addr = (sljit_uw)(code_ptr - 1); in sljit_generate_code()
754 code_ptr = detect_jump_type(jump, code, executable_offset); in sljit_generate_code()
756 jump->addr = (sljit_uw)code_ptr; in sljit_generate_code()
761 code_ptr += mov_addr_get_length(jump, code, executable_offset); in sljit_generate_code()
766 jump = jump->next; in sljit_generate_code()
767 next_jump_addr = SLJIT_GET_NEXT_ADDRESS(jump); in sljit_generate_code()
790 SLJIT_ASSERT(!jump); in sljit_generate_code()
794 jump = compiler->jumps; in sljit_generate_code()
795 while (jump) { in sljit_generate_code()
797 addr = (jump->flags & JUMP_ADDR) ? jump->u.target : jump->u.label->u.addr; in sljit_generate_code()
798 buf_ptr = (sljit_ins *)jump->addr; in sljit_generate_code()
800 if (jump->flags & PATCH_B) { in sljit_generate_code()
806 if (jump->flags & PATCH_J) { in sljit_generate_code()
813 load_addr_to_reg(jump); in sljit_generate_code()
816 jump = jump->next; in sljit_generate_code()
3289 struct sljit_jump *jump; in sljit_emit_jump() local
3297 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_jump()
3298 PTR_FAIL_IF(!jump); in sljit_emit_jump()
3299 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_jump()
3355 jump->flags |= flags; in sljit_emit_jump()
3357 jump->flags |= IS_MOVABLE; in sljit_emit_jump()
3365 jump->flags |= IS_JAL; in sljit_emit_jump()
3369 jump->addr = compiler->size; in sljit_emit_jump()
3378 return jump; in sljit_emit_jump()
3405 struct sljit_jump *jump; in sljit_emit_cmp() local
3433 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_cmp()
3434 PTR_FAIL_IF(!jump); in sljit_emit_cmp()
3435 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_cmp()
3441 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
3443 jump->flags |= IS_MOVABLE; in sljit_emit_cmp()
3452 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
3456 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
3460 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
3464 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
3474 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
3478 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
3482 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
3486 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
3514 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
3519 jump->addr = compiler->size; in sljit_emit_cmp()
3528 return jump; in sljit_emit_cmp()
3542 struct sljit_jump *jump = NULL; in sljit_emit_ijump() local
3548 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_ijump()
3549 FAIL_IF(!jump); in sljit_emit_ijump()
3550 set_jump(jump, compiler, JUMP_ADDR | ((type >= SLJIT_FAST_CALL) ? IS_JAL : 0)); in sljit_emit_ijump()
3551 jump->u.target = (sljit_uw)srcw; in sljit_emit_ijump()
3554 jump->flags |= IS_MOVABLE; in sljit_emit_ijump()
3568 if (jump != NULL) { in sljit_emit_ijump()
3569 jump->addr = compiler->size; in sljit_emit_ijump()
3749 struct sljit_jump *jump; in sljit_emit_select() local
3801 jump = sljit_emit_jump(compiler, (type & ~SLJIT_32) ^ 0x1); in sljit_emit_select()
3802 FAIL_IF(!jump); in sljit_emit_select()
3819 sljit_set_label(jump, label); in sljit_emit_select()
3831 struct sljit_jump *jump; in sljit_emit_fselect() local
3858 jump = sljit_emit_jump(compiler, (type & ~SLJIT_32) ^ 0x1); in sljit_emit_fselect()
3859 FAIL_IF(!jump); in sljit_emit_fselect()
3870 sljit_set_label(jump, label); in sljit_emit_fselect()
4236 struct sljit_jump *jump; in sljit_emit_mov_addr() local
4243 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_mov_addr()
4244 PTR_FAIL_IF(!jump); in sljit_emit_mov_addr()
4245 set_mov_addr(jump, compiler, 0); in sljit_emit_mov_addr()
4258 return jump; in sljit_emit_mov_addr()