Lines Matching refs:jmp_offset
713 enum loongarch_gpr rd, int jmp_offset)
717 /* PC += jmp_offset if rj == rd */
718 emit_insn(ctx, beq, rj, rd, jmp_offset);
722 /* PC += jmp_offset if rj != rd */
723 emit_insn(ctx, bne, rj, rd, jmp_offset);
726 /* PC += jmp_offset if rj > rd (unsigned) */
727 emit_insn(ctx, bltu, rd, rj, jmp_offset);
730 /* PC += jmp_offset if rj < rd (unsigned) */
731 emit_insn(ctx, bltu, rj, rd, jmp_offset);
734 /* PC += jmp_offset if rj >= rd (unsigned) */
735 emit_insn(ctx, bgeu, rj, rd, jmp_offset);
738 /* PC += jmp_offset if rj <= rd (unsigned) */
739 emit_insn(ctx, bgeu, rd, rj, jmp_offset);
742 /* PC += jmp_offset if rj > rd (signed) */
743 emit_insn(ctx, blt, rd, rj, jmp_offset);
746 /* PC += jmp_offset if rj < rd (signed) */
747 emit_insn(ctx, blt, rj, rd, jmp_offset);
750 /* PC += jmp_offset if rj >= rd (signed) */
751 emit_insn(ctx, bge, rj, rd, jmp_offset);
754 /* PC += jmp_offset if rj <= rd (signed) */
755 emit_insn(ctx, bge, rd, rj, jmp_offset);
761 enum loongarch_gpr rd, int jmp_offset)
765 emit_insn(ctx, b, jmp_offset);
769 enum loongarch_gpr rd, int jmp_offset)
773 upper = (jmp_offset + (1 << 15)) >> 16;
774 lower = jmp_offset & 0xffff;
780 * jmp_addr = jmp_offset << 2
789 static inline void uncond_jump_offs26(struct jit_ctx *ctx, int jmp_offset)
791 emit_insn(ctx, b, jmp_offset);
794 static inline void uncond_jump_offs32(struct jit_ctx *ctx, int jmp_offset, bool is_exit)
798 upper = (jmp_offset + (1 << 15)) >> 16;
799 lower = jmp_offset & 0xffff;
805 * jmp_addr = jmp_offset << 2;
815 enum loongarch_gpr rd, int jmp_offset)
817 if (is_signed_imm16(jmp_offset))
818 cond_jump_offs16(ctx, cond, rj, rd, jmp_offset);
819 else if (is_signed_imm26(jmp_offset))
820 cond_jump_offs26(ctx, cond, rj, rd, jmp_offset);
822 cond_jump_offs32(ctx, cond, rj, rd, jmp_offset);
825 static inline void emit_uncond_jump(struct jit_ctx *ctx, int jmp_offset, bool is_exit)
827 if (is_signed_imm26(jmp_offset))
828 uncond_jump_offs26(ctx, jmp_offset);
830 uncond_jump_offs32(ctx, jmp_offset, is_exit);
834 enum loongarch_gpr rd, int jmp_offset)
836 if (is_signed_imm16(jmp_offset))
837 cond_jump_offs16(ctx, cond, rj, rd, jmp_offset);
838 else if (is_signed_imm26(jmp_offset))
839 cond_jump_offs26(ctx, cond, rj, rd, jmp_offset - 1);
841 cond_jump_offs32(ctx, cond, rj, rd, jmp_offset - 2);