Lines Matching refs:emit

178 		emit(ctx, addiu, hi(dst), MIPS_R_ZERO, -1);
180 emit(ctx, move, hi(dst), MIPS_R_ZERO);
188 emit(ctx, move, hi(dst), MIPS_R_ZERO);
197 emit(ctx, nop);
228 emit(ctx, addu, lo(dst), lo(dst), src);
229 emit(ctx, sltu, MIPS_R_T9, lo(dst), src);
230 emit(ctx, addu, hi(dst), hi(dst), MIPS_R_T9);
232 emit(ctx, addiu, hi(dst), hi(dst), -1);
236 emit(ctx, sltu, MIPS_R_T9, lo(dst), src);
237 emit(ctx, subu, lo(dst), lo(dst), src);
238 emit(ctx, subu, hi(dst), hi(dst), MIPS_R_T9);
240 emit(ctx, addiu, hi(dst), hi(dst), 1);
244 emit(ctx, or, lo(dst), lo(dst), src);
246 emit(ctx, addiu, hi(dst), MIPS_R_ZERO, -1);
250 emit(ctx, and, lo(dst), lo(dst), src);
252 emit(ctx, move, hi(dst), MIPS_R_ZERO);
256 emit(ctx, xor, lo(dst), lo(dst), src);
258 emit(ctx, subu, hi(dst), MIPS_R_ZERO, hi(dst));
259 emit(ctx, addiu, hi(dst), hi(dst), -1);
274 emit(ctx, srl, MIPS_R_T9, lo(dst), 31);
275 emit(ctx, addu, lo(dst), lo(dst), lo(dst));
277 emit(ctx, addu, lo(dst), lo(dst), lo(src));
278 emit(ctx, sltu, MIPS_R_T9, lo(dst), lo(src));
280 emit(ctx, addu, hi(dst), hi(dst), hi(src));
281 emit(ctx, addu, hi(dst), hi(dst), MIPS_R_T9);
285 emit(ctx, sltu, MIPS_R_T9, lo(dst), lo(src));
286 emit(ctx, subu, lo(dst), lo(dst), lo(src));
287 emit(ctx, subu, hi(dst), hi(dst), hi(src));
288 emit(ctx, subu, hi(dst), hi(dst), MIPS_R_T9);
292 emit(ctx, or, lo(dst), lo(dst), lo(src));
293 emit(ctx, or, hi(dst), hi(dst), hi(src));
297 emit(ctx, and, lo(dst), lo(dst), lo(src));
298 emit(ctx, and, hi(dst), hi(dst), hi(src));
302 emit(ctx, xor, lo(dst), lo(dst), lo(src));
303 emit(ctx, xor, hi(dst), hi(dst), hi(src));
312 emit(ctx, sltu, MIPS_R_T9, MIPS_R_ZERO, lo(dst));
313 emit(ctx, subu, lo(dst), MIPS_R_ZERO, lo(dst));
314 emit(ctx, subu, hi(dst), MIPS_R_ZERO, hi(dst));
315 emit(ctx, subu, hi(dst), hi(dst), MIPS_R_T9);
328 emit(ctx, srl, MIPS_R_T9, lo(dst), 32 - imm);
329 emit(ctx, sll, lo(dst), lo(dst), imm);
330 emit(ctx, sll, hi(dst), hi(dst), imm);
331 emit(ctx, or, hi(dst), hi(dst), MIPS_R_T9);
333 emit(ctx, sll, hi(dst), lo(dst), imm - 32);
334 emit(ctx, move, lo(dst), MIPS_R_ZERO);
340 emit(ctx, sll, MIPS_R_T9, hi(dst), 32 - imm);
341 emit(ctx, srl, lo(dst), lo(dst), imm);
342 emit(ctx, srl, hi(dst), hi(dst), imm);
343 emit(ctx, or, lo(dst), lo(dst), MIPS_R_T9);
345 emit(ctx, srl, lo(dst), hi(dst), imm - 32);
346 emit(ctx, move, hi(dst), MIPS_R_ZERO);
352 emit(ctx, sll, MIPS_R_T9, hi(dst), 32 - imm);
353 emit(ctx, srl, lo(dst), lo(dst), imm);
354 emit(ctx, sra, hi(dst), hi(dst), imm);
355 emit(ctx, or, lo(dst), lo(dst), MIPS_R_T9);
357 emit(ctx, sra, lo(dst), hi(dst), imm - 32);
358 emit(ctx, sra, hi(dst), hi(dst), 31);
372 emit(ctx, andi, t1, src, 32); /* t1 = src & 32 */
373 emit(ctx, beqz, t1, 16); /* PC += 16 if t1 == 0 */
374 emit(ctx, nor, t2, src, MIPS_R_ZERO); /* t2 = ~src (delay slot) */
380 emit(ctx, sllv, hi(dst), lo(dst), src); /* dh = dl << src */
381 emit(ctx, move, lo(dst), MIPS_R_ZERO); /* dl = 0 */
382 emit(ctx, b, 20); /* PC += 20 */
384 emit(ctx, srl, t1, lo(dst), 1); /* t1 = dl >> 1 */
385 emit(ctx, srlv, t1, t1, t2); /* t1 = t1 >> t2 */
386 emit(ctx, sllv, lo(dst), lo(dst), src); /* dl = dl << src */
387 emit(ctx, sllv, hi(dst), hi(dst), src); /* dh = dh << src */
388 emit(ctx, or, hi(dst), hi(dst), t1); /* dh = dh | t1 */
393 emit(ctx, srlv, lo(dst), hi(dst), src); /* dl = dh >> src */
394 emit(ctx, move, hi(dst), MIPS_R_ZERO); /* dh = 0 */
395 emit(ctx, b, 20); /* PC += 20 */
397 emit(ctx, sll, t1, hi(dst), 1); /* t1 = dl << 1 */
398 emit(ctx, sllv, t1, t1, t2); /* t1 = t1 << t2 */
399 emit(ctx, srlv, lo(dst), lo(dst), src); /* dl = dl >> src */
400 emit(ctx, srlv, hi(dst), hi(dst), src); /* dh = dh >> src */
401 emit(ctx, or, lo(dst), lo(dst), t1); /* dl = dl | t1 */
406 emit(ctx, srav, lo(dst), hi(dst), src); /* dl = dh >>a src */
407 emit(ctx, sra, hi(dst), hi(dst), 31); /* dh = dh >>a 31 */
408 emit(ctx, b, 20); /* PC += 20 */
410 emit(ctx, sll, t1, hi(dst), 1); /* t1 = dl << 1 */
411 emit(ctx, sllv, t1, t1, t2); /* t1 = t1 << t2 */
412 emit(ctx, srlv, lo(dst), lo(dst), src); /* dl = dl >>a src */
413 emit(ctx, srav, hi(dst), hi(dst), src); /* dh = dh >> src */
414 emit(ctx, or, lo(dst), lo(dst), t1); /* dl = dl | t1 */
445 emit(ctx, mul, hi(dst), hi(dst), src);
447 emit(ctx, multu, hi(dst), src);
448 emit(ctx, mflo, hi(dst));
453 emit(ctx, subu, hi(dst), hi(dst), lo(dst));
458 emit(ctx, muhu, tmp, lo(dst), src);
459 emit(ctx, mulu, lo(dst), lo(dst), src);
461 emit(ctx, multu, lo(dst), src);
462 emit(ctx, mflo, lo(dst));
463 emit(ctx, mfhi, tmp);
467 emit(ctx, addu, hi(dst), hi(dst), tmp);
482 emit(ctx, mul, acc, hi(dst), lo(src));
484 emit(ctx, multu, hi(dst), lo(src));
485 emit(ctx, mflo, acc);
490 emit(ctx, mul, tmp, lo(dst), hi(src));
492 emit(ctx, multu, lo(dst), hi(src));
493 emit(ctx, mflo, tmp);
497 emit(ctx, addu, acc, acc, tmp);
502 emit(ctx, muhu, tmp, lo(dst), lo(src));
503 emit(ctx, mulu, lo(dst), lo(dst), lo(src));
505 emit(ctx, multu, lo(dst), lo(src));
506 emit(ctx, mflo, lo(dst));
507 emit(ctx, mfhi, tmp);
511 emit(ctx, addu, hi(dst), acc, tmp);
540 emit(ctx, move, MIPS_R_T9, src[k]);
541 emit(ctx, move, r1[k], dst[k]);
542 emit(ctx, move, r2[k], MIPS_R_T9);
557 emit(ctx, jalr, MIPS_R_RA, MIPS_R_T9);
558 emit(ctx, nop); /* Delay slot */
561 emit(ctx, move, dst[0], r0[0]);
562 emit(ctx, move, dst[1], r0[1]);
581 emit(ctx, and, tmp, src, mask); /* tmp = src & 0x00ff00ff */
582 emit(ctx, sll, tmp, tmp, 8); /* tmp = tmp << 8 */
583 emit(ctx, srl, dst, src, 8); /* dst = src >> 8 */
584 emit(ctx, and, dst, dst, mask); /* dst = dst & 0x00ff00ff */
585 emit(ctx, or, dst, dst, tmp); /* dst = dst | tmp */
593 emit(ctx, sll, tmp, src, 16); /* tmp = src << 16 */
594 emit(ctx, srl, dst, src, 16); /* dst = src >> 16 */
595 emit(ctx, or, dst, dst, tmp); /* dst = dst | tmp */
607 emit(ctx, rotr, tmp, hi(dst), 16);
608 emit(ctx, rotr, hi(dst), lo(dst), 16);
609 emit(ctx, wsbh, lo(dst), tmp);
610 emit(ctx, wsbh, hi(dst), hi(dst));
614 emit(ctx, move, hi(dst), tmp);
616 emit(ctx, lui, tmp, 0xff); /* tmp = 0x00ff0000 */
617 emit(ctx, ori, tmp, tmp, 0xff); /* tmp = 0x00ff00ff */
627 emit(ctx, move, hi(dst), MIPS_R_ZERO);
641 emit(ctx, move, hi(dst), MIPS_R_ZERO);
646 emit(ctx, move, hi(dst), MIPS_R_ZERO);
647 emit(ctx, andi, lo(dst), lo(dst), 0xffff);
660 emit(ctx, lbu, lo(dst), off, src);
661 emit(ctx, move, hi(dst), MIPS_R_ZERO);
665 emit(ctx, lhu, lo(dst), off, src);
666 emit(ctx, move, hi(dst), MIPS_R_ZERO);
670 emit(ctx, lw, lo(dst), off, src);
671 emit(ctx, move, hi(dst), MIPS_R_ZERO);
676 emit(ctx, lw, dst[0], off + 4, src);
677 emit(ctx, lw, dst[1], off, src);
679 emit(ctx, lw, dst[1], off, src);
680 emit(ctx, lw, dst[0], off + 4, src);
695 emit(ctx, sb, lo(src), off, dst);
699 emit(ctx, sh, lo(src), off, dst);
703 emit(ctx, sw, lo(src), off, dst);
707 emit(ctx, sw, src[1], off, dst);
708 emit(ctx, sw, src[0], off + 4, dst);
727 emit(ctx, move, MIPS_R_T9, dst);
729 emit(ctx, move, MIPS_R_A1, src);
730 emit(ctx, addiu, MIPS_R_A0, MIPS_R_T9, off);
732 emit(ctx, move, MIPS_R_A0, src);
733 emit(ctx, addiu, MIPS_R_A1, MIPS_R_T9, off);
773 emit(ctx, jalr, MIPS_R_RA, MIPS_R_T9);
774 emit(ctx, nop); /* Delay slot */
778 emit(ctx, move, src, MIPS_R_V0);
812 emit(ctx, move, MIPS_R_T9, dst);
813 emit(ctx, move, r1[0], src[0]);
814 emit(ctx, move, r1[1], src[1]);
815 emit(ctx, addiu, MIPS_R_A2, MIPS_R_T9, off);
854 emit(ctx, jalr, MIPS_R_RA, MIPS_R_T9);
855 emit(ctx, nop); /* Delay slot */
859 emit(ctx, move, lo(src), lo(r0));
860 emit(ctx, move, hi(src), hi(r0));
885 emit(ctx, addiu, MIPS_R_T9, dst, off);
886 emit(ctx, move, MIPS_R_T8, src);
887 emit(ctx, move, MIPS_R_A1, lo(r0));
888 emit(ctx, move, MIPS_R_A0, MIPS_R_T9);
889 emit(ctx, move, MIPS_R_A2, MIPS_R_T8);
893 emit(ctx, jalr, MIPS_R_RA, MIPS_R_T9);
894 emit(ctx, nop); /* Delay slot */
897 emit(ctx, move, lo(r0), MIPS_R_V0);
924 emit(ctx, addiu, MIPS_R_T9, dst, off);
925 emit(ctx, move, r2[0], r0[0]);
926 emit(ctx, move, r2[1], r0[1]);
927 emit(ctx, move, MIPS_R_A0, MIPS_R_T9);
931 emit(ctx, jalr, MIPS_R_RA, MIPS_R_T9);
932 emit(ctx, nop); /* Delay slot */
950 emit(ctx, movz, rd, rs, rt); /* rd = rt ? rd : rs */
953 emit(ctx, seleqz, rs, rs, rt); /* rs = 0 if rt == 0 */
954 emit(ctx, selnez, rd, rd, rt); /* rd = 0 if rt != 0 */
956 emit(ctx, or, rd, rd, rs); /* rd = rd | rs */
958 emit(ctx, bnez, rt, 8); /* PC += 8 if rd != 0 */
959 emit(ctx, nop); /* +0: delay slot */
960 emit(ctx, or, rd, rs, MIPS_R_ZERO); /* +4: rd = rs */
973 emit(ctx, movn, rd, rs, rt); /* rd = rt ? rs : rd */
976 emit(ctx, selnez, rs, rs, rt); /* rs = 0 if rt == 0 */
977 emit(ctx, seleqz, rd, rd, rt); /* rd = 0 if rt != 0 */
979 emit(ctx, or, rd, rd, rs); /* rd = rd | rs */
981 emit(ctx, beqz, rt, 8); /* PC += 8 if rd == 0 */
982 emit(ctx, nop); /* +0: delay slot */
983 emit(ctx, or, rd, rs, MIPS_R_ZERO); /* +4: rd = rs */
997 emit(ctx, sltu, rd, lo(rs), rd); /* rd = rsl < rd */
998 emit(ctx, sltiu, tmp, hi(rs), -1); /* tmp = rsh < ~0U */
999 emit(ctx, or, rd, rd, tmp); /* rd = rd | tmp */
1003 emit(ctx, sltu, rd, lo(rs), rd); /* rd = rsl < rd */
1005 emit(ctx, sltiu, rd, lo(rs), imm); /* rd = rsl < imm */
1017 emit(ctx, sltu, rd, lo(rs), lo(rt)); /* rd = rsl < rtl */
1018 emit(ctx, subu, tmp, hi(rs), hi(rt)); /* tmp = rsh - rth */
1020 emit(ctx, sltu, tmp, hi(rs), hi(rt)); /* tmp = rsh < rth */
1021 emit(ctx, or, rd, rd, tmp); /* rd = rd | tmp */
1037 emit(ctx, sltu, t1, lo(rs), rd); /* t1 = rsl <u imm */
1038 emit(ctx, sltu, t2, rd, lo(rs)); /* t2 = imm <u rsl */
1039 emit(ctx, srl, rd, hi(rs), 31); /* rd = rsh >> 31 */
1050 emit(ctx, addiu, rd, hi(rs), 1); /* rd = rsh + 1 */
1062 emit(ctx, slti, rd, hi(rs), imm < 0 ? -1 : 0); /* rd = rsh < hi(imm) */
1063 emit(ctx, or, rd, rd, t1); /* rd = rd | t1 */
1079 emit(ctx, sltu, t1, lo(rs), lo(rt)); /* t1 = rsl <u rtl */
1080 emit(ctx, sltu, t2, lo(rt), lo(rs)); /* t2 = rtl <u rsl */
1081 emit(ctx, xor, t3, hi(rs), hi(rt)); /* t3 = rlh ^ rth */
1082 emit(ctx, srl, rd, t3, 31); /* rd = t3 >> 31 */
1087 emit(ctx, slt, rd, hi(rs), hi(rt)); /* rd = rsh <s rth */
1088 emit(ctx, or, rd, rd, t1); /* rd = rd | t1 */
1106 emit(ctx, addiu, tmp, lo(dst), -imm);
1108 emit(ctx, xori, tmp, lo(dst), imm);
1111 emit(ctx, xor, tmp, lo(dst), tmp);
1114 emit(ctx, addu, MIPS_R_T9, hi(dst), 1);
1115 emit(ctx, or, tmp, tmp, MIPS_R_T9);
1117 emit(ctx, or, tmp, tmp, hi(dst));
1120 emit(ctx, beqz, tmp, off);
1122 emit(ctx, bnez, tmp, off);
1129 emit(ctx, andi, tmp, lo(dst), imm);
1132 emit(ctx, and, tmp, lo(dst), tmp);
1135 emit(ctx, or, tmp, tmp, hi(dst));
1137 emit(ctx, bnez, tmp, off);
1139 emit(ctx, beqz, tmp, off);
1144 emit(ctx, beqz, tmp, off);
1149 emit(ctx, beqz, tmp, off);
1154 emit(ctx, bnez, tmp, off);
1159 emit(ctx, bnez, tmp, off);
1164 emit(ctx, beqz, tmp, off);
1169 emit(ctx, beqz, tmp, off);
1174 emit(ctx, bnez, tmp, off);
1179 emit(ctx, bnez, tmp, off);
1199 emit(ctx, subu, t1, lo(dst), lo(src));
1200 emit(ctx, subu, t2, hi(dst), hi(src));
1201 emit(ctx, or, t1, t1, t2);
1203 emit(ctx, beqz, t1, off);
1205 emit(ctx, bnez, t1, off);
1211 emit(ctx, and, t1, lo(dst), lo(src));
1212 emit(ctx, and, t2, hi(dst), hi(src));
1213 emit(ctx, or, t1, t1, t2);
1215 emit(ctx, bnez, t1, off);
1217 emit(ctx, beqz, t1, off);
1222 emit(ctx, bnez, t1, off);
1227 emit(ctx, beqz, t1, off);
1232 emit(ctx, bnez, t1, off);
1237 emit(ctx, beqz, t1, off);
1242 emit(ctx, bnez, t1, off);
1247 emit(ctx, beqz, t1, off);
1252 emit(ctx, bnez, t1, off);
1257 emit(ctx, beqz, t1, off);
1280 emit(ctx, jalr, MIPS_R_RA, MIPS_R_T9);
1281 emit(ctx, nop); /* Delay slot */
1310 emit(ctx, lw, t1, off, ary); /* t1 = ary->map.max_entries*/
1312 emit(ctx, sltu, t1, ind, t1); /* t1 = ind < t1 */
1313 emit(ctx, beqz, t1, get_offset(ctx, 1)); /* PC += off(1) if t1 == 0 */
1316 emit(ctx, lw, t2, ctx->stack_size, MIPS_R_SP); /* t2 = *(SP + size) */
1318 emit(ctx, blez, t2, get_offset(ctx, 1)); /* PC += off(1) if t2 <= 0 */
1319 emit(ctx, addiu, t2, t2, -1); /* t2-- (delay slot) */
1320 emit(ctx, sw, t2, ctx->stack_size, MIPS_R_SP); /* *(SP + size) = t2 */
1326 emit(ctx, sll, t1, ind, 2); /* t1 = ind << 2 */
1327 emit(ctx, addu, t1, t1, ary); /* t1 += ary */
1328 emit(ctx, lw, t2, off, t1); /* t2 = *(t1 + off) */
1332 emit(ctx, beqz, t2, get_offset(ctx, 1)); /* PC += off(1) if t2 == 0 */
1333 emit(ctx, nop); /* Delay slot */
1339 emit(ctx, lw, t1, off, t2); /* t1 = *(t2 + off) */
1341 emit(ctx, addiu, t1, t1, JIT_TCALL_SKIP); /* t1 += skip (8 or 12) */
1392 emit(ctx, ori, MIPS_R_T9, MIPS_R_ZERO, MAX_TAIL_CALL_CNT);
1393 emit(ctx, sw, MIPS_R_T9, 0, MIPS_R_SP);
1401 emit(ctx, move, lo(r1), MIPS_R_A0);
1407 emit(ctx, move, hi(r1), MIPS_R_ZERO);
1430 emit(ctx, addiu, MIPS_R_SP, MIPS_R_SP, -stack);
1437 emit(ctx, addiu, lo(fp), MIPS_R_SP, stack - saved);
1454 emit(ctx, move, MIPS_R_V0, MIPS_R_V1);
1458 emit(ctx, jr, dest_reg);
1459 emit(ctx, addiu, MIPS_R_SP, MIPS_R_SP, ctx->stack_size);