Lines Matching refs:flags

216 static SLJIT_INLINE sljit_ins invert_branch(sljit_si flags)  in invert_branch()  argument
218 return (flags & IS_BIT26_COND) ? (1 << 26) : (1 << 16); in invert_branch()
229 if (jump->flags & (SLJIT_REWRITABLE_JUMP | IS_CALL)) in detect_jump_type()
232 if (jump->flags & SLJIT_REWRITABLE_JUMP) in detect_jump_type()
236 if (jump->flags & JUMP_ADDR) in detect_jump_type()
239 SLJIT_ASSERT(jump->flags & JUMP_LABEL); in detect_jump_type()
243 if (jump->flags & IS_COND) in detect_jump_type()
247 if (jump->flags & IS_CALL) in detect_jump_type()
252 if (jump->flags & IS_MOVABLE) { in detect_jump_type()
255 jump->flags |= PATCH_B; in detect_jump_type()
257 if (!(jump->flags & IS_COND)) { in detect_jump_type()
259 inst[-1] = (jump->flags & IS_JAL) ? BAL : B; in detect_jump_type()
265 inst[-1] = saved_inst ^ invert_branch(jump->flags); in detect_jump_type()
273 jump->flags |= PATCH_B; in detect_jump_type()
275 if (!(jump->flags & IS_COND)) { in detect_jump_type()
276 inst[0] = (jump->flags & IS_JAL) ? BAL : B; in detect_jump_type()
280 inst[0] = inst[0] ^ invert_branch(jump->flags); in detect_jump_type()
287 if (jump->flags & IS_COND) { in detect_jump_type()
288 …if ((jump->flags & IS_MOVABLE) && (target_addr & ~0xfffffff) == ((jump->addr + 2 * sizeof(sljit_in… in detect_jump_type()
289 jump->flags |= PATCH_J; in detect_jump_type()
298 jump->flags |= PATCH_J; in detect_jump_type()
309 if ((jump->flags & IS_MOVABLE) && (target_addr & ~0xfffffff) == (jump->addr & ~0xfffffff)) { in detect_jump_type()
310 jump->flags |= PATCH_J; in detect_jump_type()
312 inst[-1] = (jump->flags & IS_JAL) ? JAL : J; in detect_jump_type()
318 jump->flags |= PATCH_J; in detect_jump_type()
319 inst[0] = (jump->flags & IS_JAL) ? JAL : J; in detect_jump_type()
328 jump->flags |= PATCH_ABS32; in detect_jump_type()
329 if (jump->flags & IS_COND) { in detect_jump_type()
338 jump->flags |= PATCH_ABS48; in detect_jump_type()
339 if (jump->flags & IS_COND) { in detect_jump_type()
436 addr = (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target; in sljit_generate_code()
439 if (jump->flags & PATCH_B) { in sljit_generate_code()
445 if (jump->flags & PATCH_J) { in sljit_generate_code()
456 if (jump->flags & PATCH_ABS32) { in sljit_generate_code()
461 else if (jump->flags & PATCH_ABS48) { in sljit_generate_code()
525 (!(flags & UNUSED_DEST) || (op & GET_FLAGS(~(list))))
701 static sljit_si getput_arg_fast(struct sljit_compiler *compiler, sljit_si flags, sljit_si reg_ar, s… in getput_arg_fast() argument
705 …if ((!(flags & WRITE_BACK) || !(arg & REG_MASK)) && !(arg & OFFS_REG_MASK) && argw <= SIMM_MAX && … in getput_arg_fast()
707 if (SLJIT_UNLIKELY(flags & ARG_TEST)) in getput_arg_fast()
709 FAIL_IF(push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(arg & REG_MASK) in getput_arg_fast()
710 …| TA(reg_ar) | IMM(argw), ((flags & MEM_MASK) <= GPR_REG && (flags & LOAD_DATA)) ? reg_ar : MOVABL… in getput_arg_fast()
742 static sljit_si getput_arg(struct sljit_compiler *compiler, sljit_si flags, sljit_si reg_ar, sljit_… in getput_arg() argument
752 if ((flags & MEM_MASK) <= GPR_REG && (flags & LOAD_DATA)) { in getput_arg()
763 if ((flags & WRITE_BACK) && reg_ar == DR(base)) { in getput_arg()
764 SLJIT_ASSERT(!(flags & LOAD_DATA) && DR(TMP_REG1) != reg_ar); in getput_arg()
771 if (!(flags & WRITE_BACK)) { in getput_arg()
773 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(TMP_REG3) | TA(reg_ar), delay… in getput_arg()
779 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(TMP_REG3) | TA(reg_ar), delay… in getput_arg()
782 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | SA(tmp_ar) | TA(reg_ar), delay_… in getput_arg()
788 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(base) | TA(reg_ar), delay_slo… in getput_arg()
799 if (!(flags & WRITE_BACK)) { in getput_arg()
808 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | SA(tmp_ar) | TA(reg_ar), delay_… in getput_arg()
811 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(base) | TA(reg_ar), delay_slo… in getput_arg()
814 if (SLJIT_UNLIKELY(flags & WRITE_BACK) && base) { in getput_arg()
817 SLJIT_ASSERT(!(flags & LOAD_DATA) && DR(TMP_REG1) != reg_ar); in getput_arg()
819 …FAIL_IF(push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(base) | TA(reg_ar) | IMM(arg… in getput_arg()
847 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(base) | TA(reg_ar), delay_slo… in getput_arg()
855 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(TMP_REG3) | TA(reg_ar), delay… in getput_arg()
869 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(TMP_REG3) | TA(reg_ar), delay… in getput_arg()
874 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | S(TMP_REG3) | TA(reg_ar), delay… in getput_arg()
878 …return push_inst(compiler, data_transfer_insts[flags & MEM_MASK] | SA(tmp_ar) | TA(reg_ar), delay_… in getput_arg()
881 static SLJIT_INLINE sljit_si emit_op_mem(struct sljit_compiler *compiler, sljit_si flags, sljit_si … in emit_op_mem() argument
883 if (getput_arg_fast(compiler, flags, reg_ar, arg, argw)) in emit_op_mem()
887 return getput_arg(compiler, flags, reg_ar, arg, argw, 0, 0); in emit_op_mem()
890 static SLJIT_INLINE sljit_si emit_op_mem2(struct sljit_compiler *compiler, sljit_si flags, sljit_si… in emit_op_mem2() argument
892 if (getput_arg_fast(compiler, flags, reg, arg1, arg1w)) in emit_op_mem2()
894 return getput_arg(compiler, flags, reg, arg1, arg1w, arg2, arg2w); in emit_op_mem2()
897 static sljit_si emit_op(struct sljit_compiler *compiler, sljit_si op, sljit_si flags, in emit_op() argument
911 if (!(flags & ALT_KEEP_CACHE)) { in emit_op()
920 flags |= UNUSED_DEST; in emit_op()
924 flags |= REG_DEST; in emit_op()
928 …else if ((dst & SLJIT_MEM) && !getput_arg_fast(compiler, flags | ARG_TEST, DR(TMP_REG1), dst, dstw… in emit_op()
929 flags |= SLOW_DEST; in emit_op()
931 if (flags & IMM_OP) { in emit_op()
933 if ((!(flags & LOGICAL_OP) && (src2w <= SIMM_MAX && src2w >= SIMM_MIN)) in emit_op()
934 || ((flags & LOGICAL_OP) && !(src2w & ~UIMM_MAX))) { in emit_op()
935 flags |= SRC2_IMM; in emit_op()
939 if (!(flags & SRC2_IMM) && (flags & CUMULATIVE_OP) && (src1 & SLJIT_IMM) && src1w) { in emit_op()
940 if ((!(flags & LOGICAL_OP) && (src1w <= SIMM_MAX && src1w >= SIMM_MIN)) in emit_op()
941 || ((flags & LOGICAL_OP) && !(src1w & ~UIMM_MAX))) { in emit_op()
942 flags |= SRC2_IMM; in emit_op()
957 flags |= REG1_SOURCE; in emit_op()
968 if (getput_arg_fast(compiler, flags | LOAD_DATA, DR(TMP_REG1), src1, src1w)) in emit_op()
971 flags |= SLOW_SRC1; in emit_op()
978 flags |= REG2_SOURCE; in emit_op()
979 if (!(flags & REG_DEST) && op >= SLJIT_MOV && op <= SLJIT_MOVU_SI) in emit_op()
983 if (!(flags & SRC2_IMM)) { in emit_op()
996 if (getput_arg_fast(compiler, flags | LOAD_DATA, DR(sugg_src2_r), src2, src2w)) in emit_op()
999 flags |= SLOW_SRC2; in emit_op()
1003 if ((flags & (SLOW_SRC1 | SLOW_SRC2)) == (SLOW_SRC1 | SLOW_SRC2)) { in emit_op()
1006 FAIL_IF(getput_arg(compiler, flags | LOAD_DATA, DR(TMP_REG2), src2, src2w, src1, src1w)); in emit_op()
1007 FAIL_IF(getput_arg(compiler, flags | LOAD_DATA, DR(TMP_REG1), src1, src1w, dst, dstw)); in emit_op()
1010 FAIL_IF(getput_arg(compiler, flags | LOAD_DATA, DR(TMP_REG1), src1, src1w, src2, src2w)); in emit_op()
1011 FAIL_IF(getput_arg(compiler, flags | LOAD_DATA, DR(TMP_REG2), src2, src2w, dst, dstw)); in emit_op()
1014 else if (flags & SLOW_SRC1) in emit_op()
1015 FAIL_IF(getput_arg(compiler, flags | LOAD_DATA, DR(TMP_REG1), src1, src1w, dst, dstw)); in emit_op()
1016 else if (flags & SLOW_SRC2) in emit_op()
1017 FAIL_IF(getput_arg(compiler, flags | LOAD_DATA, DR(sugg_src2_r), src2, src2w, dst, dstw)); in emit_op()
1019 FAIL_IF(emit_single_op(compiler, op, flags, dst_r, src1_r, src2_r)); in emit_op()
1022 if (!(flags & SLOW_DEST)) { in emit_op()
1023 getput_arg_fast(compiler, flags, DR(dst_r), dst, dstw); in emit_op()
1026 return getput_arg(compiler, flags, DR(dst_r), dst, dstw, 0, 0); in emit_op()
1087 # define flags 0 in sljit_emit_op1() macro
1089 sljit_si flags = 0; in sljit_emit_op1()
1099 flags |= INT_DATA | SIGNED_DATA; in sljit_emit_op1()
1167 return emit_op(compiler, op, flags, dst, dstw, TMP_REG1, 0, src, srcw); in sljit_emit_op1()
1170 …return emit_op(compiler, SLJIT_SUB | GET_ALL_FLAGS(op), flags | IMM_OP, dst, dstw, SLJIT_IMM, 0, s… in sljit_emit_op1()
1173 return emit_op(compiler, op, flags, dst, dstw, TMP_REG1, 0, src, srcw); in sljit_emit_op1()
1179 # undef flags in sljit_emit_op1()
1189 # define flags 0 in sljit_emit_op2() macro
1191 sljit_si flags = 0; in sljit_emit_op2()
1202 flags |= INT_DATA | SIGNED_DATA; in sljit_emit_op2()
1213 return emit_op(compiler, op, flags | CUMULATIVE_OP | IMM_OP, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
1217 return emit_op(compiler, op, flags | IMM_OP, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
1220 return emit_op(compiler, op, flags | CUMULATIVE_OP, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
1225 …return emit_op(compiler, op, flags | CUMULATIVE_OP | LOGICAL_OP | IMM_OP, dst, dstw, src1, src1w, … in sljit_emit_op2()
1241 return emit_op(compiler, op, flags | IMM_OP, dst, dstw, src1, src1w, src2, src2w); in sljit_emit_op2()
1247 # undef flags in sljit_emit_op2()
1297 # define flags 0 in sljit_emit_fop1_convw_fromd() macro
1299 sljit_si flags = (GET_OPCODE(op) == SLJIT_CONVW_FROMD) << 21; in sljit_emit_fop1_convw_fromd()
1309 …FAIL_IF(push_inst(compiler, (TRUNC_W_S ^ (flags >> 19)) | FMT(op) | FS(src) | FD(TMP_FREG1), MOVAB… in sljit_emit_fop1_convw_fromd()
1315 return push_inst(compiler, MFC1 | flags | T(dst) | FS(TMP_FREG1), MOVABLE_INS); in sljit_emit_fop1_convw_fromd()
1318 return emit_op_mem2(compiler, flags ? DOUBLE_DATA : SINGLE_DATA, TMP_FREG1, dst, dstw, 0, 0); in sljit_emit_fop1_convw_fromd()
1330 # define flags 0 in sljit_emit_fop1_convd_fromw() macro
1332 sljit_si flags = (GET_OPCODE(op) == SLJIT_CONVD_FROMW) << 21; in sljit_emit_fop1_convd_fromw()
1338 FAIL_IF(push_inst(compiler, MTC1 | flags | T(src) | FS(TMP_FREG1), MOVABLE_INS)); in sljit_emit_fop1_convd_fromw()
1341 …FAIL_IF(emit_op_mem2(compiler, ((flags) ? DOUBLE_DATA : SINGLE_DATA) | LOAD_DATA, TMP_FREG1, src, … in sljit_emit_fop1_convd_fromw()
1349 FAIL_IF(push_inst(compiler, MTC1 | flags | T(TMP_REG1) | FS(TMP_FREG1), MOVABLE_INS)); in sljit_emit_fop1_convd_fromw()
1352 …FAIL_IF(push_inst(compiler, CVT_S_S | flags | (4 << 21) | (((op & SLJIT_SINGLE_OP) ^ SLJIT_SINGLE_… in sljit_emit_fop1_convd_fromw()
1359 # undef flags in sljit_emit_fop1_convd_fromw()
1458 sljit_si dst_r, flags = 0; in sljit_emit_fop2() local
1476 flags |= SLOW_SRC1; in sljit_emit_fop2()
1486 flags |= SLOW_SRC2; in sljit_emit_fop2()
1491 if ((flags & (SLOW_SRC1 | SLOW_SRC2)) == (SLOW_SRC1 | SLOW_SRC2)) { in sljit_emit_fop2()
1501 else if (flags & SLOW_SRC1) in sljit_emit_fop2()
1503 else if (flags & SLOW_SRC2) in sljit_emit_fop2()
1506 if (flags & SLOW_SRC1) in sljit_emit_fop2()
1508 if (flags & SLOW_SRC2) in sljit_emit_fop2()
1602 flags = IS_BIT26_COND; \
1607 flags = IS_BIT26_COND; \
1612 flags = IS_BIT16_COND; \
1617 flags = IS_BIT16_COND; \
1624 sljit_si flags = 0; in sljit_emit_jump() local
1692 jump->flags |= flags; in sljit_emit_jump()
1694 jump->flags |= IS_MOVABLE; in sljit_emit_jump()
1707 jump->flags |= IS_JAL | (type >= SLJIT_CALL0 ? IS_CALL : 0); in sljit_emit_jump()
1741 sljit_si flags; in sljit_emit_cmp() local
1751 flags = ((type & SLJIT_INT_OP) ? INT_DATA : WORD_DATA) | LOAD_DATA; in sljit_emit_cmp()
1753 PTR_FAIL_IF(emit_op_mem2(compiler, flags, DR(TMP_REG1), src1, src1w, src2, src2w)); in sljit_emit_cmp()
1757 PTR_FAIL_IF(emit_op_mem2(compiler, flags, DR(TMP_REG2), src2, src2w, 0, 0)); in sljit_emit_cmp()
1769 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1771 jump->flags |= IS_MOVABLE; in sljit_emit_cmp()
1781 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1785 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1789 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
1793 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
1803 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
1807 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
1811 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1815 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1843 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1888 jump->flags |= IS_BIT16_COND; in sljit_emit_fcmp()
1990 jump->flags |= IS_MOVABLE; in sljit_emit_ijump()
2010 sljit_si flags = GET_ALL_FLAGS(op); in sljit_emit_op_flags() local
2103 …return emit_op(compiler, op | flags, mem_type | CUMULATIVE_OP | LOGICAL_OP | IMM_OP | ALT_KEEP_CAC… in sljit_emit_op_flags()