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()
579 static sljit_s32 emit_op_imm(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 dst, sljit… in emit_op_imm() argument
587 if (SLJIT_UNLIKELY((flags & (ARG1_IMM | ARG2_IMM)) == (ARG1_IMM | ARG2_IMM))) { in emit_op_imm()
589 flags &= ~ARG1_IMM; in emit_op_imm()
594 if (flags & (ARG1_IMM | ARG2_IMM)) { in emit_op_imm()
595 reg = (flags & ARG2_IMM) ? arg1 : arg2; in emit_op_imm()
596 imm = (flags & ARG2_IMM) ? arg2 : arg1; in emit_op_imm()
598 switch (flags & 0xffff) { in emit_op_imm()
604 SLJIT_ASSERT(!(flags & SET_FLAGS) && (flags & ARG2_IMM) && arg1 == TMP_REG2); in emit_op_imm()
607 if (!(flags & SET_FLAGS)) in emit_op_imm()
627 if (!(flags & SET_FLAGS)) { in emit_op_imm()
635 return push_inst32(compiler, ADD_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
638 return push_inst32(compiler, SUB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
643 return push_inst32(compiler, ADCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
648 if (flags & ARG1_IMM) { in emit_op_imm()
653 return push_inst32(compiler, RSB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
656 if (flags & UNUSED_RETURN) { in emit_op_imm()
679 if (!(flags & SET_FLAGS)) { in emit_op_imm()
687 return push_inst32(compiler, SUB_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
690 return push_inst32(compiler, ADD_WI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
693 if (flags & ARG1_IMM) in emit_op_imm()
697 return push_inst32(compiler, SBCI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
702 return push_inst32(compiler, ANDI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
705 return push_inst32(compiler, BICI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
710 return push_inst32(compiler, ORRI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | nimm); in emit_op_imm()
713 return push_inst32(compiler, ORNI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
718 return push_inst32(compiler, EORI | (flags & SET_FLAGS) | RD4(dst) | RN4(reg) | imm); in emit_op_imm()
723 if (flags & ARG1_IMM) in emit_op_imm()
727 if (!(flags & SET_FLAGS)) in emit_op_imm()
733 switch (flags & 0xffff) { in emit_op_imm()
737 return push_inst32(compiler, LSL_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
741 return push_inst32(compiler, LSR_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
745 return push_inst32(compiler, ASR_WI | (flags & SET_FLAGS) | RD4(dst) | RM4(reg) | IMM5(imm)); in emit_op_imm()
752 if (flags & ARG2_IMM) { in emit_op_imm()
767 switch (flags & 0xffff) { in emit_op_imm()
772 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG2); in emit_op_imm()
777 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG2); in emit_op_imm()
782 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG2); in emit_op_imm()
787 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG2); in emit_op_imm()
792 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG2); in emit_op_imm()
800 return push_inst32(compiler, MVN_W | (flags & SET_FLAGS) | RD4(dst) | RM4(arg2)); in emit_op_imm()
809 if (dst == arg1 && !(flags & SET_FLAGS)) in emit_op_imm()
811 return push_inst32(compiler, ADD_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
815 return push_inst32(compiler, ADC_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
818 if (flags & UNUSED_RETURN) { in emit_op_imm()
825 return push_inst32(compiler, SUB_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
829 return push_inst32(compiler, SBC_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
832 if (!(flags & SET_FLAGS)) in emit_op_imm()
841 if ((flags & UNUSED_RETURN) && IS_2_LO_REGS(arg1, arg2)) in emit_op_imm()
843 return push_inst32(compiler, AND_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
847 return push_inst32(compiler, ORR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
851 return push_inst32(compiler, EOR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
855 return push_inst32(compiler, LSL_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
859 return push_inst32(compiler, LSR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
863 return push_inst32(compiler, ASR_W | (flags & SET_FLAGS) | RD4(dst) | RN4(arg1) | RM4(arg2)); in emit_op_imm()
878 #define IS_WORD_SIZE(flags) (!(flags & (BYTE_SIZE | HALF_SIZE))) argument
972 static SLJIT_INLINE sljit_s32 emit_op_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s… in emit_op_mem() argument
986 …return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(tmp_reg) | (argw & 0x… in emit_op_mem()
990 if (IS_2_LO_REGS(reg, tmp_reg) && sljit_mem16_imm5[flags]) in emit_op_mem()
991 return push_inst16(compiler, sljit_mem16_imm5[flags] | RD3(reg) | RN3(tmp_reg)); in emit_op_mem()
992 return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(tmp_reg)); in emit_op_mem()
1001 return push_inst16(compiler, sljit_mem16[flags] | RD3(reg) | RN3(arg) | RM3(other_r)); in emit_op_mem()
1002 …return push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(other_r) | (argw << 4)… in emit_op_mem()
1022 if (IS_2_LO_REGS(reg, arg) && sljit_mem16_imm5[flags]) { in emit_op_mem()
1024 if (IS_WORD_SIZE(flags)) { in emit_op_mem()
1028 else if (flags & BYTE_SIZE) in emit_op_mem()
1034 SLJIT_ASSERT(flags & HALF_SIZE); in emit_op_mem()
1040 … return push_inst16(compiler, sljit_mem16_imm5[flags] | RD3(reg) | RN3(arg) | (argw << (6 - tmp))); in emit_op_mem()
1042 …else if (SLJIT_UNLIKELY(arg == SLJIT_SP) && IS_WORD_SIZE(flags) && OFFSET_CHECK(0xff, 2) && reg_ma… in emit_op_mem()
1044 return push_inst16(compiler, STR_SP | ((flags & STORE) ? 0 : 0x800) | RDN3(reg) | (argw >> 2)); in emit_op_mem()
1048 return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM12 | RT4(reg) | RN4(arg) | argw); in emit_op_mem()
1050 return push_inst32(compiler, sljit_mem32[flags] | MEM_IMM8 | RT4(reg) | RN4(arg) | -argw); in emit_op_mem()
1056 return push_inst16(compiler, sljit_mem16[flags] | RD3(reg) | RN3(arg) | RM3(tmp_reg)); in emit_op_mem()
1057 return push_inst32(compiler, sljit_mem32[flags] | RT4(reg) | RN4(arg) | RM4(tmp_reg)); in emit_op_mem()
1351 sljit_s32 dst_r, flags; in sljit_emit_op1() local
1368 flags = WORD_SIZE; in sljit_emit_op1()
1371 flags = BYTE_SIZE; in sljit_emit_op1()
1376 flags = BYTE_SIZE | SIGNED; in sljit_emit_op1()
1381 flags = HALF_SIZE; in sljit_emit_op1()
1386 flags = HALF_SIZE | SIGNED; in sljit_emit_op1()
1392 flags = 0; in sljit_emit_op1()
1399 FAIL_IF(emit_op_mem(compiler, flags, dst_r, src, srcw, TMP_REG1)); in sljit_emit_op1()
1409 return emit_op_mem(compiler, flags | STORE, dst_r, dst, dstw, TMP_REG2); in sljit_emit_op1()
1420 flags = HAS_FLAGS(op_flags) ? SET_FLAGS : 0; in sljit_emit_op1()
1427 emit_op_imm(compiler, flags | op, dst_r, TMP_REG2, src); in sljit_emit_op1()
1430 return emit_op_mem(compiler, flags | STORE, dst_r, dst, dstw, TMP_REG2); in sljit_emit_op1()
1439 sljit_s32 dst_reg, flags, src2_reg; in sljit_emit_op2() local
1451 flags = HAS_FLAGS(op) ? SET_FLAGS : 0; in sljit_emit_op2()
1454 flags |= ARG1_IMM; in sljit_emit_op2()
1463 flags |= ARG2_IMM; in sljit_emit_op2()
1465 src2_reg = (!(flags & ARG1_IMM) && (src1w == TMP_REG1)) ? TMP_REG2 : TMP_REG1; in sljit_emit_op2()
1473 flags |= UNUSED_RETURN; in sljit_emit_op2()
1475 emit_op_imm(compiler, flags | GET_OPCODE(op), dst_reg, src1w, src2w); in sljit_emit_op2()
1540 static sljit_s32 emit_fop_mem(struct sljit_compiler *compiler, sljit_s32 flags, sljit_s32 reg, slji… in emit_fop_mem() argument
1543 sljit_sw inst = VSTR_F32 | (flags & (SLJIT_F32_OP | FPU_LOAD)); in emit_fop_mem()
1858 jump->flags |= IS_COND; in sljit_emit_jump()
1860 jump->flags |= cc << 8; in sljit_emit_jump()
1868 jump->flags |= IS_BL; in sljit_emit_jump()
2181 sljit_s32 dst_r, flags = GET_ALL_FLAGS(op); in sljit_emit_op_flags() local
2223 if (!(flags & SLJIT_SET_Z)) in sljit_emit_op_flags()
2282 sljit_s32 flags; in sljit_emit_mem() local
2299 flags = WORD_SIZE; in sljit_emit_mem()
2302 flags = BYTE_SIZE; in sljit_emit_mem()
2305 flags = BYTE_SIZE | SIGNED; in sljit_emit_mem()
2308 flags = HALF_SIZE; in sljit_emit_mem()
2311 flags = HALF_SIZE | SIGNED; in sljit_emit_mem()
2315 flags = WORD_SIZE; in sljit_emit_mem()
2320 flags |= STORE; in sljit_emit_mem()
2322 inst = sljit_mem32[flags] | 0x900; in sljit_emit_mem()