Lines Matching refs:imm
192 void emit_mov_i(struct jit_context *ctx, u8 dst, s32 imm) in emit_mov_i() argument
194 if (imm >= -0x8000 && imm <= 0x7fff) { in emit_mov_i()
195 emit(ctx, addiu, dst, MIPS_R_ZERO, imm); in emit_mov_i()
197 emit(ctx, lui, dst, (s16)((u32)imm >> 16)); in emit_mov_i()
198 emit(ctx, ori, dst, dst, (u16)(imm & 0xffff)); in emit_mov_i()
211 bool valid_alu_i(u8 op, s32 imm) in valid_alu_i() argument
222 return imm >= -0x8000 && imm <= 0x7fff; in valid_alu_i()
225 return imm >= -0x7fff && imm <= 0x8000; in valid_alu_i()
230 return imm >= 0 && imm <= 0xffff; in valid_alu_i()
233 return imm == 0 || (imm > 0 && is_power_of_2(imm)); in valid_alu_i()
237 return (u32)imm <= 0x10000 && is_power_of_2((u32)imm); in valid_alu_i()
243 bool rewrite_alu_i(u8 op, s32 imm, u8 *alu, s32 *val) in rewrite_alu_i() argument
256 act = imm != 0; in rewrite_alu_i()
259 if (imm == 1) { in rewrite_alu_i()
262 } else if (imm == 0) { in rewrite_alu_i()
268 imm = ilog2(abs(imm)); in rewrite_alu_i()
272 if (imm == 1) { in rewrite_alu_i()
278 imm = ilog2(imm); in rewrite_alu_i()
284 imm--; in rewrite_alu_i()
289 *val = imm; in rewrite_alu_i()
294 void emit_alu_i(struct jit_context *ctx, u8 dst, s32 imm, u8 op) in emit_alu_i() argument
303 emit(ctx, andi, dst, dst, (u16)imm); in emit_alu_i()
307 emit(ctx, ori, dst, dst, (u16)imm); in emit_alu_i()
311 emit(ctx, xori, dst, dst, (u16)imm); in emit_alu_i()
315 emit(ctx, sll, dst, dst, imm); in emit_alu_i()
319 emit(ctx, srl, dst, dst, imm); in emit_alu_i()
323 emit(ctx, sra, dst, dst, imm); in emit_alu_i()
327 emit(ctx, addiu, dst, dst, imm); in emit_alu_i()
331 emit(ctx, addiu, dst, dst, -imm); in emit_alu_i()
498 bool valid_jmp_i(u8 op, s32 imm) in valid_jmp_i() argument
511 return imm >= 0 && imm <= 0xffff; in valid_jmp_i()
517 return imm >= -0x8000 && imm <= 0x7fff; in valid_jmp_i()
523 return imm >= -0x8001 && imm <= 0x7ffe; in valid_jmp_i()
601 void setup_jmp_i(struct jit_context *ctx, s32 imm, u8 width, in setup_jmp_i() argument
613 never = imm == 0; in setup_jmp_i()
616 always = imm == 0; in setup_jmp_i()
619 never = (u32)imm == U32_MAX; in setup_jmp_i()
622 always = (u32)imm == U32_MAX; in setup_jmp_i()
625 never = imm == S32_MAX && width == 32; in setup_jmp_i()
628 always = imm == S32_MIN && width == 32; in setup_jmp_i()
631 never = imm == S32_MIN && width == 32; in setup_jmp_i()
634 always = imm == S32_MAX && width == 32; in setup_jmp_i()
694 void emit_jmp_i(struct jit_context *ctx, u8 dst, s32 imm, s32 off, u8 op) in emit_jmp_i() argument
702 emit(ctx, andi, MIPS_R_T9, dst, (u16)imm); in emit_jmp_i()
707 emit(ctx, andi, MIPS_R_T9, dst, (u16)imm); in emit_jmp_i()
712 emit(ctx, sltiu, MIPS_R_T9, dst, imm + 1); in emit_jmp_i()
717 emit(ctx, sltiu, MIPS_R_T9, dst, imm); in emit_jmp_i()
722 emit(ctx, sltiu, MIPS_R_T9, dst, imm); in emit_jmp_i()
727 emit(ctx, sltiu, MIPS_R_T9, dst, imm + 1); in emit_jmp_i()
732 emit(ctx, slti, MIPS_R_T9, dst, imm + 1); in emit_jmp_i()
737 emit(ctx, slti, MIPS_R_T9, dst, imm); in emit_jmp_i()
742 emit(ctx, slti, MIPS_R_T9, dst, imm); in emit_jmp_i()
747 emit(ctx, slti, MIPS_R_T9, dst, imm + 1); in emit_jmp_i()