Lines Matching full:emit

61  *    Emit instructions for an ALU or ALU64 immediate or register operation.
97 * Emit instructions for an JMP or JMP32 immediate or register operation.
100 * Emit any instructions needed to finish the jump. This includes a nop
135 emit(ctx, sw, reg, depth, MIPS_R_SP); in push_regs()
137 emit(ctx, sd, reg, depth, MIPS_R_SP); in push_regs()
158 emit(ctx, lw, reg, depth, MIPS_R_SP); in pop_regs()
160 emit(ctx, ld, reg, depth, MIPS_R_SP); in pop_regs()
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()
206 emit(ctx, ori, dst, src, 0); in emit_mov_r()
303 emit(ctx, subu, dst, MIPS_R_ZERO, dst); in emit_alu_i()
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()
347 emit(ctx, and, dst, dst, src); in emit_alu_r()
351 emit(ctx, or, dst, dst, src); in emit_alu_r()
355 emit(ctx, xor, dst, dst, src); in emit_alu_r()
359 emit(ctx, sllv, dst, dst, src); in emit_alu_r()
363 emit(ctx, srlv, dst, dst, src); in emit_alu_r()
367 emit(ctx, srav, dst, dst, src); in emit_alu_r()
371 emit(ctx, addu, dst, dst, src); in emit_alu_r()
375 emit(ctx, subu, dst, dst, src); in emit_alu_r()
380 emit(ctx, mul, dst, dst, src); in emit_alu_r()
382 emit(ctx, multu, dst, src); in emit_alu_r()
383 emit(ctx, mflo, dst); in emit_alu_r()
389 emit(ctx, divu_r6, dst, dst, src); in emit_alu_r()
391 emit(ctx, divu, dst, src); in emit_alu_r()
392 emit(ctx, mflo, dst); in emit_alu_r()
398 emit(ctx, modu, dst, dst, src); in emit_alu_r()
400 emit(ctx, divu, dst, src); in emit_alu_r()
401 emit(ctx, mfhi, dst); in emit_alu_r()
412 emit(ctx, ll, MIPS_R_T9, off, dst); in emit_atomic_r()
416 emit(ctx, addu, MIPS_R_T8, MIPS_R_T9, src); in emit_atomic_r()
420 emit(ctx, and, MIPS_R_T8, MIPS_R_T9, src); in emit_atomic_r()
424 emit(ctx, or, MIPS_R_T8, MIPS_R_T9, src); in emit_atomic_r()
428 emit(ctx, xor, MIPS_R_T8, MIPS_R_T9, src); in emit_atomic_r()
431 emit(ctx, move, MIPS_R_T8, src); in emit_atomic_r()
434 emit(ctx, sc, MIPS_R_T8, off, dst); in emit_atomic_r()
435 emit(ctx, LLSC_beqz, MIPS_R_T8, -16 - LLSC_offset); in emit_atomic_r()
436 emit(ctx, nop); /* Delay slot */ in emit_atomic_r()
439 emit(ctx, move, src, MIPS_R_T9); in emit_atomic_r()
448 emit(ctx, ll, MIPS_R_T9, off, dst); in emit_cmpxchg_r()
449 emit(ctx, bne, MIPS_R_T9, res, 12); in emit_cmpxchg_r()
450 emit(ctx, move, MIPS_R_T8, src); /* Delay slot */ in emit_cmpxchg_r()
451 emit(ctx, sc, MIPS_R_T8, off, dst); in emit_cmpxchg_r()
452 emit(ctx, LLSC_beqz, MIPS_R_T8, -20 - LLSC_offset); in emit_cmpxchg_r()
453 emit(ctx, move, res, MIPS_R_T9); /* Delay slot */ in emit_cmpxchg_r()
467 emit(ctx, wsbh, dst, dst); in emit_bswap_r()
468 emit(ctx, rotr, dst, dst, 16); in emit_bswap_r()
470 emit(ctx, sll, tmp, dst, 16); /* tmp = dst << 16 */ in emit_bswap_r()
471 emit(ctx, srl, dst, dst, 16); /* dst = dst >> 16 */ in emit_bswap_r()
472 emit(ctx, or, dst, dst, tmp); /* dst = dst | tmp */ in emit_bswap_r()
474 emit(ctx, lui, msk, 0xff); /* msk = 0x00ff0000 */ in emit_bswap_r()
475 emit(ctx, ori, msk, msk, 0xff); /* msk = msk | 0xff */ in emit_bswap_r()
477 emit(ctx, and, tmp, dst, msk); /* tmp = dst & msk */ in emit_bswap_r()
478 emit(ctx, sll, tmp, tmp, 8); /* tmp = tmp << 8 */ in emit_bswap_r()
479 emit(ctx, srl, dst, dst, 8); /* dst = dst >> 8 */ in emit_bswap_r()
480 emit(ctx, and, dst, dst, msk); /* dst = dst & msk */ in emit_bswap_r()
481 emit(ctx, or, dst, dst, tmp); /* reg = dst | tmp */ in emit_bswap_r()
487 emit(ctx, wsbh, dst, dst); in emit_bswap_r()
488 emit(ctx, andi, dst, dst, 0xffff); in emit_bswap_r()
490 emit(ctx, andi, tmp, dst, 0xff00); /* t = d & 0xff00 */ in emit_bswap_r()
491 emit(ctx, srl, tmp, tmp, 8); /* t = t >> 8 */ in emit_bswap_r()
492 emit(ctx, andi, dst, dst, 0x00ff); /* d = d & 0x00ff */ in emit_bswap_r()
493 emit(ctx, sll, dst, dst, 8); /* d = d << 8 */ in emit_bswap_r()
494 emit(ctx, or, dst, dst, tmp); /* d = d | t */ in emit_bswap_r()
679 /* Emit conditional branch delay slot */ in finish_jmp()
681 emit(ctx, nop); in finish_jmp()
683 * Emit an absolute long jump with delay slot, in finish_jmp()
691 emit(ctx, j, target); in finish_jmp()
692 emit(ctx, nop); in finish_jmp()
706 emit(ctx, andi, MIPS_R_T9, dst, (u16)imm); in emit_jmp_i()
707 emit(ctx, bnez, MIPS_R_T9, off); in emit_jmp_i()
711 emit(ctx, andi, MIPS_R_T9, dst, (u16)imm); in emit_jmp_i()
712 emit(ctx, beqz, MIPS_R_T9, off); in emit_jmp_i()
716 emit(ctx, sltiu, MIPS_R_T9, dst, imm + 1); in emit_jmp_i()
717 emit(ctx, beqz, MIPS_R_T9, off); in emit_jmp_i()
721 emit(ctx, sltiu, MIPS_R_T9, dst, imm); in emit_jmp_i()
722 emit(ctx, beqz, MIPS_R_T9, off); in emit_jmp_i()
726 emit(ctx, sltiu, MIPS_R_T9, dst, imm); in emit_jmp_i()
727 emit(ctx, bnez, MIPS_R_T9, off); in emit_jmp_i()
731 emit(ctx, sltiu, MIPS_R_T9, dst, imm + 1); in emit_jmp_i()
732 emit(ctx, bnez, MIPS_R_T9, off); in emit_jmp_i()
736 emit(ctx, slti, MIPS_R_T9, dst, imm + 1); in emit_jmp_i()
737 emit(ctx, beqz, MIPS_R_T9, off); in emit_jmp_i()
741 emit(ctx, slti, MIPS_R_T9, dst, imm); in emit_jmp_i()
742 emit(ctx, beqz, MIPS_R_T9, off); in emit_jmp_i()
746 emit(ctx, slti, MIPS_R_T9, dst, imm); in emit_jmp_i()
747 emit(ctx, bnez, MIPS_R_T9, off); in emit_jmp_i()
751 emit(ctx, slti, MIPS_R_T9, dst, imm + 1); in emit_jmp_i()
752 emit(ctx, bnez, MIPS_R_T9, off); in emit_jmp_i()
766 emit(ctx, beq, dst, src, off); in emit_jmp_r()
770 emit(ctx, bne, dst, src, off); in emit_jmp_r()
774 emit(ctx, and, MIPS_R_T9, dst, src); in emit_jmp_r()
775 emit(ctx, bnez, MIPS_R_T9, off); in emit_jmp_r()
779 emit(ctx, and, MIPS_R_T9, dst, src); in emit_jmp_r()
780 emit(ctx, beqz, MIPS_R_T9, off); in emit_jmp_r()
784 emit(ctx, sltu, MIPS_R_T9, src, dst); in emit_jmp_r()
785 emit(ctx, bnez, MIPS_R_T9, off); in emit_jmp_r()
789 emit(ctx, sltu, MIPS_R_T9, dst, src); in emit_jmp_r()
790 emit(ctx, beqz, MIPS_R_T9, off); in emit_jmp_r()
794 emit(ctx, sltu, MIPS_R_T9, dst, src); in emit_jmp_r()
795 emit(ctx, bnez, MIPS_R_T9, off); in emit_jmp_r()
799 emit(ctx, sltu, MIPS_R_T9, src, dst); in emit_jmp_r()
800 emit(ctx, beqz, MIPS_R_T9, off); in emit_jmp_r()
804 emit(ctx, slt, MIPS_R_T9, src, dst); in emit_jmp_r()
805 emit(ctx, bnez, MIPS_R_T9, off); in emit_jmp_r()
809 emit(ctx, slt, MIPS_R_T9, dst, src); in emit_jmp_r()
810 emit(ctx, beqz, MIPS_R_T9, off); in emit_jmp_r()
814 emit(ctx, slt, MIPS_R_T9, dst, src); in emit_jmp_r()
815 emit(ctx, bnez, MIPS_R_T9, off); in emit_jmp_r()
819 emit(ctx, slt, MIPS_R_T9, src, dst); in emit_jmp_r()
820 emit(ctx, beqz, MIPS_R_T9, off); in emit_jmp_r()
832 emit(ctx, j, target); in emit_ja()
833 emit(ctx, nop); in emit_ja()
844 emit(ctx, j, target); in emit_exit()
845 emit(ctx, nop); in emit_exit()