Lines Matching refs:flags

159 	if (jump->flags & SLJIT_REWRITABLE_JUMP) {  in detect_jump_type()
160 jump->flags |= PATCH_ABS64; in detect_jump_type()
164 if (jump->flags & JUMP_ADDR) in detect_jump_type()
167 SLJIT_ASSERT(jump->flags & JUMP_LABEL); in detect_jump_type()
172 if (jump->flags & IS_COND) { in detect_jump_type()
175 code_ptr[-5] ^= (jump->flags & IS_CBZ) ? (0x1 << 24) : 0x1; in detect_jump_type()
177 jump->flags |= PATCH_COND; in detect_jump_type()
184 jump->flags |= PATCH_B; in detect_jump_type()
189 if (jump->flags & IS_COND) in detect_jump_type()
195 if (jump->flags & IS_COND) in detect_jump_type()
197 jump->flags |= PATCH_ABS48; in detect_jump_type()
202 jump->flags |= PATCH_ABS64; in detect_jump_type()
279 addr = (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target; in sljit_generate_code()
281 if (jump->flags & PATCH_B) { in sljit_generate_code()
284 buf_ptr[0] = ((jump->flags & IS_BL) ? BL : B) | (addr & 0x3ffffff); in sljit_generate_code()
285 if (jump->flags & IS_COND) in sljit_generate_code()
289 if (jump->flags & PATCH_COND) { in sljit_generate_code()
296 SLJIT_ASSERT((jump->flags & (PATCH_ABS48 | PATCH_ABS64)) || addr <= 0xffffffffl); in sljit_generate_code()
297 SLJIT_ASSERT((jump->flags & PATCH_ABS64) || addr <= 0xffffffffffffl); in sljit_generate_code()
302 if (jump->flags & (PATCH_ABS48 | PATCH_ABS64)) in sljit_generate_code()
304 if (jump->flags & PATCH_ABS64) in sljit_generate_code()
509 if (flags & SET_FLAGS) { \
511 if (flags & UNUSED_RETURN) \
515 static sljit_si emit_op_imm(struct sljit_compiler *compiler, sljit_si flags, sljit_si dst, sljit_sw… in emit_op_imm() argument
520 sljit_ins inv_bits = (flags & INT_OP) ? (1 << 31) : 0; in emit_op_imm()
522 sljit_si op = (flags & 0xffff); in emit_op_imm()
526 if (SLJIT_UNLIKELY((flags & (ARG1_IMM | ARG2_IMM)) == (ARG1_IMM | ARG2_IMM))) { in emit_op_imm()
528 flags &= ~ARG1_IMM; in emit_op_imm()
537 if (flags & (ARG1_IMM | ARG2_IMM)) { in emit_op_imm()
538 reg = (flags & ARG2_IMM) ? arg1 : arg2; in emit_op_imm()
539 imm = (flags & ARG2_IMM) ? arg2 : arg1; in emit_op_imm()
551 SLJIT_ASSERT(!(flags & SET_FLAGS) && (flags & ARG2_IMM) && arg1 == TMP_REG1); in emit_op_imm()
554 SLJIT_ASSERT(flags & ARG2_IMM); in emit_op_imm()
555 FAIL_IF(load_immediate(compiler, dst, (flags & INT_OP) ? (~imm & 0xffffffff) : ~imm)); in emit_op_imm()
558 if (flags & ARG1_IMM) in emit_op_imm()
584 if (imm > 0 && imm <= 0xffffff && !(flags & SET_FLAGS)) { in emit_op_imm()
588 if (nimm > 0 && nimm <= 0xffffff && !(flags & SET_FLAGS)) { in emit_op_imm()
594 inst_bits = logical_imm(imm, LOGICAL_IMM_CHECK | ((flags & INT_OP) ? 16 : 32)); in emit_op_imm()
601 inst_bits = logical_imm(imm, LOGICAL_IMM_CHECK | ((flags & INT_OP) ? 16 : 32)); in emit_op_imm()
611 if (flags & ARG1_IMM) in emit_op_imm()
613 if (flags & INT_OP) { in emit_op_imm()
624 if (flags & ARG1_IMM) in emit_op_imm()
628 if (flags & INT_OP) { in emit_op_imm()
642 if (flags & ARG2_IMM) { in emit_op_imm()
666 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1); in emit_op_imm()
672 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1); in emit_op_imm()
676 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1); in emit_op_imm()
677 if (!(flags & INT_OP)) in emit_op_imm()
682 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1); in emit_op_imm()
686 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1); in emit_op_imm()
687 if (!(flags & INT_OP)) in emit_op_imm()
692 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1); in emit_op_imm()
693 if ((flags & INT_OP) && dst == arg2) in emit_op_imm()
698 SLJIT_ASSERT(!(flags & SET_FLAGS) && arg1 == TMP_REG1); in emit_op_imm()
699 if ((flags & INT_OP) && dst == arg2) in emit_op_imm()
708 if (flags & SET_FLAGS) in emit_op_imm()
728 if (!(flags & SET_FLAGS)) in emit_op_imm()
730 if (flags & INT_OP) { in emit_op_imm()
762 if (flags & SET_FLAGS) in emit_op_imm()
778 #define MEM_SIZE_SHIFT(flags) ((flags) >> 8) argument
828 static sljit_si getput_arg_fast(struct sljit_compiler *compiler, sljit_si flags, sljit_si reg, slji… in getput_arg_fast() argument
830 sljit_ui shift = MEM_SIZE_SHIFT(flags); in getput_arg_fast()
834 if (SLJIT_UNLIKELY(flags & UPDATE)) { in getput_arg_fast()
836 if (SLJIT_UNLIKELY(flags & ARG_TEST)) in getput_arg_fast()
841 FAIL_IF(push_inst(compiler, sljit_mem_pre_simm[flags & 0x3] in getput_arg_fast()
853 if (SLJIT_UNLIKELY(flags & ARG_TEST)) in getput_arg_fast()
856 FAIL_IF(push_inst(compiler, sljit_mem_reg[flags & 0x3] | (shift << 30) | RT(reg) in getput_arg_fast()
863 if (SLJIT_UNLIKELY(flags & ARG_TEST)) in getput_arg_fast()
866 FAIL_IF(push_inst(compiler, sljit_mem_imm[flags & 0x3] | (shift << 30) in getput_arg_fast()
874 if (SLJIT_UNLIKELY(flags & ARG_TEST)) in getput_arg_fast()
877 FAIL_IF(push_inst(compiler, sljit_mem_simm[flags & 0x3] | (shift << 30) in getput_arg_fast()
909 static sljit_si getput_arg(struct sljit_compiler *compiler, sljit_si flags, sljit_si reg, in getput_arg() argument
912 sljit_ui shift = MEM_SIZE_SHIFT(flags); in getput_arg()
922 tmp_r = (flags & STORE) ? TMP_REG3 : reg; in getput_arg()
924 if (SLJIT_UNLIKELY((flags & UPDATE) && (arg & REG_MASK))) { in getput_arg()
934 return push_inst(compiler, sljit_mem_imm[flags & 0x3] | (shift << 30) | RT(reg) | RN(other_r)); in getput_arg()
942 return push_inst(compiler, sljit_mem_imm[flags & 0x3] | (shift << 30) | RT(reg) | RN(other_r)); in getput_arg()
971 …FAIL_IF(push_inst(compiler, sljit_mem_reg[flags & 0x3] | (shift << 30) | RT(reg) | RN(arg) | RM(ot… in getput_arg()
976 return push_inst(compiler, sljit_mem_imm[flags & 0x3] | (shift << 30) | RT(reg) | RN(arg)); in getput_arg()
979 FAIL_IF(push_inst(compiler, sljit_mem_imm[flags & 0x3] | (shift << 30) | RT(reg) | RN(TMP_LR))); in getput_arg()
987 return push_inst(compiler, sljit_mem_imm[flags & 0x3] | (shift << 30) | RT(reg) | RN(tmp_r)); in getput_arg()
993 return push_inst(compiler, sljit_mem_simm[flags & 0x3] | (shift << 30) in getput_arg()
997 return push_inst(compiler, sljit_mem_imm[flags & 0x3] | (shift << 30) | RT(reg) | RN(arg)); in getput_arg()
1003 return push_inst(compiler, sljit_mem_imm[flags & 0x3] | (shift << 30) in getput_arg()
1013 …return push_inst(compiler, sljit_mem_reg[flags & 0x3] | (shift << 30) | RT(reg) | RN(arg) | RM(TMP… in getput_arg()
1017 …return push_inst(compiler, sljit_mem_reg[flags & 0x3] | (shift << 30) | RT(reg) | RN(arg) | RM(TMP… in getput_arg()
1039 …return push_inst(compiler, sljit_mem_reg[flags & 0x3] | (shift << 30) | RT(reg) | RN(arg) | RM(TMP… in getput_arg()
1040 return push_inst(compiler, sljit_mem_imm[flags & 0x3] | (shift << 30) | RT(reg) | RN(TMP_REG3)); in getput_arg()
1043 static SLJIT_INLINE sljit_si emit_op_mem(struct sljit_compiler *compiler, sljit_si flags, sljit_si … in emit_op_mem() argument
1045 if (getput_arg_fast(compiler, flags, reg, arg, argw)) in emit_op_mem()
1049 return getput_arg(compiler, flags, reg, arg, argw, 0, 0); in emit_op_mem()
1052 static SLJIT_INLINE sljit_si emit_op_mem2(struct sljit_compiler *compiler, sljit_si flags, sljit_si… in emit_op_mem2() argument
1054 if (getput_arg_fast(compiler, flags, reg, arg1, arg1w)) in emit_op_mem2()
1056 return getput_arg(compiler, flags, reg, arg1, arg1w, arg2, arg2w); in emit_op_mem2()
1282 sljit_si dst_r, flags, mem_flags; in sljit_emit_op1() local
1300 flags = WORD_SIZE; in sljit_emit_op1()
1303 flags = BYTE_SIZE; in sljit_emit_op1()
1308 flags = BYTE_SIZE | SIGNED; in sljit_emit_op1()
1313 flags = HALF_SIZE; in sljit_emit_op1()
1318 flags = HALF_SIZE | SIGNED; in sljit_emit_op1()
1323 flags = INT_SIZE; in sljit_emit_op1()
1328 flags = INT_SIZE | SIGNED; in sljit_emit_op1()
1334 flags = WORD_SIZE | UPDATE; in sljit_emit_op1()
1337 flags = BYTE_SIZE | UPDATE; in sljit_emit_op1()
1342 flags = BYTE_SIZE | SIGNED | UPDATE; in sljit_emit_op1()
1347 flags = HALF_SIZE | UPDATE; in sljit_emit_op1()
1352 flags = HALF_SIZE | SIGNED | UPDATE; in sljit_emit_op1()
1357 flags = INT_SIZE | UPDATE; in sljit_emit_op1()
1362 flags = INT_SIZE | SIGNED | UPDATE; in sljit_emit_op1()
1368 flags = 0; in sljit_emit_op1()
1375 if (getput_arg_fast(compiler, flags, dst_r, src, srcw)) in sljit_emit_op1()
1378 FAIL_IF(getput_arg(compiler, flags, dst_r, src, srcw, dst, dstw)); in sljit_emit_op1()
1386 if (getput_arg_fast(compiler, flags | STORE, dst_r, dst, dstw)) in sljit_emit_op1()
1389 return getput_arg(compiler, flags | STORE, dst_r, dst, dstw, 0, 0); in sljit_emit_op1()
1394 flags = GET_FLAGS(op_flags) ? SET_FLAGS : 0; in sljit_emit_op1()
1397 flags |= INT_OP; in sljit_emit_op1()
1402 flags |= UNUSED_RETURN; in sljit_emit_op1()
1413 flags |= ARG2_IMM; in sljit_emit_op1()
1419 emit_op_imm(compiler, flags | op, dst_r, TMP_REG1, srcw); in sljit_emit_op1()
1435 sljit_si dst_r, flags, mem_flags; in sljit_emit_op2() local
1447 flags = GET_FLAGS(op) ? SET_FLAGS : 0; in sljit_emit_op2()
1450 flags |= INT_OP; in sljit_emit_op2()
1455 flags |= UNUSED_RETURN; in sljit_emit_op2()
1458 flags |= SLOW_DEST; in sljit_emit_op2()
1464 flags |= SLOW_SRC1; in sljit_emit_op2()
1470 flags |= SLOW_SRC2; in sljit_emit_op2()
1473 if ((flags & (SLOW_SRC1 | SLOW_SRC2)) == (SLOW_SRC1 | SLOW_SRC2)) { in sljit_emit_op2()
1483 else if (flags & SLOW_SRC1) in sljit_emit_op2()
1485 else if (flags & SLOW_SRC2) in sljit_emit_op2()
1494 flags |= ARG1_IMM; in sljit_emit_op2()
1498 flags |= ARG2_IMM; in sljit_emit_op2()
1502 emit_op_imm(compiler, flags | GET_OPCODE(op), dst_r, src1w, src2w); in sljit_emit_op2()
1505 if (!(flags & SLOW_DEST)) { in sljit_emit_op2()
1550 static sljit_si emit_fop_mem(struct sljit_compiler *compiler, sljit_si flags, sljit_si reg, sljit_s… in emit_fop_mem() argument
1552 sljit_ui shift = MEM_SIZE_SHIFT(flags); in emit_fop_mem()
1559 if (!(flags & STORE)) in emit_fop_mem()
1893 jump->flags |= IS_COND; in sljit_emit_jump()
1897 jump->flags |= IS_BL; in sljit_emit_jump()
1918 jump->flags |= IS_CBZ | IS_COND; in emit_cmp_to0()
1972 sljit_si dst_r, flags, mem_flags; in sljit_emit_op_flags() local
1995 flags = GET_FLAGS(op) ? SET_FLAGS : 0; in sljit_emit_op_flags()
1998 flags |= INT_OP; in sljit_emit_op_flags()
2007 flags |= ARG1_IMM; in sljit_emit_op_flags()
2010 emit_op_imm(compiler, flags | GET_OPCODE(op), dst_r, src, TMP_REG2); in sljit_emit_op_flags()