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
224 return imm >= -0x8000 && imm <= 0x7fff; in valid_alu_i()
229 return imm >= -0x7fff && imm <= 0x8000; in valid_alu_i()
234 return imm >= 0 && imm <= 0xffff; in valid_alu_i()
237 return imm == 0 || (imm > 0 && is_power_of_2(imm)); in valid_alu_i()
241 return (u32)imm <= 0x10000 && is_power_of_2((u32)imm); in valid_alu_i()
247 bool rewrite_alu_i(u8 op, s32 imm, u8 *alu, s32 *val) in rewrite_alu_i() argument
260 act = imm != 0; in rewrite_alu_i()
263 if (imm == 1) { in rewrite_alu_i()
266 } else if (imm == 0) { in rewrite_alu_i()
272 imm = ilog2(abs(imm)); in rewrite_alu_i()
276 if (imm == 1) { in rewrite_alu_i()
282 imm = ilog2(imm); in rewrite_alu_i()
288 imm--; in rewrite_alu_i()
293 *val = imm; in rewrite_alu_i()
298 void emit_alu_i(struct jit_context *ctx, u8 dst, s32 imm, u8 op) in emit_alu_i() argument
307 emit(ctx, andi, dst, dst, (u16)imm); in emit_alu_i()
311 emit(ctx, ori, dst, dst, (u16)imm); in emit_alu_i()
315 emit(ctx, xori, dst, dst, (u16)imm); in emit_alu_i()
319 emit(ctx, sll, dst, dst, imm); in emit_alu_i()
323 emit(ctx, srl, dst, dst, imm); in emit_alu_i()
327 emit(ctx, sra, dst, dst, imm); in emit_alu_i()
331 emit(ctx, addiu, dst, dst, imm); in emit_alu_i()
335 emit(ctx, addiu, dst, dst, -imm); in emit_alu_i()
502 bool valid_jmp_i(u8 op, s32 imm) in valid_jmp_i() argument
515 return imm >= 0 && imm <= 0xffff; in valid_jmp_i()
521 return imm >= -0x8000 && imm <= 0x7fff; in valid_jmp_i()
527 return imm >= -0x8001 && imm <= 0x7ffe; in valid_jmp_i()
605 void setup_jmp_i(struct jit_context *ctx, s32 imm, u8 width, in setup_jmp_i() argument
617 never = imm == 0; in setup_jmp_i()
620 always = imm == 0; in setup_jmp_i()
623 never = (u32)imm == U32_MAX; in setup_jmp_i()
626 always = (u32)imm == U32_MAX; in setup_jmp_i()
629 never = imm == S32_MAX && width == 32; in setup_jmp_i()
632 always = imm == S32_MIN && width == 32; in setup_jmp_i()
635 never = imm == S32_MIN && width == 32; in setup_jmp_i()
638 always = imm == S32_MAX && width == 32; in setup_jmp_i()
698 void emit_jmp_i(struct jit_context *ctx, u8 dst, s32 imm, s32 off, u8 op) in emit_jmp_i() argument
706 emit(ctx, andi, MIPS_R_T9, dst, (u16)imm); in emit_jmp_i()
711 emit(ctx, andi, MIPS_R_T9, dst, (u16)imm); in emit_jmp_i()
716 emit(ctx, sltiu, MIPS_R_T9, dst, imm + 1); in emit_jmp_i()
721 emit(ctx, sltiu, MIPS_R_T9, dst, imm); in emit_jmp_i()
726 emit(ctx, sltiu, MIPS_R_T9, dst, imm); in emit_jmp_i()
731 emit(ctx, sltiu, MIPS_R_T9, dst, imm + 1); in emit_jmp_i()
736 emit(ctx, slti, MIPS_R_T9, dst, imm + 1); in emit_jmp_i()
741 emit(ctx, slti, MIPS_R_T9, dst, imm); in emit_jmp_i()
746 emit(ctx, slti, MIPS_R_T9, dst, imm); in emit_jmp_i()
751 emit(ctx, slti, MIPS_R_T9, dst, imm + 1); in emit_jmp_i()