Lines Matching refs:flags
228 if (jump->flags & SLJIT_REWRITABLE_JUMP) in detect_jump_type()
231 if (jump->flags & JUMP_ADDR) { in detect_jump_type()
238 SLJIT_ASSERT(jump->flags & JUMP_LABEL); in detect_jump_type()
242 if (jump->flags & IS_COND) { in detect_jump_type()
243 SLJIT_ASSERT(!(jump->flags & IS_BL)); in detect_jump_type()
245 jump->flags |= PATCH_TYPE1; in detect_jump_type()
249 jump->flags |= PATCH_TYPE2; in detect_jump_type()
255 jump->flags |= PATCH_TYPE3; in detect_jump_type()
259 else if (jump->flags & IS_BL) { in detect_jump_type()
261 jump->flags |= PATCH_BL; in detect_jump_type()
267 jump->flags |= PATCH_TYPE4; in detect_jump_type()
271 jump->flags |= PATCH_TYPE5; in detect_jump_type()
281 sljit_si type = (jump->flags >> 4) & 0xf; in set_jump_instruction()
287 …modify_imm32_const((sljit_uh*)jump->addr, (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump-… in set_jump_instruction()
291 if (jump->flags & JUMP_ADDR) { in set_jump_instruction()
302 SLJIT_ASSERT(diff <= 127 && diff >= -128 && (jump->flags & IS_COND)); in set_jump_instruction()
303 jump_inst[0] = 0xd000 | (jump->flags & 0xf00) | (diff & 0xff); in set_jump_instruction()
307 SLJIT_ASSERT(diff <= 524287 && diff >= -524288 && (jump->flags & IS_COND)); in set_jump_instruction()
308 …jump_inst[0] = 0xf000 | COPY_BITS(jump->flags, 8, 6, 4) | COPY_BITS(diff, 11, 0, 6) | COPY_BITS(di… in set_jump_instruction()
312 SLJIT_ASSERT(jump->flags & IS_COND); in set_jump_instruction()
313 *jump_inst++ = IT | ((jump->flags >> 4) & 0xf0) | 0x8; in set_jump_instruction()
319 SLJIT_ASSERT(diff <= 1023 && diff >= -1024 && !(jump->flags & IS_COND)); in set_jump_instruction()
384 jump->addr = (sljit_uw)code_ptr - ((jump->flags & IS_COND) ? 10 : 8); in sljit_generate_code()
511 static sljit_si emit_op_imm(struct sljit_compiler *compiler, sljit_si flags, sljit_si dst, sljit_uw… in emit_op_imm() argument
519 if (SLJIT_UNLIKELY((flags & (ARG1_IMM | ARG2_IMM)) == (ARG1_IMM | ARG2_IMM))) { in emit_op_imm()
521 flags &= ~ARG1_IMM; in emit_op_imm()
526 if (flags & (ARG1_IMM | ARG2_IMM)) { in emit_op_imm()
527 reg = (flags & ARG2_IMM) ? arg1 : arg2; in emit_op_imm()
528 imm = (flags & ARG2_IMM) ? arg2 : arg1; in emit_op_imm()
530 switch (flags & 0xffff) { in emit_op_imm()
536 SLJIT_ASSERT(!(flags & SET_FLAGS) && (flags & ARG2_IMM) && arg1 == TMP_REG1); in emit_op_imm()
539 if (!(flags & SET_FLAGS)) in emit_op_imm()
546 if (!(flags & KEEP_FLAGS) && IS_2_LO_REGS(reg, dst)) { in emit_op_imm()
558 if (!(flags & SET_FLAGS)) { in emit_op_imm()
566 return push_inst32(compiler, ADD_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
571 return push_inst32(compiler, ADCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
574 if (flags & ARG1_IMM) { in emit_op_imm()
575 if (!(flags & KEEP_FLAGS) && imm == 0 && IS_2_LO_REGS(reg, dst)) in emit_op_imm()
579 return push_inst32(compiler, RSB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
583 if (!(flags & KEEP_FLAGS) && IS_2_LO_REGS(reg, dst)) { in emit_op_imm()
594 if (imm <= 0xff && (flags & UNUSED_RETURN)) in emit_op_imm()
597 if (!(flags & SET_FLAGS)) { in emit_op_imm()
605 return push_inst32(compiler, SUB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
608 if (flags & ARG1_IMM) in emit_op_imm()
612 return push_inst32(compiler, SBCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
617 return push_inst32(compiler, ANDI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
620 return push_inst32(compiler, BICI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
625 return push_inst32(compiler, ORRI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
628 return push_inst32(compiler, ORNI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
633 return push_inst32(compiler, EORI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
638 if (flags & ARG1_IMM) in emit_op_imm()
642 if (!(flags & SET_FLAGS)) in emit_op_imm()
648 switch (flags & 0xffff) { in emit_op_imm()
650 if (!(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, reg)) in emit_op_imm()
652 return push_inst32(compiler, LSL_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
654 if (!(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, reg)) in emit_op_imm()
656 return push_inst32(compiler, LSR_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
658 if (!(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, reg)) in emit_op_imm()
660 return push_inst32(compiler, ASR_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
667 if (flags & ARG2_IMM) { in emit_op_imm()
678 switch (flags & 0xffff) { in emit_op_imm()
687 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1); in emit_op_imm()
693 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1); in emit_op_imm()
699 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1); in emit_op_imm()
705 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1); in emit_op_imm()
711 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1); in emit_op_imm()
717 if (!(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, arg2)) in emit_op_imm()
719 return push_inst32(compiler, MVN_W | (flags & SET_FLAGS) | RD4(dst) | RM4(arg2)); in emit_op_imm()
723 if (flags & SET_FLAGS) { in emit_op_imm()
730 if (!(flags & KEEP_FLAGS) && IS_3_LO_REGS(dst, arg1, arg2)) in emit_op_imm()
732 if (dst == arg1 && !(flags & SET_FLAGS)) in emit_op_imm()
734 return push_inst32(compiler, ADD_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
736 if (dst == arg1 && !(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, arg2)) in emit_op_imm()
738 return push_inst32(compiler, ADC_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
740 if (!(flags & KEEP_FLAGS) && IS_3_LO_REGS(dst, arg1, arg2)) in emit_op_imm()
742 return push_inst32(compiler, SUB_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
744 if (dst == arg1 && !(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, arg2)) in emit_op_imm()
746 return push_inst32(compiler, SBC_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
748 if (!(flags & SET_FLAGS)) in emit_op_imm()
755 if (!(flags & KEEP_FLAGS)) { in emit_op_imm()
758 if ((flags & UNUSED_RETURN) && IS_2_LO_REGS(arg1, arg2)) in emit_op_imm()
761 return push_inst32(compiler, AND_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
763 if (dst == arg1 && !(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, arg2)) in emit_op_imm()
765 return push_inst32(compiler, ORR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
767 if (dst == arg1 && !(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, arg2)) in emit_op_imm()
769 return push_inst32(compiler, EOR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
771 if (dst == arg1 && !(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, arg2)) in emit_op_imm()
773 return push_inst32(compiler, LSL_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
775 if (dst == arg1 && !(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, arg2)) in emit_op_imm()
777 return push_inst32(compiler, LSR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
779 if (dst == arg1 && !(flags & KEEP_FLAGS) && IS_2_LO_REGS(dst, arg2)) in emit_op_imm()
781 return push_inst32(compiler, ASR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
798 #define IS_WORD_SIZE(flags) (!(flags & (BYTE_SIZE | HALF_SIZE))) argument
891 static sljit_si getput_arg_fast(struct sljit_compiler *compiler, sljit_si flags, sljit_si reg, slji… in getput_arg_fast() argument
897 if (SLJIT_UNLIKELY(flags & UPDATE)) { in getput_arg_fast()
899 if (SLJIT_UNLIKELY(flags & ARG_TEST)) in getput_arg_fast()
902 flags &= ~UPDATE; in getput_arg_fast()
911 …FAIL_IF(push_inst32(compiler, sljit_mem32[flags] | MEM_IMM8 | RT4(reg) | RN4(arg) | 0x100 | argw)); in getput_arg_fast()
918 if (SLJIT_UNLIKELY(flags & ARG_TEST)) in getput_arg_fast()
926 FAIL_IF(push_inst16(compiler, sljit_mem16[flags] | RD3(reg) | RN3(arg) | RM3(other_r))); in getput_arg_fast()
928 …FAIL_IF(push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(other_r) | (argw << 4… in getput_arg_fast()
935 if (SLJIT_UNLIKELY(flags & ARG_TEST)) in getput_arg_fast()
939 if (IS_2_LO_REGS(reg, arg) && sljit_mem16_imm5[flags]) { in getput_arg_fast()
941 if (IS_WORD_SIZE(flags)) { in getput_arg_fast()
945 else if (flags & BYTE_SIZE) in getput_arg_fast()
951 SLJIT_ASSERT(flags & HALF_SIZE); in getput_arg_fast()
957 …FAIL_IF(push_inst16(compiler, sljit_mem16_imm5[flags] | RD3(reg) | RN3(arg) | (argw << (6 - shift)… in getput_arg_fast()
963 …if (SLJIT_UNLIKELY(arg == SLJIT_SP) && OFFSET_CHECK(0xff, 2) && IS_WORD_SIZE(flags) && reg_map[reg… in getput_arg_fast()
964 FAIL_IF(push_inst16(compiler, STR_SP | ((flags & STORE) ? 0 : 0x800) | RDN3(reg) | (argw >> 2))); in getput_arg_fast()
969 FAIL_IF(push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(arg) | argw)); in getput_arg_fast()
971 FAIL_IF(push_inst32(compiler, sljit_mem32[flags] | MEM_IMM8 | RT4(reg) | RN4(arg) | -argw)); in getput_arg_fast()
1002 static sljit_si getput_arg(struct sljit_compiler *compiler, sljit_si flags, sljit_si reg, in getput_arg() argument
1014 tmp_r = (flags & STORE) ? TMP_REG3 : reg; in getput_arg()
1016 if (SLJIT_UNLIKELY((flags & UPDATE) && (arg & REG_MASK))) { in getput_arg()
1021 flags &= ~UPDATE; in getput_arg()
1025 FAIL_IF(push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(arg) | argw)); in getput_arg()
1053 FAIL_IF(push_inst16(compiler, sljit_mem16[flags] | RD3(reg) | RN3(arg) | RM3(other_r))); in getput_arg()
1056 …FAIL_IF(push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(other_r) | (argw << 4… in getput_arg()
1059 flags &= ~UPDATE; in getput_arg()
1066 return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(TMP_REG3) | diff); in getput_arg()
1068 …return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM8 | RT4(reg) | RN4(TMP_REG3) | (compiler-… in getput_arg()
1071 return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(TMP_REG3) | 0); in getput_arg()
1079 return push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(TMP_REG3)); in getput_arg()
1083 return push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(TMP_REG3)); in getput_arg()
1106 return push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(TMP_REG3)); in getput_arg()
1107 return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(TMP_REG3) | 0); in getput_arg()
1110 static SLJIT_INLINE sljit_si emit_op_mem(struct sljit_compiler *compiler, sljit_si flags, sljit_si … in emit_op_mem() argument
1112 if (getput_arg_fast(compiler, flags, reg, arg, argw)) in emit_op_mem()
1116 return getput_arg(compiler, flags, reg, arg, argw, 0, 0); in emit_op_mem()
1119 static SLJIT_INLINE sljit_si emit_op_mem2(struct sljit_compiler *compiler, sljit_si flags, sljit_si… in emit_op_mem2() argument
1121 if (getput_arg_fast(compiler, flags, reg, arg1, arg1w)) in emit_op_mem2()
1123 return getput_arg(compiler, flags, reg, arg1, arg1w, arg2, arg2w); in emit_op_mem2()
1318 sljit_si dst_r, flags; in sljit_emit_op1() local
1338 flags = WORD_SIZE; in sljit_emit_op1()
1341 flags = BYTE_SIZE; in sljit_emit_op1()
1346 flags = BYTE_SIZE | SIGNED; in sljit_emit_op1()
1351 flags = HALF_SIZE; in sljit_emit_op1()
1356 flags = HALF_SIZE | SIGNED; in sljit_emit_op1()
1364 flags = WORD_SIZE | UPDATE; in sljit_emit_op1()
1367 flags = BYTE_SIZE | UPDATE; in sljit_emit_op1()
1372 flags = BYTE_SIZE | SIGNED | UPDATE; in sljit_emit_op1()
1377 flags = HALF_SIZE | UPDATE; in sljit_emit_op1()
1382 flags = HALF_SIZE | SIGNED | UPDATE; in sljit_emit_op1()
1388 flags = 0; in sljit_emit_op1()
1395 if (getput_arg_fast(compiler, flags, dst_r, src, srcw)) in sljit_emit_op1()
1398 FAIL_IF(getput_arg(compiler, flags, dst_r, src, srcw, dst, dstw)); in sljit_emit_op1()
1406 if (getput_arg_fast(compiler, flags | STORE, dst_r, dst, dstw)) in sljit_emit_op1()
1409 return getput_arg(compiler, flags | STORE, dst_r, dst, dstw, 0, 0); in sljit_emit_op1()
1422 flags = (GET_FLAGS(op_flags) ? SET_FLAGS : 0) | ((op_flags & SLJIT_KEEP_FLAGS) ? KEEP_FLAGS : 0); in sljit_emit_op1()
1432 flags |= ARG2_IMM; in sljit_emit_op1()
1436 emit_op_imm(compiler, flags | op, dst_r, TMP_REG1, srcw); in sljit_emit_op1()
1439 if (getput_arg_fast(compiler, flags | STORE, dst_r, dst, dstw)) in sljit_emit_op1()
1442 return getput_arg(compiler, flags | STORE, dst_r, dst, dstw, 0, 0); in sljit_emit_op1()
1452 sljit_si dst_r, flags; in sljit_emit_op2() local
1464 flags = (GET_FLAGS(op) ? SET_FLAGS : 0) | ((op & SLJIT_KEEP_FLAGS) ? KEEP_FLAGS : 0); in sljit_emit_op2()
1467 flags |= SLOW_DEST; in sljit_emit_op2()
1473 flags |= SLOW_SRC1; in sljit_emit_op2()
1479 flags |= SLOW_SRC2; in sljit_emit_op2()
1482 if ((flags & (SLOW_SRC1 | SLOW_SRC2)) == (SLOW_SRC1 | SLOW_SRC2)) { in sljit_emit_op2()
1492 else if (flags & SLOW_SRC1) in sljit_emit_op2()
1494 else if (flags & SLOW_SRC2) in sljit_emit_op2()
1503 flags |= ARG1_IMM; in sljit_emit_op2()
1507 flags |= ARG2_IMM; in sljit_emit_op2()
1512 flags |= UNUSED_RETURN; in sljit_emit_op2()
1514 emit_op_imm(compiler, flags | GET_OPCODE(op), dst_r, src1w, src2w); in sljit_emit_op2()
1517 if (!(flags & SLOW_DEST)) { in sljit_emit_op2()
1565 static sljit_si emit_fop_mem(struct sljit_compiler *compiler, sljit_si flags, sljit_si reg, sljit_s… in emit_fop_mem() argument
1569 sljit_sw inst = VSTR_F32 | (flags & (SLJIT_SINGLE_OP | FPU_LOAD)); in emit_fop_mem()
1930 jump->flags |= IS_COND; in sljit_emit_jump()
1932 jump->flags |= cc << 8; in sljit_emit_jump()
1940 jump->flags |= IS_BL; in sljit_emit_jump()
1980 sljit_si dst_r, flags = GET_ALL_FLAGS(op); in sljit_emit_op_flags() local
2014 if (flags & SLJIT_SET_E) { in sljit_emit_op_flags()
2048 if (flags & SLJIT_SET_E) { in sljit_emit_op_flags()