Lines Matching refs:flags

244 	if (jump->flags & SLJIT_REWRITABLE_JUMP)  in detect_jump_type()
247 if (jump->flags & JUMP_ADDR) { in detect_jump_type()
254 SLJIT_ASSERT(jump->flags & JUMP_LABEL); in detect_jump_type()
258 if (jump->flags & IS_COND) { in detect_jump_type()
259 SLJIT_ASSERT(!(jump->flags & IS_BL)); in detect_jump_type()
261 jump->flags |= PATCH_TYPE1; in detect_jump_type()
265 jump->flags |= PATCH_TYPE2; in detect_jump_type()
271 jump->flags |= PATCH_TYPE3; in detect_jump_type()
275 else if (jump->flags & IS_BL) { in detect_jump_type()
277 jump->flags |= PATCH_BL; in detect_jump_type()
283 jump->flags |= PATCH_TYPE4; in detect_jump_type()
287 jump->flags |= PATCH_TYPE5; in detect_jump_type()
297 sljit_s32 type = (jump->flags >> 4) & 0xf; in set_jump_instruction()
303 …modify_imm32_const((sljit_u16*)jump->addr, (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump… in set_jump_instruction()
307 if (jump->flags & JUMP_ADDR) { in set_jump_instruction()
320 SLJIT_ASSERT(diff <= 127 && diff >= -128 && (jump->flags & IS_COND)); in set_jump_instruction()
321 jump_inst[0] = 0xd000 | (jump->flags & 0xf00) | (diff & 0xff); in set_jump_instruction()
325 SLJIT_ASSERT(diff <= 524287 && diff >= -524288 && (jump->flags & IS_COND)); in set_jump_instruction()
326 …jump_inst[0] = 0xf000 | COPY_BITS(jump->flags, 8, 6, 4) | COPY_BITS(diff, 11, 0, 6) | COPY_BITS(di… in set_jump_instruction()
330 SLJIT_ASSERT(jump->flags & IS_COND); in set_jump_instruction()
331 *jump_inst++ = IT | ((jump->flags >> 4) & 0xf0) | 0x8; in set_jump_instruction()
337 SLJIT_ASSERT(diff <= 1023 && diff >= -1024 && !(jump->flags & IS_COND)); in set_jump_instruction()
412 jump->addr = (sljit_uw)code_ptr - ((jump->flags & IS_COND) ? 10 : 8); in sljit_generate_code()
577 static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 dst, sljit… in emit_op_imm() argument
585 if (SLJIT_UNLIKELY((flags & (ARG1_IMM | ARG2_IMM)) == (ARG1_IMM | ARG2_IMM))) { in emit_op_imm()
587 flags &= ~ARG1_IMM; in emit_op_imm()
592 if (flags & (ARG1_IMM | ARG2_IMM)) { in emit_op_imm()
593 reg = (flags & ARG2_IMM) ? arg1 : arg2; in emit_op_imm()
594 imm = (flags & ARG2_IMM) ? arg2 : arg1; in emit_op_imm()
596 switch (flags & 0xffff) { in emit_op_imm()
602 SLJIT_ASSERT(!(flags & SET_FLAGS) && (flags & ARG2_IMM) && arg1 == TMP_REG2); in emit_op_imm()
605 if (!(flags & SET_FLAGS)) in emit_op_imm()
624 if (!(flags & SET_FLAGS)) { in emit_op_imm()
632 return push_inst32(compiler, ADD_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
635 return push_inst32(compiler, SUB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
640 return push_inst32(compiler, ADCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
644 if (flags & ARG1_IMM) { in emit_op_imm()
649 return push_inst32(compiler, RSB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
652 if (flags & UNUSED_RETURN) { in emit_op_imm()
675 if (!(flags & SET_FLAGS)) { in emit_op_imm()
683 return push_inst32(compiler, SUB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
686 return push_inst32(compiler, ADD_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
689 if (flags & ARG1_IMM) in emit_op_imm()
693 return push_inst32(compiler, SBCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
698 return push_inst32(compiler, ANDI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
701 return push_inst32(compiler, BICI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
706 return push_inst32(compiler, ORRI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
709 return push_inst32(compiler, ORNI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
714 return push_inst32(compiler, EORI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
719 if (flags & ARG1_IMM) in emit_op_imm()
723 if (!(flags & SET_FLAGS)) in emit_op_imm()
729 switch (flags & 0xffff) { in emit_op_imm()
733 return push_inst32(compiler, LSL_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
737 return push_inst32(compiler, LSR_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
741 return push_inst32(compiler, ASR_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
748 if (flags & ARG2_IMM) { in emit_op_imm()
763 switch (flags & 0xffff) { in emit_op_imm()
768 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG2); in emit_op_imm()
773 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG2); in emit_op_imm()
778 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG2); in emit_op_imm()
783 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG2); in emit_op_imm()
788 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG2); in emit_op_imm()
796 return push_inst32(compiler, MVN_W | (flags & SET_FLAGS) | RD4(dst) | RM4(arg2)); in emit_op_imm()
804 if (dst == arg1 && !(flags & SET_FLAGS)) in emit_op_imm()
806 return push_inst32(compiler, ADD_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
810 return push_inst32(compiler, ADC_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
812 if (flags & UNUSED_RETURN) { in emit_op_imm()
819 return push_inst32(compiler, SUB_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
823 return push_inst32(compiler, SBC_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
825 if (!(flags & SET_FLAGS)) in emit_op_imm()
834 if ((flags & UNUSED_RETURN) && IS_2_LO_REGS(arg1, arg2)) in emit_op_imm()
836 return push_inst32(compiler, AND_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
840 return push_inst32(compiler, ORR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
844 return push_inst32(compiler, EOR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
848 return push_inst32(compiler, LSL_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
852 return push_inst32(compiler, LSR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
856 return push_inst32(compiler, ASR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
871 #define IS_WORD_SIZE(flags) (!(flags & (BYTE_SIZE | HALF_SIZE))) argument
965 static SLJIT_INLINE sljit_s32 emit_op_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s… in emit_op_mem() argument
979 …return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(tmp_reg) | (argw & 0x… in emit_op_mem()
983 if (IS_2_LO_REGS(reg, tmp_reg) && sljit_mem16_imm5[flags]) in emit_op_mem()
984 return push_inst16(compiler, sljit_mem16_imm5[flags] | RD3(reg) | RN3(tmp_reg)); in emit_op_mem()
985 return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(tmp_reg)); in emit_op_mem()
994 return push_inst16(compiler, sljit_mem16[flags] | RD3(reg) | RN3(arg) | RM3(other_r)); in emit_op_mem()
995 …return push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(other_r) | (argw << 4)… in emit_op_mem()
1015 if (IS_2_LO_REGS(reg, arg) && sljit_mem16_imm5[flags]) { in emit_op_mem()
1017 if (IS_WORD_SIZE(flags)) { in emit_op_mem()
1021 else if (flags & BYTE_SIZE) in emit_op_mem()
1027 SLJIT_ASSERT(flags & HALF_SIZE); in emit_op_mem()
1033 … return push_inst16(compiler, sljit_mem16_imm5[flags] | RD3(reg) | RN3(arg) | (argw << (6 - tmp))); in emit_op_mem()
1035 …else if (SLJIT_UNLIKELY(arg == SLJIT_SP) && IS_WORD_SIZE(flags) && OFFSET_CHECK(0xff, 2) && reg_ma… in emit_op_mem()
1037 return push_inst16(compiler, STR_SP | ((flags & STORE) ? 0 : 0x800) | RDN3(reg) | (argw >> 2)); in emit_op_mem()
1041 return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(arg) | argw); in emit_op_mem()
1043 return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM8 | RT4(reg) | RN4(arg) | -argw); in emit_op_mem()
1049 return push_inst16(compiler, sljit_mem16[flags] | RD3(reg) | RN3(arg) | RM3(tmp_reg)); in emit_op_mem()
1050 return push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(tmp_reg)); in emit_op_mem()
1344 sljit_s32 dst_r, flags; in sljit_emit_op1() local
1361 flags = WORD_SIZE; in sljit_emit_op1()
1364 flags = BYTE_SIZE; in sljit_emit_op1()
1369 flags = BYTE_SIZE | SIGNED; in sljit_emit_op1()
1374 flags = HALF_SIZE; in sljit_emit_op1()
1379 flags = HALF_SIZE | SIGNED; in sljit_emit_op1()
1385 flags = 0; in sljit_emit_op1()
1392 FAIL_IF(emit_op_mem(compiler, flags, dst_r, src, srcw, TMP_REG1)); in sljit_emit_op1()
1402 return emit_op_mem(compiler, flags | STORE, dst_r, dst, dstw, TMP_REG2); in sljit_emit_op1()
1413 flags = HAS_FLAGS(op_flags) ? SET_FLAGS : 0; in sljit_emit_op1()
1420 emit_op_imm(compiler, flags | op, dst_r, TMP_REG2, src); in sljit_emit_op1()
1423 return emit_op_mem(compiler, flags | STORE, dst_r, dst, dstw, TMP_REG2); in sljit_emit_op1()
1432 sljit_s32 dst_reg, flags, src2_reg; in sljit_emit_op2() local
1444 flags = HAS_FLAGS(op) ? SET_FLAGS : 0; in sljit_emit_op2()
1447 flags |= ARG1_IMM; in sljit_emit_op2()
1456 flags |= ARG2_IMM; in sljit_emit_op2()
1458 src2_reg = (!(flags & ARG1_IMM) && (src1w == TMP_REG1)) ? TMP_REG2 : TMP_REG1; in sljit_emit_op2()
1466 flags |= UNUSED_RETURN; in sljit_emit_op2()
1468 emit_op_imm(compiler, flags | GET_OPCODE(op), dst_reg, src1w, src2w); in sljit_emit_op2()
1533 static sljit_s32 emit_fop_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, slji… in emit_fop_mem() argument
1536 sljit_sw inst = VSTR_F32 | (flags & (SLJIT_F32_OP | FPU_LOAD)); in emit_fop_mem()
1847 jump->flags |= IS_COND; in sljit_emit_jump()
1849 jump->flags |= cc << 8; in sljit_emit_jump()
1857 jump->flags |= IS_BL; in sljit_emit_jump()
2170 sljit_s32 dst_r, flags = GET_ALL_FLAGS(op); in sljit_emit_op_flags() local
2212 if (!(flags & SLJIT_SET_Z)) in sljit_emit_op_flags()
2271 sljit_s32 flags; in sljit_emit_mem() local
2288 flags = WORD_SIZE; in sljit_emit_mem()
2291 flags = BYTE_SIZE; in sljit_emit_mem()
2294 flags = BYTE_SIZE | SIGNED; in sljit_emit_mem()
2297 flags = HALF_SIZE; in sljit_emit_mem()
2300 flags = HALF_SIZE | SIGNED; in sljit_emit_mem()
2304 flags = WORD_SIZE; in sljit_emit_mem()
2309 flags |= STORE; in sljit_emit_mem()
2311 inst = sljit_mem32[flags] | 0x900; in sljit_emit_mem()